* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Comic Sans MS", "Trebuchet MS", Arial, sans-serif;
    color: #3d2388;
    overflow-x: hidden;
    background:
        linear-gradient(rgba(255,255,255,.05), rgba(255,255,255,.08)),
        url("images/color-bg.webp") center / cover no-repeat fixed;
}

.game-page {
    width: 100%;
    min-height: 100vh;
    padding: 18px 14px 28px;
}

.top-panel {
    width: min(1320px, 94%);
    margin: 0 auto 20px;
    padding: 18px 24px;
    border-radius: 28px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 12px 30px rgba(70, 50, 130, .20);
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
}

.left-tools,
.right-tools {
    display: flex;
    gap: 12px;
}

.right-tools {
    justify-content: flex-end;
}

.tool-btn {
    border: 0;
    min-width: 76px;
    min-height: 70px;
    border-radius: 18px;
    background: #fff;
    color: #5b37b7;
    font-weight: 900;
    box-shadow: 0 8px 16px rgba(0,0,0,.12);
    cursor: pointer;
    font-size: 25px;
}

.tool-btn span {
    display: block;
    font-size: 13px;
    margin-top: 4px;
}

.title-box {
    text-align: center;
    position: relative;
}
.lily-badge {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,.15);
    font-size: 27px;
}

h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 64px);
    color: #7b54e8;
    text-shadow: 0 4px 0 #fff;
}

.title-box p {
    display: inline-block;
    margin: 8px 0 0;
    padding: 8px 32px;
    border-radius: 999px;
    background: #8d57df;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
}

.game-wrap {
    width: min(1050px, 94%);
    margin: auto;
}

.stats-row {
    display: grid;
    grid-template-columns: 180px 1fr 180px;
    gap: 18px;
    margin-bottom: 18px;
    align-items: center;
}

.stat-card,
.progress-card {
    background: rgba(255,255,255,.88);
    border-radius: 20px;
    min-height: 78px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    font-size: 34px;
}

.stat-card span {
    display: block;
    font-size: 14px;
    color: #7b54e8;
}

.stat-card strong {
    display: block;
    font-size: 34px;
    color: #19a74c;
}

.progress-card strong {
    font-size: 22px;
}

.progress-bar {
    height: 17px;
    margin-top: 12px;
    background: #e7e7e7;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #27c04b, #a6ef3b);
}

.levels-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.level-card {
    border: 0;
    border-radius: 24px;
    padding: 22px;
    background: rgba(255,255,255,.84);
    color: #4d2ca0;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    cursor: pointer;
    font-weight: 900;
    font-size: 22px;
}

.level-card.active {
    outline: 5px solid #a66cff;
    background: rgba(255,245,255,.92);
}

.level-card strong,
.level-card span {
    display: block;
}

.level-card span {
    margin-top: 8px;
    font-size: 15px;
}

.play-panel {
    min-height: 390px;
    padding: 34px;
    border-radius: 30px;
    border: 4px solid rgba(91, 207, 125, .75);
    background: rgba(255,255,255,.38);
    backdrop-filter: blur(10px);
    box-shadow: 0 14px 35px rgba(0,0,0,.20);
    position: relative;
    overflow: hidden;
}

.start-screen,
.game-screen {
    min-height: 310px;
    display: grid;
    place-items: center;
    text-align: center;
}

.lily-large {
    width: 190px;
    max-width: 70%;
    object-fit: contain;
    filter: drop-shadow(0 10px 14px rgba(0,0,0,.18));
}

.start-screen h2 {
    font-size: 36px;
    margin: 10px 0;
}

.start-screen p {
    font-size: 22px;
    font-weight: 900;
}

.main-btn,
.restart-btn,
.hint-btn,
.home-btn {
    border: 0;
    border-radius: 22px;
    padding: 16px 36px;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 7px 0 rgba(0,0,0,.18);
}

.main-btn {
    background: linear-gradient(#55cfff, #238fe8);
}

.restart-btn {
    background: linear-gradient(#ff9d46, #ff6b22);
}

.hint-btn {
    background: #fff;
    color: #6c3bd5;
}

.home-btn {
    background: linear-gradient(#9d73ff, #6c3bd5);
}

.game-screen {
    grid-template-columns: 230px 1fr;
    gap: 25px;
}

.lily-side {
    width: 230px;
    max-width: 100%;
    align-self: end;
    object-fit: contain;
    filter: drop-shadow(0 12px 16px rgba(0,0,0,.18));
}
.question-bubble {
    width: 100%;
    min-height: 220px;
    border-radius: 28px;
    padding: 30px;
    background: rgba(255, 253, 220, .94);
    display: grid;
    place-items: center;
}

.question-bubble h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
}

.visual-question {
    font-size: 70px;
    margin-top: 18px;
}

.answers {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 18px;
}

.answer-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 9px solid #fff;
    box-shadow: 0 8px 0 rgba(0,0,0,.18);
    cursor: pointer;
    font-size: 46px;
    font-weight: 900;
}

.answer-btn.text-answer {
    width: auto;
    min-width: 150px;
    border-radius: 24px;
    padding: 0 20px;
    background: #fff;
    color: #4d2ca0;
    font-size: 26px;
}

.bottom-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 18px;
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(40,20,90,.45);
    z-index: 20;
}

.modal-card {
    width: min(480px, 94vw);
    padding: 34px;
    border-radius: 32px;
    background: #fffbea;
    text-align: center;
    color: #352076;
    box-shadow: 0 20px 40px rgba(0,0,0,.25);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 14px;
    right: 18px;
    border: 0;
    background: #ff934d;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.result-emoji {
    font-size: 90px;
}

.result-score {
    margin: 18px auto;
    padding: 16px;
    border-radius: 18px;
    background: #fff;
    font-size: 30px;
    font-weight: 900;
    color: #189c42;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hidden {
    display: none !important;
}

html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] .close-btn {
    right: auto;
    left: 18px;
}

@media (max-width: 800px) {
    .game-page {
        padding: 10px;
    }
 body {
        background-attachment: scroll;
           background:url("images/color-bg-mob.webp") center / cover no-repeat fixed;
    }
    .top-panel {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }

    .left-tools,
    .right-tools {
        justify-content: center;
    }

    .tool-btn {
        min-width: 70px;
        min-height: 62px;
        font-size: 22px;
    }

    h1 {
        font-size: 38px;
    }

    .title-box p {
        font-size: 15px;
    }

    .game-wrap {
        width: 100%;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .progress-card {
        grid-column: 1 / -1;
        order: -1;
    }

    .levels-row {
        grid-template-columns: 1fr;
    }

    .level-card {
        padding: 14px;
        font-size: 18px;
    }

    .play-panel {
        padding: 18px;
        min-height: 420px;
    }

    .game-screen {
        grid-template-columns: 1fr;
    }
.lily-side {
    width: 135px;
    margin: auto;
}

    .question-bubble {
        min-height: 170px;
        padding: 22px;
    }

    .answer-btn {
        width: 86px;
        height: 86px;
        border-width: 7px;
    }

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

    .main-btn,
    .restart-btn,
    .hint-btn {
        width: 100%;
    }
}

.sad-lily-wrap{
    position:relative;
    display:inline-block;
}

.sad-lily{
    width:150px;
    max-width:70%;
    object-fit:contain;
    filter:grayscale(.25) drop-shadow(0 10px 14px rgba(0,0,0,.18));
    animation:sadWiggle 2s ease-in-out infinite;
}

.sad-cloud{
    position:absolute;
    top:0;
    right:-18px;
    font-size:38px;
    animation:cloudFloat 1.8s ease-in-out infinite;
}

@keyframes sadWiggle{
    0%,100%{transform:rotate(0deg);}
    50%{transform:rotate(-4deg);}
}

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