
/* ==================================================
   1. ОСНОВНОЙ КОНТЕЙНЕР
   ================================================== */

#igra.mt-fractions-game {
    --game-blue: #1599dc;
    --game-blue-dark: #087db9;
    --game-green: #26a269;
    --game-red: #d94b4b;
    --game-border: #c8d7e2;

    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-width: 320px;
    margin: 0 auto;
    padding: clamp(12px, 2.5vw, 28px);
    border-radius: 18px;
   
    background-image: url(https://kid-mama.ru/wp-content/uploads/2026/11/фон-1.png);
    background-repeat: repeat; 
    color: #17364a;
    font-family: Arial, Helvetica, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

#igra *,
#igra *::before,
#igra *::after {
    box-sizing: border-box;
}

#igra button {
    font: inherit;
}

#igra [hidden] {
    display: none !important;
}


/* ==================================================
   2. ЗАГОЛОВОК И ИНСТРУКЦИЯ
   ================================================== */

#igra .game-header {
    margin-bottom: 16px;
    text-align: center;
}

#igra .game-title {
    margin: 0 0 10px;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    line-height: 1.2;
}

#igra .game-instruction {
    font-size: clamp(16px, 2.5vw, 22px);
    line-height: 1.4;
}


/* ==================================================
   3. ПАНЕЛЬ УПРАВЛЕНИЯ
   ================================================== */

#igra .game-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 18px;
}

#igra .game-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

#igra .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

#igra .icon-button img {
    display: block;
    width: 42px;
    height: 42px;
    object-fit: contain;
}

#igra #zvzv {
    background-color: #fff;
    background-image: url("https://kid-mama.ru/wp-content/uploads/2026/01/зв-Photoroom-с.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 30px;
}

#igra #zvzv.sound-off {
    opacity: .5;
}

#igra .level-indicator {
    padding: 8px 14px;
    border: 1px solid #c8dce9;
    border-radius: 999px;
    background: #fff;
    font-weight: 700;
}


/* ==================================================
   4. РАСКЛАДКА ИГРЫ
   Карточки сверху, блоки с картинками ниже
   ================================================== */

#igra .game-board {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-width: 0;
}

#igra .cards-panel,
#igra .targets-panel {
    width: 100%;
    min-width: 0;
    padding: clamp(8px, 1.5vw, 18px);
    
}

#igra .panel-title {
    margin: 0 0 10px;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
}


/* ==================================================
   5. КАРТОЧКИ С ОТВЕТАМИ
   ================================================== */

#igra .cards-bank {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 8px;
    min-height: 0;
}

#igra .cards-bank-secondary {
    margin-top: 8px;
}

#igra .drag-card {
    display: flex;
    align-items: center;
    justify-content: center;
    /*flex: 0 0 150px;*/
    width: 66px;
    position: relative;
    min-height: 66px;
    padding: 7px 9px;
    border: 2px solid #a8d9f1;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 3px 0 #c4e2f1;
    color: #17364a;
    font-size: clamp(35px, 2.5vw, 33px);
    font-weight: 700;
    text-align: center;
    cursor: grab;
    touch-action: none;
    z-index: 5;
}

#igra .drag-card:active {
    cursor: grabbing;
}

#igra .drag-card.ui-draggable-dragging {
    box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
}


/* ==================================================
   6. БЛОКИ С КАРТИНКАМИ
   FLEX автоматически переносит блоки на новую строку
   ================================================== */

#igra .fraction-slots {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

#igra .fraction-slot {
    position: relative;
    
   /* border: 2px dashed #b8d3e3;
    border-radius: 10px;
    background: rgba(255, 255, 255, .9);
    transition: border-color .15s, background .15s;*/
}

#igra .fraction-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100px;
    object-fit: contain;
    pointer-events: none;
}



#igra .fraction-slot .drag-card {
    flex: 0 1 auto;
    width: 100%;
    max-width: 150px;
    min-width: 0;
    min-height: 40px;
    padding: 7px 9px;
    overflow-wrap: anywhere;
    font-size: clamp(35px, 2.1vw, 33px);
}

#igra .fraction-slot.is-hover {
    border-color: var(--game-blue);
    background: #e9f7ff;
}

#igra .fraction-slot.is-correct {
    border-color: var(--game-green);
    background: #e9f8ef;
}

#igra .fraction-slot.is-incorrect {
    border-color: var(--game-red);
    background: #fff0f0;
}


/* ==================================================
   7. ФУТЕР, СЧЁТ И КНОПКИ
   ================================================== */

#igra .game-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 12px;
    margin-bottom: 70px;
}

#igra .game-status {
    min-height: 24px;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

#igra .game-status.error {
    color: var(--game-red);
}

#igra .game-status.success {
    color: var(--game-green);
}

#igra .score-panel {
    display: flex;
    align-items: baseline;
    gap: 5px;
    padding: 10px 14px;
    border: 1px solid #d0e0e9;
    border-radius: 10px;
    background: #fff;
    white-space: nowrap;
}

#igra .score-label {
    font-weight: 700;
}

#igra #pr {
    color: var(--game-blue-dark);
    font-size: 24px;
}

#igra .game-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}

#igra .game-button {
    padding: 12px 18px;
    border: 0;
    border-radius: 9px;
    background: #f5f5f5;
    color: #17364a;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}

#igra .game-button.primary {
    background: var(--game-blue);
    box-shadow: 0 3px 0 var(--game-blue-dark);
    color: #fff;
    line-height: 1;
}

#igra .game-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

#igra.game-playing #schet {
    display: none !important;
}


/* ==================================================
   8. СТАРТОВЫЙ ЭКРАН
   ================================================== */

#igra .mt-start-content {
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: min(100%, 620px);
    margin: 30px auto;
    padding: clamp(24px, 5vw, 48px);
    border: 1px solid #c8dce9;
    border-radius: 20px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 35px rgba(23, 54, 74, .12);
    text-align: center;
}

#igra .mt-start-content h2 {
    margin: 0;
    color: #17364a;
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.2;
}

#igra .mt-start-content p {
    margin: 0;
    color: #456477;
    font-size: clamp(16px, 2.5vw, 20px);
    line-height: 1.5;
}

#igra #mt-start-btn {
    min-width: 180px;
    padding: 12px 18px;
    border: 0;
    border-radius: 9px;
    background: var(--game-blue);
    color: #fff;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

#igra #mt-start-btn:hover:not(:disabled) {
    filter: brightness(.95);
}

#igra #mt-start-btn:disabled {
    opacity: .5;
    cursor: wait;
    box-shadow: none;
}

#igra .mt-start-content[hidden] {
    display: none !important;
}


/* ==================================================
   9. ФИНАЛЬНЫЙ ЭКРАН
   ================================================== */

#igra .mt-finish-content {
    max-width: 560px;
    margin: 20px auto;
    padding: 36px 20px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
    text-align: center;
}

#igra .mt-finish-result {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 24px 0;
}

#igra #mt-finish-score {
    color: #2457a7;
    font-size: 36px;
}

#igra .mt-finish-content button {
    margin: 6px;
}


/* ==================================================
   10. ПОЛНОЭКРАННЫЙ РЕЖИМ
   ================================================== */

#igra.game-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: auto;
    border-radius: 0;
}

#igra.game-fullscreen .game-board {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
}


#igra:not(.game-fullscreen) #naves {
    position: absolute;
    right: 16px;
    top: 12px;
    bottom: auto;
    z-index: 1000;
}

#igra.game-fullscreen #svern {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000001;
}

#igra.game-fullscreen #naves[hidden],
#igra #svern[hidden],
#igra .icon-button[hidden] {
    display: none !important;
}


/* ==================================================
   11. КОМПАКТНЫЙ РЕЖИМ
   Класс game-compact включает JavaScript
   ================================================== */

#igra.game-compact {
    padding: 10px;
    border-radius: 12px;
}

#igra.game-compact .game-header {
    margin-bottom: 7px;
}

#igra.game-compact .game-title {
    margin-bottom: 4px;
    font-size: clamp(21px, 2.8vw, 29px);
}

#igra.game-compact .game-instruction {
    font-size: clamp(14px, 1.8vw, 17px);
    line-height: 1.25;
}

#igra.game-compact .game-toolbar {
    gap: 8px;
    margin: 7px 0 9px;
}

#igra.game-compact .icon-button {
    width: 34px;
    height: 34px;
}

#igra.game-compact .icon-button img {
    width: 34px;
    height: 34px;
}

#igra.game-compact .level-indicator {
    padding: 6px 10px;
    font-size: 14px;
}

#igra.game-compact .game-board {
    gap: 9px;
}

#igra.game-compact .cards-panel,
#igra.game-compact .targets-panel {
    padding: 8px;
    border-radius: 10px;
}

#igra.game-compact .panel-title {
    margin-bottom: 7px;
    font-size: 15px;
}

#igra.game-compact .cards-bank {
    gap: 6px;
    min-height: 0;
}

#igra.game-compact .cards-bank-secondary {
    margin-top: 5px;
}

#igra.game-compact .drag-card {
    flex-basis: 82px;
    width: 82px;
    min-height: 36px;
    padding: 4px 6px;
    border-width: 1px;
    border-radius: 7px;
    box-shadow: 0 2px 0 #c4e2f1;
    font-size: 21px;
}

#igra.game-compact .fraction-slots {
    gap: 6px;
}

#igra.game-compact .fraction-slot {
    flex-basis: 150px;
    gap: 4px;
    padding: 5px;
    border-radius: 9px;
}

#igra.game-compact .fraction-image {
    width: 100%;
    height: clamp(42px, 7vh, 66px);
}

#igra.game-compact .drop-area {
    min-height: 36px;
}

#igra.game-compact .drop-area:empty::after {
    font-size: 11px;
}

#igra.game-compact .fraction-slot .drag-card {
    min-height: 32px;
    font-size: 18px;
}

#igra.game-compact .game-footer {
    gap: 0;
    margin-top: 9px;
}

#igra.game-compact .game-status {
    min-height: 18px;
    font-size: 13px;
}

#igra.game-compact .score-panel {
    padding: 6px 9px;
    font-size: 13px;
}

#igra.game-compact #pr {
    font-size: 19px;
}

#igra.game-compact .game-button {
    padding: 8px 12px;
    font-size: 14px;
}


/* ==================================================
   12. СВЕРХКОМПАКТНЫЙ РЕЖИМ
   ================================================== */

#igra.game-extra-compact {
    padding: 7px;
}

#igra.game-extra-compact .game-header {
    margin-bottom: 4px;
}

#igra.game-extra-compact .game-title {
    margin-bottom: 3px;
    font-size: 21px;
}

#igra.game-extra-compact .game-instruction {
    font-size: 13px;
    line-height: 1.2;
}

#igra.game-extra-compact .game-toolbar {
    gap: 6px;
    margin: 4px 0 6px;
}

#igra.game-extra-compact .fraction-slots {
    gap: 4px;
}

#igra.game-extra-compact .fraction-slot {
    flex-basis: 105px;
    gap: 2px;
    padding: 3px;
}

#igra.game-extra-compact .fraction-image {
    width: 100%;
    height: clamp(30px, 5.5vh, 48px);
}

#igra.game-extra-compact .drop-area {
    min-height: 28px;
}

#igra.game-extra-compact .drag-card {
    min-height: 31px;
    font-size: 18px;
}

#igra.game-extra-compact .game-footer {
    gap: 0;
    margin-top: 6px;
}


/* ==================================================
   13. АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ И ТЕЛЕФОНОВ
   ================================================== */

/*@media (max-width: 900px) {
    #igra .fraction-slot {
        flex-basis: 135px;
    }
}*/

@media (max-width: 680px) {
    #igra .game-toolbar {
        flex-wrap: wrap;
    }

    /*#igra .fraction-slot {
        flex-basis: 155px;
    }*/

    #igra .game-footer {
        align-items: center;
    }

    #igra .game-status {
        width: 100%;
        text-align: center;
    }

    #igra .score-panel {
        justify-content: center;
    }

    #igra .game-actions {
        width: 100%;
    }

    #igra .game-actions .game-button {
        flex: 1 1 auto;
    }

    #igra.game-fullscreen #svern {
        right: 12px;
        bottom: 12px;
    }

    #igra:not(.game-fullscreen) #naves {
    right: 12px;
    bottom: auto;
    top: 12px;
}
}

@media (max-width: 480px) {
    #igra {
        padding: 10px;
    }

    #igra .cards-panel,
    #igra .targets-panel {
        padding: 8px;
    }

    #igra .fraction-slots {
        gap: 6px;
    }

   /* #igra .fraction-slot {
        flex-basis: 150px;
        padding: 5px;
    }*/

    #igra .fraction-image {
        height: 85px;
    }

   

    #igra .icon-button img {
        width: 36px;
        height: 36px;
    }

    #igra:not(.game-fullscreen) {
        margin-bottom: 60px;
    }
}
#igra .cards-bank {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 8px;
}

#igra .cards-panel {
    min-height:10px;
    
}

#igra #sl2.cards-bank {
    min-height: 20px;
    flex: 0 0 auto;
    align-content: flex-start;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
}
#igra #sl2.cards-bank:empty {
    min-height: 80px;
}
/* Пустой слот для перетаскиваемой карточки */
#igra .fraction-slot {
   
    box-sizing: border-box;
}

/* Область, куда помещается карточка */


/* Рамка пустого места */
#igra .fraction-slot .drop-placeholder {
    width: 150px;
    height: 46px;
    box-sizing: border-box;
    border: 2px dashed #8b9bb0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.35);
}




/* Размер текста в карточках на компьютере */
#igra .drag-card {
    
}

/* Размер текста в карточках на мобильных */
@media (max-width: 680px) {
    #igra .drag-card {
        
    }
}
/* Размеры карточек с ответами


/* Размеры картинок в заданиях */
#igra .fraction-image {
    width: var(--image-width, 170px);
    height: var(--image-height, 100px);
    object-fit: contain;
    box-sizing: border-box;
}

/* Размеры на телефонах */
@media (max-width: 768px) {


    #igra .fraction-image {
        width: var(--image-mobile-width, 150px);
        height: var(--image-mobile-height, 85px);
    }

}
/* Место для ответа */
#igra .drop-area {
    display: flex;
    align-items: center;
    justify-content: center;

    width: var(--card-width, 150px);
    min-width: var(--card-width, 150px);
    max-width: var(--card-width, 150px);

    height: var(--card-height, 46px);
    min-height: var(--card-height, 46px);
    max-height: var(--card-height, 46px);

    flex: 0 0 var(--card-width, 150px);

    box-sizing: border-box;
    border: 2px dashed #8b9bb0;
    border-radius: 8px;
    background: rgba(220, 230, 245, 0.45);
}

/* Карточка внутри места для ответа */
#igra .drop-area .drag-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}

/* После переноса карточки */
#igra .drop-area:has(.drag-card) {
    border: 2px solid transparent;
    background: rgba(220, 230, 245, 0.45);
}

/* Мобильные размеры */
@media (max-width: 768px) {
    #igra .drop-area {
        width: var(--card-mobile-width, 120px);
        min-width: var(--card-mobile-width, 120px);
        max-width: var(--card-mobile-width, 120px);

        height: var(--card-mobile-height, 40px);
        min-height: var(--card-mobile-height, 40px);
        max-height: var(--card-mobile-height, 40px);

        flex: 0 0 var(--card-mobile-width, 120px);
    }
}
/* Контейнер изображения */
/*#igra .fraction-slot {
   
    height: var(--image-height, 100px) !important;
    min-height: var(--image-height, 100px) !important;
    flex: 0 0 var(--image-width, 170px);
    box-sizing: border-box;
}*/

/* Мобильная версия */
/*@media (max-width: 768px) {
    #igra .fraction-slot {
      
        height: var(--image-mobile-height, 85px) !important;
        min-height: var(--image-mobile-height, 85px) !important;
        flex: 0 0 var(--image-mobile-width, 150px);
    }
}*/

/* Контейнер изображения и места для ответа */
/*#igra .fraction-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;


    height: auto !important;
    min-height: 0 !important;

    flex: 0 0 var(--image-width, 170px);
    box-sizing: border-box;
    overflow: visible;
}*/

/* Изображение */
#igra .fraction-slot .fraction-image {
    display: block;
    width: 100% !important;
    height: var(--image-height, 100px) !important;
    max-width: 100% !important;
    object-fit: contain;
    box-sizing: border-box;
}

/* Место для перетаскивания */
#igra .fraction-slot .drop-area {
    display: flex;
    align-items: center;
    justify-content: center;

    width: var(--card-width, 150px);
    min-width: var(--card-width, 150px);
    max-width: var(--card-width, 150px);

    height: var(--card-height, 46px);
    min-height: var(--card-height, 46px);

    flex: 0 0 var(--card-height, 46px);
    box-sizing: border-box;

    border: 2px dashed #8b9bb0;
    border-radius: 8px;
    background: #cae7fc;
}

/* Карточка внутри места для ответа */
#igra .fraction-slot .drop-area .drag-card {
    width: 100%;
    height: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Мобильная версия */
/*@media (max-width: 768px) {
    #igra .fraction-slot {
       

        flex: 0 0 var(--image-mobile-width, 150px);
    }*/

    #igra .fraction-slot .fraction-image {
        height: var(--image-mobile-height, 85px) !important;
    }

    #igra .fraction-slot .drop-area {
       width: 100% !important;
min-width: 140px !important;
max-width: 100% !important;
box-sizing: border-box;

        height: var(--card-mobile-height, 40px);
        min-height: var(--card-mobile-height, 40px);

        flex: 0 0 var(--card-mobile-height, 40px);
    }
}
#igra .fraction-slot .drop-area:has(.drag-card) {
    border: 2px solid transparent;
    background: rgba(220, 230, 245, 0.45);
}
/* Одинаковая ширина карточек в банке и после переноса */




/* Одинаковая ширина изображения, карточки и слота */


#igra .fraction-slot .fraction-image {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}



#igra .drop-area {
    width: var(--card-width, 150px) !important;
    min-width: var(--card-width, 150px) !important;
    max-width: var(--card-width, 150px) !important;
    flex: 0 0 var(--card-width, 150px);
}

/* Мобильная версия */
@media (max-width: 768px) {
   

    #igra .fraction-slot .fraction-image {
        width: 100% !important;
    }

   

    #igra .drop-area {
        width: var(--card-width, 150px);
min-width: var(--card-width, 150px);
max-width: var(--card-width, 150px);
    }
}
/* Убираем лишнее пространство под содержимым блока */
/*#igra .fraction-slot {
    padding: 0 12px !important;
    margin-bottom: 0 !important;
    align-self: flex-start;
    height: auto !important;
    min-height: 0 !important;
    line-height: 0;
    padding-left: 6px;
padding-right: 6px;
    
}*/

/* Убираем лишние отступы у изображения */
#igra .fraction-slot .fraction-image {
    margin: 0 !important;
    vertical-align: top;
}
#igra .fraction-slot .drop-area {
    outline: none !important;
    margin-bottom: 0 !important;
    vertical-align: top;
    transform: translateY(2px);
}




/* Область для значка */
#igra .fraction-slot .drop-area {
    position: relative;
    z-index: 5;
}

/* Убираем рамку и фон после проверки */
#igra .fraction-slot.is-correct .drop-area,
#igra .fraction-slot.is-incorrect .drop-area {
    border: none !important;
    background: transparent !important;
}

#igra .fraction-slot.is-correct .drop-area::after,
#igra .fraction-slot.is-incorrect .drop-area::after {
    content: "";
    position: absolute;
    z-index: 20;
    top: 50%;
    right: 0;
    left: auto;
    transform: translateY(-50%);
    display: block;
    width: 33px;
height: 33px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
}

/* Галочка */
#igra .fraction-slot.is-correct .drop-area::after {
    background-image: url("https://kid-mama.ru/wp-content/uploads/2026/01/%D0%B3%D0%B0%D0%BB%D0%BE%D1%87%D0%BA%D0%B0.png");
}

/* Крестик */
#igra .fraction-slot.is-incorrect .drop-area::after {
    background-image: url("https://kid-mama.ru/wp-content/uploads/2026/01/krestik.png");
}
/*#igra .fraction-slot {
   padding: 22px !important;
    margin-bottom: 0 !important;
    align-self: flex-start;
    height: auto !important;
    min-height: 0 !important;
    line-height: 0;
    padding-left: 6px;
padding-right: 6px;
   
}*/
#igra.cards-checked .cards-panel {
    display: none !important;
}
#igra .drag-card {
    white-space: wrap !important;
    letter-spacing: normal !important;
    overflow: hidden;
    text-overflow: clip;
}
#igra .game-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

#igra #zvzv {
    display: none !important;
}

#igra #naves,
#igra #svern {
    position: static !important;
    margin: 0;
}
#igra #naves,
#igra #svern {
    box-shadow: none !important;
    text-shadow: none !important;
    padding: 8px 14px;
    border: 1px solid #c8dce9;
    border-radius: 999px;
    background: #fff;
    font-weight: 700;
    box-shadow: none !important;
    text-shadow: none !important;
}
#igra #naves img,
#igra #svern img {
    width: 24px !important;
    height: 24px !important;
    max-width: none !important;
    object-fit: contain;
}
#igra .game-title,
#igra .game-instruction {
    display: none !important;
}
/* Текст вместо картинки */
#igra .fraction-slot .task-prompt {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: var(--image-height, 100px);
    min-height: var(--image-height, 100px);
    padding: 3px;

    box-sizing: border-box;
    line-height: 1.25;
    text-align: center;
    font-size: clamp(17px, 3vw, 22px);
    font-weight: 700;
    color: #17364a;

    overflow-wrap: anywhere;
    word-break: normal;
}

/* На телефонах */
@media (max-width: 768px) {
    #igra .fraction-slot .task-prompt {
        height: var(--image-mobile-height, 85px);
        min-height: var(--image-mobile-height, 85px);
        font-size: 17px;
        padding: 2px;
    }
}

/* В компактном режиме */
#igra.game-compact .fraction-slot .task-prompt {
    height: clamp(42px, 7vh, 66px);
    min-height: clamp(42px, 7vh, 66px);
    font-size: 14px;
}

#igra.game-extra-compact .fraction-slot .task-prompt {
    height: clamp(30px, 5.5vh, 48px);
    min-height: clamp(30px, 5.5vh, 48px);
    font-size: 12px;
}
/* Увеличенное расстояние между текстовыми заданиями */
#igra .fraction-slots.words-mode {
    gap: 24px !important;
}


/* Горизонтальное расположение всех ячеек */

#igra .fraction-slots,
#igra .fraction-slots.words-mode,
#igra .word-slots {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

/* Ячейки для букв */
#igra .drop-area.letter-slot.ui-droppable,
#igra .word-slots .drop-area,
#igra .word-slots .letter-slot {
    display: flex !important;
    flex-direction: row !important;
    flex: 0 0 66px !important;
    width: 66px !important;
    min-width: 66px !important;
    max-width: 66px !important;
    height: 66px !important;
    min-height: 66px !important;
    max-height: 66px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Буква внутри ячейки */
#igra .word-slots .drag-card,
#igra .drop-area.letter-slot.ui-droppable .drag-card {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Телефоны */
@media (max-width: 600px) {
    #igra .fraction-slots,
    #igra .fraction-slots.words-mode,
    #igra .word-slots {
       /* justify-content: flex-start !important;
        gap: 4px !important;*/
    }

    #igra .drop-area.letter-slot.ui-droppable,
    #igra .word-slots .drop-area,
    #igra .word-slots .letter-slot {
        flex-basis: 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
       /* height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;*/
    }
}
/* Расширяем контейнер под все ячейки */
#igra .word-slots,
#igra .fraction-slots.words-mode {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
   padding: 10px;
    align-items: center !important;

  
    max-width: none !important;
    /*min-width: max-content !important;*/

    overflow: visible !important;
    gap: 6px !important;
    box-sizing: border-box !important;
}

/* Ячейки сохраняют размер */
#igra .drop-area.letter-slot.ui-droppable {
    flex: 0 0 66px !important;
    width: 66px !important;
    min-width: 66px !important;
    max-width: 66px !important;
    height: 68px !important;
}
.drag-card-before::before {
    content: "";
    position: absolute;
    top: 8px;
    right: 2px;
    width: 45px;
    height: 43px;
    background-image: url(https://kid-mama.ru/wp-content/uploads/2026/01/галочка.png);
    background-size: cover;
    z-index: 1000;
    animation: showAndHide 1s ease-in-out  forwards;
}
.drag-card-after::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 2px;
    width: 45px;
    height: 43px;
    background-image: url(https://kid-mama.ru/wp-content/uploads/2026/01/krestik.png);
    background-size: cover;
    z-index: 1000;
    opacity: 0;
    animation: showAndHide 1s ease-in-out  forwards;
}
@keyframes showAndHide {
    0% {
      opacity: 0;
      transform: scale(0.5);
    }
    /* Появление: к 15% времени галочка плавно проявляется и увеличивается */
    15% {
      opacity: 1;
      transform: scale(1);
    }
    /* Удержание: с 15% до 80% времени галочка просто статично висит на экране */
    80% {
      opacity: 1;
      transform: scale(1);
    }
    /* Исчезновение: к 100% времени она плавно растворяется и уменьшается обратно */
    100% {
      opacity: 0;
      transform: scale(0.5);
    }
  }
#game-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto 20px;
}

#game-image:empty {
    display: none;
}

#game-image img {
    display: block;
    max-width: 220px;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
}
@media (max-width: 767px) {
    #sl .drag-card,
    #sl .letter-card,
    #slots .letter-slot {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        box-sizing: border-box;
        font-size: 30px;
    }

    #sl .drag-card,
    #slots .letter-slot {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #igra .drop-area.letter-slot.ui-droppable {
    flex: 0 0 50px !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
        font-size: 30px;
}
}
@media (max-width: 767px) {
    #igra .ui-draggable-dragging {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        box-sizing: border-box !important;
    }
}
#igra .letter-slot.is-correct {
    outline: none !important;
    border-style: none !important;
}
#igra .word-separator {
    display: inline-block;
    width: 25px;
    min-width: 25px;
}
#game-image .game-hint-text {
    font-size: 35px;
    font-weight: 600;
    text-align: center;
    margin: 0 auto 20px;
}
#skip-task {
    position: absolute;
    bottom: 5px;
    right: 5px;
    z-index: 10001;
}

@media (max-width: 600px) {
    #skip-task {
        bottom: 12px;
        right: 12px;
        /*padding: 12px 18px;*/
        font-size: 16px;
    }
}