/**
 * Demo Page Styles
 * Adapted from exercise styles for standalone demo
 */

:root {
    --demo-purple-gradient: linear-gradient(to right, #9333ea, #4f46e5);
    --demo-light-purple: #faf5ff;
    --demo-purple: #6b21a8;
    --demo-blue-purple: #eff2ff;
    --demo-accent: #2563eb;
    
    /* Orange theme (from vocabulary) */
    --ms-orange: #ea580c;
    --ms-orange-border: rgb(251 146 60 / 1);
    --ms-light-orange-border: rgb(254 215 170 / 1);
    --ms-brown: rgb(120 53 15 / 1);
    --ms-light-brown: rgb(180 83 9 / 1);
    --ms-orange-gradient: linear-gradient(to right, #f59e0b, #f97316);
    --ms-back-orange-gradient: linear-gradient(to bottom right, #fff7ed, #fffbeb);
    --ms-sm-container-width: 800px;
    --ms-heavy-shadow: 0 0 #0000, 0 0 #0000, 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;
}

/* Body - No header/footer */
.demo-page-body {
    background: linear-gradient(to bottom right, #faf5ff, #f3e8ff, #fff);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Exit Button (inside header) */
.demo-exit-btn {
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.demo-exit-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Demo Page Layout */
.demo-page {
    position: relative;
    padding-top: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 20px;
    min-height: calc(100vh - 200px);
}

/* Demo Header - Full Width */
.demo-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
    padding: 12px 20px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.demo-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.demo-progress {
    font-size: 1rem;
    font-weight: 600;
    color: var(--demo-purple);
}

.demo-progress-text {
    background: var(--demo-light-purple);
    padding: 8px 16px;
    border-radius: 8px;
}

/* Demo Coins (inside header) */
.demo-coins {
    position: relative;
}

.demo-coins-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    padding: 8px 16px;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.demo-coins-inner svg {
    opacity: 0.9;
    width: 18px;
    height: 18px;
}

.demo-coin-popup {
    position: absolute;
    top: -10px;
    right: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #22c55e;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.demo-coin-popup.active {
    animation: coinPopup 1.5s ease-out forwards;
}

@keyframes coinPopup {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

/* Flying coins animation */
.demo-flying-coin-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
}

.demo-flying-coin {
    position: absolute;
    width: 50px;
    height: 50px;
    animation: flyToWallet 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    filter: drop-shadow(0 4px 8px rgba(251, 191, 36, 0.5));
}

.demo-flying-coin svg {
    width: 100%;
    height: 100%;
    animation: spinCoin 1.8s linear;
}

@keyframes flyToWallet {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    70% {
        transform: translate(var(--target-x), var(--target-y)) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(var(--target-x), var(--target-y)) scale(0.3);
        opacity: 0;
    }
}

@keyframes spinCoin {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(720deg);
    }
}

/* Demo Exercises Container */
.demo-exercises {
    margin-bottom: 24px;
}

.demo-exercise {
    display: none;
}

.demo-exercise.active {
    display: block;
}

/* Demo Navigation */
.demo-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.demo-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-nav-prev {
    background: #e5e7eb;
    color: #374151;
}

.demo-nav-prev:hover:not(:disabled) {
    background: #d1d5db;
}

.demo-nav-next {
    background: linear-gradient(to right, #2563eb, #4f46e5);
    color: #fff;
}

.demo-nav-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.demo-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Demo CTA */
.demo-cta {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.demo-cta-content {
    background: #fff;
    padding: 48px;
    border-radius: 24px;
    text-align: center;
    max-width: 500px;
    margin: 20px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.demo-cta-title {
    color: var(--demo-purple);
    margin: 0 0 16px;
}

.demo-cta-text {
    color: #4b5563;
    margin: 0 0 12px;
}

.demo-cta-text strong {
    color: #f59e0b;
    font-size: 1.2em;
}

.demo-cta-btn {
    margin-top: 24px;
    display: inline-block;
    text-decoration: none;
    padding: 16px 32px !important;
    font-size: 1.1rem !important;
}

/* ============================================
   VOCABULARY EXERCISE STYLES
   ============================================ */

.vocabulary-1 {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.basic {
    max-width: var(--ms-sm-container-width);
    margin: 0 auto;
    border-radius: 0.75rem;
    padding: 16px;
    border: 2px solid var(--ms-orange-border);
    box-shadow: var(--ms-heavy-shadow);
    background: #ffffffe6;
    width: 100%;
}

.basic__title {
    text-align: center;
    margin: 0 0 16px;
    background: var(--ms-orange);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.basic__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    background: var(--ms-back-orange-gradient);
    border: 2px solid var(--ms-light-orange-border);
    border-radius: 0.75rem;
    padding: 16px;
    margin-bottom: 16px;
}

.basic__icon {
    margin: 0;
    font-size: 2.25rem;
    animation: bounce 1s infinite;
}

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

.basic__subtitle {
    margin: 0;
    color: var(--ms-brown);
}

.basic__head-text {
    color: var(--ms-brown);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.basic__voice-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.basic__voice-card {
    border: 2px solid var(--ms-light-orange-border);
    background: var(--ms-back-orange-gradient);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.75rem;
    transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1),
        border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.basic__voice-card:hover {
    box-shadow: var(--ms-heavy-shadow);
    border: 2px solid rgb(253 230 138 / 1);
}

.basic__voice-card.listened {
    background: #ecfdf5 !important;
    border-color: rgb(187 247 208 / 1) !important;
    box-shadow: var(--ms-heavy-shadow) !important;
}

.basic__voice-card-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.basic__voice-icon {
    font-size: 1.875rem;
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.basic__voice-card:hover .basic__voice-icon {
    transform: scale(1.1);
}

.basic__voice-text {
    display: flex;
    flex-direction: column;
}

.basic__voice-english,
.basic__voice-translate {
    margin: 0;
}

.basic__voice-english {
    color: var(--ms-brown);
}

.basic__voice-translate {
    color: var(--ms-light-brown);
}

.basic__voice-btn {
    border: none;
    background: var(--ms-orange-gradient);
    width: 53px;
    height: 53px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--ms-heavy-shadow);
    cursor: pointer;
    transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1),
        background 150ms cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.basic__voice-btn:hover {
    transform: scale(1.08);
    background: linear-gradient(#ea580c, #ea580c);
}

.basic__voice-btn.checked {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.basic__voice-btn svg {
    flex-shrink: 0;
    color: #fff;
}

@media (max-width: 767px) {
    .basic__voice-cards {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   VIDEO INTRODUCTION STYLES
   ============================================ */

.video-introduction {
    max-width: 900px;
    margin: 0 auto;
}

.video-player {
    border: 2px solid #bfdbfe;
    padding: 16px;
    background: #fdfeff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.video-player__title {
    text-align: center;
    background: linear-gradient(to right, #2563eb, #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    margin: 0 0 16px 0;
}

.video-player__container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-player__iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.video-player__skip-hint {
    text-align: center;
    color: #6b7280;
    margin: 16px 0 0;
    font-style: italic;
}

/* ============================================
   MATCHING GAME STYLES
   ============================================ */

.matching-game {
    position: relative;
}

.game {
    max-width: 1152px;
    margin: 0 auto;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.game__title {
    background: var(--demo-purple-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

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

.game__result {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    background: var(--demo-light-purple);
}

.game__result-text,
.game__result-num {
    color: var(--demo-purple);
}

.game__banner {
    border-radius: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--demo-blue-purple);
}

.game__banner-text {
    color: #9333ea;
    text-align: center;
}

.game__banner-line {
    height: 16px;
    width: 1px;
    display: inline-block;
    background: #e9d5ff;
}

.game__cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.game__card {
    perspective: 1000px;
    transform-style: preserve-3d;
    position: relative;
    aspect-ratio: 4/5;
    cursor: pointer;
}

.game__card.ok {
    animation: rising 0.4s ease 1;
}

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

.game__card.generated .game__card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.game__card.active .game__card-inner {
    transform: rotateY(180deg);
}

.game__card-front,
.game__card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
}

.game__card-front {
    background: #fff;
    transform: rotateY(180deg);
    border: 2px solid #e9d5ff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 8px;
    overflow: hidden;
}

.ok .game__card-front {
    background: #ecfdf5;
    border-color: rgb(187 247 208/1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.game__card-front img {
    max-width: 100%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 6px;
}

.game__card-text {
    text-align: center;
    margin: 0;
    color: var(--demo-purple);
    font-size: 1rem;
    font-weight: 600;
}

.game__card-back {
    background: linear-gradient(to bottom right, #a855f7, #6366f1);
    font-size: 48px;
}

.game__card-back:hover {
    background: linear-gradient(to bottom right, #9333ea, #4f46e5);
}

.game__status-bar {
    width: 100%;
    height: 12px;
    background: rgb(243 232 255/1);
    border-radius: 9999px;
    overflow: hidden;
}

.game__status-bar-full {
    background: linear-gradient(to right, #a855f7, #6366f1);
    width: 0;
    height: 100%;
    transition: width 0.4s ease;
}

/* Matching Game Modal */
.matching-game .modal {
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #00000080;
    width: 100%;
    height: 100%;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.2s ease;
}

.matching-game .modal.active {
    visibility: visible;
    opacity: 1;
}

.modal__window {
    background: #fff;
    margin: 1rem;
    padding: 2rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal__window {
    transform: scale(1);
}

.modal__icon {
    margin: 0;
    font-size: 3.75rem;
    text-align: center;
    line-height: 1.2;
}

.modal.active .modal__icon {
    animation: rotate 700ms linear;
}

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

.modal__title {
    margin: 0;
    color: var(--demo-purple);
    text-align: center;
}

.modal__results {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #faf5ff;
}

.modal__text {
    margin: 0;
    color: var(--demo-purple);
}

.modal__buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.modal__btn {
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal__again {
    background: #f3e8ff;
    color: var(--demo-purple);
}

.modal__again:hover {
    background: #e9d5ff;
}

.modal__continue {
    background: linear-gradient(to bottom right, #a855f7, #6366f1);
    color: #fff !important;
}

.modal__continue:hover {
    background: linear-gradient(to bottom right, #9333ea, #4f46e5);
}

/* Responsive */
@media (max-width: 900px) {
    .game__cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 767px) {
    .demo-header {
        gap: 12px;
    }
    
    .game__head {
        flex-direction: column;
    }

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

    .game__card {
        aspect-ratio: 1 / 1;
    }
    
    .demo-nav {
        flex-direction: column;
    }
    
    .demo-nav-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 575px) {
    .game__results {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0;
    }

    .game__result {
        width: 48%;
        text-align: center;
    }

    .game__result#attempts {
        width: 100%;
        margin-top: 1rem;
    }
}

@media (max-width: 360px) {
    .game__cards {
        grid-template-columns: 1fr;
    }

    .game__card {
        aspect-ratio: unset;
        height: 180px;
    }
}

/* ============================================
   FILL IN THE BLANK STYLES
   ============================================ */

.fill_in_the-blanks {
    position: relative;
}

.fillin-content {
    margin: 0 auto;
    border-radius: 1.5rem;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 896px;
    padding: 2rem;
}

.fillin-content__title {
    text-align: center;
    background: #4f46e5;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    margin: 0 0 32px;
}

.fillin-progress {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.fillin-progress__nums {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1e40af;
}

.fillin-progress__question,
.fillin-progress__score {
    margin: 0;
}

.fillin-progress__bar {
    width: 100%;
    height: 8px;
    background: #dbeafe;
    margin-bottom: 32px;
    border-radius: 9999px;
}

.fillin-progress__bar-fill {
    height: 100%;
    width: 0;
    border-radius: 9999px;
    background: #3b82f6;
    transition: width 150ms ease;
}

.fillin-exercises {
    position: relative;
    width: 100%;
}

.fillin-exercise {
    border-radius: 1.5rem;
    background: #eff6ff;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    width: 100%;
    transform: translate(0, 20px);
    opacity: 0;
    transition: all 300ms ease;
    visibility: hidden;
}

.fillin-exercise.active {
    position: static;
    opacity: 1;
    transform: none;
    visibility: visible;
}

.fillin-exercise__text {
    display: flex;
    align-content: center;
    gap: 1rem;
    margin: 0 0 1.5rem;
    direction: ltr;
}

.fillin-exercise__english {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fillin-exercise__english-before,
.fillin-exercise__english-after {
    font-size: 24px;
    font-weight: normal;
}

.fillin-exercise__english-answer {
    border: 2px solid rgb(191 219 254 /1);
    height: 45px;
    min-width: 150px;
    width: max-content;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    padding: 0 1rem;
    color: #60a5fa;
    background: #fff;
}

.fillin-exercise.success .fillin-exercise__english-answer {
    border: 2px solid #86efac;
    background: rgb(220 252 231/1);
}

.fillin-exercise.error .fillin-exercise__english-answer {
    border: 2px solid #fca5a5;
    background: #fee2e2;
}

.fillin-exercise__english-answer.selected {
    color: #000;
    font-size: 24px;
    font-weight: 700;
}

.fillin-exercise__status {
    display: none;
    align-items: center;
}

.fillin-exercise.error .fillin-exercise__status,
.fillin-exercise.success .fillin-exercise__status {
    display: flex;
}

.fillin-exercise__status svg {
    width: 2rem;
    height: 2rem;
    display: none;
}

.fillin-exercise__error-btn {
    cursor: pointer;
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
}

.fillin-exercise.error .fillin-exercise__error {
    display: inline-block;
}

.fillin-exercise.success .fillin-exercise__success {
    display: inline-block;
}

.fillin-exercise__error {
    color: #ef4444;
}

.fillin-exercise__success {
    color: #66d593;
}

.fillin-exercise__translate {
    margin: 0 0 1.5rem;
    color: #4b5563;
}

.fillin-exercise__true-answer {
    color: #2563eb;
    margin: 0 0 2.25rem;
    display: none;
}

.fillin-exercise.error .fillin-exercise__true-answer {
    display: inline-block;
}

.fillin-exercise__answers {
    display: flex;
    gap: 0.75rem;
    margin: 0 0 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.fillin-exercise__answer {
    background: #e0e7ff;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 150ms ease;
    cursor: pointer;
}

.fillin-exercise__answer:hover {
    background: #c7d2fe;
    transform: scale(1.05);
}

.fillin-exercise.success .fillin-exercise__answer {
    opacity: 0.5;
    cursor: no-drop;
    pointer-events: none;
}

.fillin-exercise__answer:has(input:checked) {
    background: #bfdbfe;
}

.fillin-exercise__answer input {
    display: none;
}

.fillin-exercise__answer-text {
    margin: 0;
    color: #3730a3;
}

.fillin-exercise__answer:has(input:checked) .fillin-exercise__answer-text {
    color: #1e40af;
}

.fillin-exercise__buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fillin-exercise__check {
    background: #2563eb;
    border-color: transparent;
    font-weight: 500;
    box-shadow: none;
    color: #fff !important;
    cursor: no-drop;
    opacity: 0.5;
    pointer-events: none;
}

.fillin-exercise:has(input:checked):not(.success) .fillin-exercise__check {
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
}

.fillin-exercise__check:hover {
    background: #1d4ed8;
}

.fillin-exercise__again {
    background: #e5e7eb;
    border-color: transparent;
    font-weight: 500;
    box-shadow: none;
    color: #374151 !important;
    display: none;
}

.fillin-exercise.error .fillin-exercise__again {
    display: flex;
}

.fillin-exercise__again:hover {
    background: #d1d5db;
}

/* Fill-in Modal */
.fillin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgb(0 0 0 / 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 200ms ease;
    z-index: 100;
}

.fillin-modal.active {
    visibility: visible;
    opacity: 1;
}

.fillin-modal__window {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    transform: scale(.9);
    transition: transform 250ms ease;
}

.fillin-modal.active .fillin-modal__window {
    transform: none;
}

.fillin-modal__title {
    text-align: center;
    margin: 0 0 1rem;
    color: #1e40af;
}

.fillin-modal__results {
    padding: 1rem;
    background: #eff6ff;
    border-radius: 1rem;
    margin-bottom: 24px;
}

.fillin-modal__score,
.fillin-modal__attempts {
    text-align: center;
    margin: 0;
    color: #1e40af;
}

.fillin-modal__next {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

@media (max-width: 576px) {
    .fillin-exercise__english-answer {
        min-width: 100px;
    }
    
    .fillin-content {
        padding: 1rem;
    }
    
    .fillin-exercise {
        padding: 1rem;
    }
}

/* ============================================
   SCRAMBLE CHALLENGE STYLES
   ============================================ */

.scramble {
    position: relative;
}

.scramble-challenge {
    background: #fbfffd;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    max-width: 896px;
    margin: 0 auto;
    padding: 1rem;
}

.scramble-challenge__title {
    background: linear-gradient(to right, #16a34a, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    margin: 0 0 12px;
    text-align: center;
}

.scramble-challenge__head {
    padding: 1rem;
    background: #f0fdf9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.scramble-challenge__head-title {
    color: rgb(22 101 52 /1);
    margin: 0;
    text-align: center;
}

.scramble-challenge__head-text {
    color: rgb(21 128 61/1);
    margin: 0;
    text-align: center;
}

.scramble-challenge__games {
    background: #f0fdf9;
    border-radius: 0.75rem;
    border: 1px solid rgb(220 252 231 /1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.scramble-challenge__answer {
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 24px;
    flex-wrap: wrap;
    min-height: 70px;
    direction: ltr;
}

.scramble-challenge__answer-word {
    background: #f9fafb;
    border: 1px solid rgb(229 231 235/1);
    border-radius: 0.375rem;
    height: 33px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    justify-content: center;
    transition: all 300ms ease;
}

.scramble-challenge__answer-word:has(span) {
    border: 2px solid rgb(74 222 128 /1);
    background: #dcfce7;
    padding: 0 1rem;
    height: 48px;
}

.scramble-challenge__answer-word span {
    color: rgb(22 101 52/1);
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.75rem;
    animation: scrambleGrow 300ms 1;
}

@keyframes scrambleGrow {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.scramble-challenge__congratulations {
    margin: 0 0 16px;
    text-align: center;
    color: rgb(22 163 74 /1);
    display: none;
}

.scramble-challenge__congratulations.active {
    animation: scrambleDown 150ms 1;
    display: block;
}

@keyframes scrambleDown {
    0% {
        opacity: 0;
        transform: translate(0, 10px);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

.scramble-challenge__variants {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.scramble-challenge__variant {
    padding: 0 1rem;
    height: 48px;
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.75rem;
    border-radius: 0.5rem;
    background-image: linear-gradient(to right, #22c55e, #14b8a6);
    transition: transform 150ms ease;
    cursor: pointer;
}

.scramble-challenge__variant:hover {
    transform: scale(1.05);
}

.scramble-challenge__variant:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: no-drop;
}

.scramble-challenge__refresh {
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: #fef3c7;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: rgb(146 64 14/1);
    font-size: 14px;
    height: 40px;
    cursor: pointer;
    transition: background 150ms ease;
}

.scramble-challenge__refresh:hover {
    background: rgb(253 230 138/1);
}

.scramble-challenge__refresh svg {
    width: 16px;
    height: 16px;
    color: rgb(146 64 14/1);
}

/* Scramble Modals */
.scramble-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    background-color: rgb(0 0 0 / 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
    transition: all 0.2s ease;
}

.scramble-modal.active {
    opacity: 1;
    visibility: visible;
}

.scramble-modal__stars {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.scramble-modal__stars svg {
    fill: #facc15;
    color: #facc15;
    width: 2rem;
    height: 2rem;
}

.scramble-modal__window {
    background: #fff;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border-radius: 0.75rem;
    transition: transform 300ms ease;
    transform: scale(0.7);
    margin: 1rem;
}

.scramble-modal.active .scramble-modal__window {
    transform: none;
}

.scramble-modal__title {
    text-align: center;
    color: rgb(22 101 52/1);
    margin: 0 0 1rem;
}

.scramble-modal__results {
    padding: 1rem;
    background: #f0fdf4;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    flex-direction: column;
    margin-bottom: 2rem;
}

.scramble-modal__results p {
    margin: 0;
    color: rgb(22 101 52/1);
}

.scramble-modal__link {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scramble-modal-wrong__title {
    text-align: center;
    color: #ea580c;
    margin: 0 0 1rem;
}

.scramble-modal-wrong__btn {
    justify-content: center;
    width: 100%;
}

.scramble__canvas {
    position: fixed;
    top: 0px;
    left: 0px;
    pointer-events: none;
    z-index: 100;
    width: 100%;
    height: 100%;
}

@media (max-width: 575px) {
    .scramble-challenge {
        padding: 0.75rem;
    }
    
    .scramble-challenge__games {
        padding: 1rem;
    }
}

