* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    min-height: 100vh;
    background: #f4eee3;
    color: #26352f;
    padding: 24px;
}

button {
    font-family: inherit;
}

.game {
    width: 100%;
    max-width: 1180px;
    min-height: 720px;
    margin: auto;

    display: grid;
    grid-template-columns: 245px 1fr;

    background: #fffdf9;
    border-radius: 30px;
    overflow: hidden;

    box-shadow: 0 20px 60px rgba(80, 65, 45, 0.12);
}


/* SIDEBAR */

.sidebar {
    background: #f8f4ec;
    padding: 30px 20px;

    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 5px 8px 28px;
}

.brand-mimi {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #e9dfcf;
    border-radius: 16px;
    overflow: hidden;
}

.brand-mimi img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.brand h2 {
    font-size: 21px;
}

.brand p {
    margin-top: 3px;
    color: #8b918b;
    font-size: 12px;
}

.menu-title {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.2px;
    color: #a09c93;

    margin: 5px 10px 12px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar-class {
    border: none;
    width: 100%;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 13px;

    border-radius: 15px;
    background: transparent;

    color: #6f756f;
    text-align: left;
}

.sidebar-class > span {
    width: 32px;
    text-align: center;
    font-size: 19px;
}

.sidebar-class strong {
    display: block;
    font-size: 14px;
}

.sidebar-class small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #aaa69d;
}

.sidebar-class.active {
    background: #dbe8d9;
    color: #45604e;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 10px 5px;

    color: #9b9d96;
    font-size: 12px;
    line-height: 1.6;
}


/* MAIN */

.main-content {
    padding: 45px 50px;
    min-width: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 35px;
}

.eyebrow {
    color: #76927c;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.3px;
    margin-bottom: 8px;
}

h1 {
    font-size: 36px;
    line-height: 1.15;
    color: #26352f;
}

.subtitle {
    margin-top: 8px;
    color: #8b918b;
    font-size: 16px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h2 {
    font-size: 22px;
}

.section-heading p {
    margin-top: 5px;
    color: #9a9d97;
    font-size: 14px;
}


/* CLASS */

.class-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.class-button {
    border: 1px solid #eee8dc;
    background: #fbfaf6;

    padding: 23px;
    border-radius: 20px;

    text-align: left;
    cursor: pointer;

    transition: 0.18s ease;
}

.class-button:hover {
    transform: translateY(-2px);
    border-color: #d8e3d6;
    box-shadow: 0 8px 22px rgba(70, 75, 60, 0.08);
}

.class-icon {
    display: block;
    font-size: 25px;
    margin-bottom: 14px;
}

.class-button strong {
    display: block;
    font-size: 19px;
}

.class-button small {
    display: block;
    margin-top: 5px;
    color: #999b95;
}

.class-button-active {
    background: #e7f0e5;
    border-color: #d3e1d1;
}


/* EXERCISE */

.back-button {
    border: none;
    background: transparent;

    color: #68736c;
    font-size: 14px;
    font-weight: bold;

    cursor: pointer;
    margin-bottom: 25px;
}

.back-button:hover {
    color: #405248;
}

.score-card {
    min-width: 100px;
    padding: 12px 17px;

    border-radius: 18px;
    background: #f8f0df;

    display: flex;
    align-items: center;
    gap: 7px;
}

.score-card span {
    color: #9b9588;
    font-size: 11px;
}

.score-card strong {
    font-size: 20px;
}

.exercise-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exercise-button {
    width: 100%;

    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center;
    gap: 15px;

    border: 1px solid #eee9df;
    background: #fffdfa;

    padding: 18px 20px;
    border-radius: 19px;

    cursor: pointer;
    text-align: left;

    transition: 0.18s ease;
}

.exercise-button:hover {
    transform: translateX(3px);
    background: #f8faf6;
    border-color: #dce6da;
}

.exercise-number {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;
    background: #edf2ea;
    color: #627966;

    font-size: 13px;
    font-weight: bold;
}

.exercise-button strong {
    display: block;
    color: #34443b;
    font-size: 16px;
}

.exercise-button small {
    display: block;
    margin-top: 5px;
    color: #999d97;
    font-size: 12px;
}

.arrow {
    color: #7a947f;
    font-size: 23px;
}


/* GAME TOP */

.game-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    margin-bottom: 28px;
}

.game-topbar .back-button {
    margin: 0;
}

.game-class {
    font-size: 14px;
    color: #7d857e;
}

.game-score {
    justify-self: end;

    background: #f8f0df;
    padding: 10px 17px;
    border-radius: 15px;

    font-weight: bold;
}


/* LESSON HEADER */

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: end;

    margin-bottom: 18px;
}

.lesson-badge {
    display: inline-block;

    background: #dbe8d9;
    color: #4f6e57;

    padding: 7px 14px;
    border-radius: 20px;

    font-size: 12px;
    font-weight: bold;

    margin-bottom: 9px;
}

.lesson-header h1 {
    font-size: 25px;
}

#progress {
    color: #8b918b;
    font-size: 13px;
}


/* QUESTION */

.question-card {
    background: #f8f3e9;

    border-radius: 24px;
    padding: 24px 25px 28px;

    margin-bottom: 15px;
}

.question-instruction {
    text-align: center;

    color: #7c837c;
    font-size: 15px;

    margin-bottom: 17px;
}

.question-box {
    background: #fffdf9;

    min-height: 150px;
    border-radius: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
    overflow: hidden;
}

#question {
    font-size: 43px;
    font-weight: bold;

    text-align: center;
    color: #29372f;

    line-height: 1.5;
}


/* COUNTING OBJECTS */

.counting-objects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;

    max-width: 800px;
}

.counting-object {
    font-size: 45px;
    line-height: 1;
}


/* PLACE VALUE */

.place-value-box {
    text-align: center;
}

.place-number {
    font-size: 58px;
    letter-spacing: 5px;
    margin-bottom: 12px;
}

.place-question {
    font-size: 20px;
    color: #69766e;
    font-weight: normal;
}


/* ANSWERS */

.answers {
    display: grid;

    grid-template-columns: 1fr 1fr;
    gap: 12px;

    width: 100%;
    margin-bottom: 14px;
}

.answers button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 62px;

    padding: 14px;

    border: none;
    border-radius: 16px;

    background: #edf3ee;
    color: #263f35;

    font-size: 25px;
    font-weight: 700;

    cursor: pointer;

    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.answers button:hover {
    background: #e1ebe2;
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(50, 70, 55, 0.08);
}

.answers button:active {
    transform: scale(0.97);
}

.answers button:disabled {
    cursor: default;
}


/* MIMI */

#mimi-area {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 18px;
    margin-top: 25px;

    min-height: 95px;
}

#mimi {
    flex-shrink: 0;
}

#mimi-image {
    display: block;

    width: 78px;
    height: 78px;

    object-fit: contain;
}

.mimi-message {
    min-width: 190px;
    min-height: 58px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 12px 18px;

    background: #edf3eb;
    border-radius: 18px;

    color: #526258;
}

.mimi-message strong {
    font-size: 13px;
    color: #6d8a78;
    margin-bottom: 3px;
}

.mimi-message p {
    font-size: 14px;
}

/* PESAN SAAT JAWABAN SALAH */

.mimi-message.wrong-message {
    background: #f8d7d7;
    color: #8f3f3f;
}

.mimi-message.wrong-message strong {
    color: #a94b4b;
}

.mimi-message.wrong-message p {
    color: #8f3f3f;
}


/* MIMI ANIMATION */

#mimi.correct {
    animation: mimiJump 0.7s ease;
}

#mimi.wrong {
    animation: mimiShake 0.45s ease;
}

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

    40% {
        transform: translateY(-10px);
    }

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

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

@keyframes mimiShake {
    0%, 100% {
        transform: translateX(0);
    }

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

    75% {
        transform: translateX(5px);
    }
}


/* RESULT */

.result-page {
    text-align: center;
    padding-top: 100px;
}

.result-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.result-page h1 {
    font-size: 40px;
}

#final-score {
    color: #747c75;
    font-size: 19px;
    margin: 15px 0 28px;
}

#play-again {
    border: none;

    background: #dbe8d9;
    color: #45604e;

    padding: 15px 25px;
    border-radius: 16px;

    font-size: 16px;
    font-weight: bold;

    cursor: pointer;
}

#play-again:hover {
    transform: translateY(-2px);
}


/* HIDDEN */

.hidden {
    display: none !important;
}


/* MOBILE */

@media (max-width: 800px) {

    body {
        padding: 10px;
    }

    .game {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        padding: 30px 22px;
    }
}

@media (max-width: 500px) {

    .main-content {
        padding: 25px 17px;
    }

    h1 {
        font-size: 29px;
    }

    .class-list {
        grid-template-columns: 1fr;
    }

    .lesson-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .lesson-header h1 {
        font-size: 21px;
    }

    #question {
        font-size: 32px;
    }

    .counting-object {
        font-size: 34px;
    }

    .place-number {
        font-size: 45px;
    }

    .answers button {
        min-height: 60px;
        font-size: 22px;
    }

    #mimi-image {
        width: 65px;
        height: 65px;
    }

    .mimi-message {
        min-width: 0;
        flex: 1;
    }
}

/* ========================================
   LATIHAN 2 — NILAI TEMPAT
   Balok Puluhan + Kubus Satuan
   ======================================== */

.place-value-question {
    width: 100%;
    text-align: center;
}

.blocks-area {
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 55px;
    padding: 25px 20px;
}

/* AREA BALOK PULUHAN */
.tens-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

/* SATU BALOK = 10 SATUAN */
.tens-block {
    width: 18px;
    height: 125px;
    border: 2px solid #71816f;
    border-radius: 4px;
    background: #dfe8dc;

    display: flex;
    flex-direction: column;
}

/* GARIS-GARIS PADA BALOK */
.tens-block span {
    flex: 1;
    border-bottom: 1px solid #9aaa97;
}

.tens-block span:last-child {
    border-bottom: none;
}


/* AREA KUBUS SATUAN */
.ones-area {
    width: 150px;
    min-height: 90px;

    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: flex-start;
    gap: 9px;
}

/* SATU KUBUS */
.ones-block {
    width: 25px;
    height: 25px;

    background: #dfe8dc;
    border: 2px solid #71816f;
    border-radius: 4px;
}


/* BILANGAN */
.place-number-preview {
    margin-top: 5px;
    font-size: 18px;
    color: #6f7d70;
}

.place-number-preview strong {
    font-size: 24px;
    color: #263b32;
}


/* INSTRUKSI */
.place-instruction {
    margin-top: 12px;
    font-size: 17px;
    color: #758075;
}


/* RESPONSIVE HP */
@media (max-width: 600px) {

    .blocks-area {
        gap: 25px;
        padding: 20px 10px;
    }

    .tens-area {
        gap: 6px;
    }

    .tens-block {
        width: 14px;
        height: 95px;
    }

    .ones-area {
        width: 105px;
        gap: 6px;
    }

    .ones-block {
        width: 20px;
        height: 20px;
    }

}

/* ========================================
   DIGITAL WORKSHEET
   LATIHAN 3 & 4
   ======================================== */

.tens-worksheet {
    width: 100%;
    text-align: center;
    padding: 8px 5px 0;
}

.worksheet-instruction {
    display: inline-block;
    padding: 10px 20px;
    margin-bottom: 22px;

    border-radius: 14px;

    font-size: 16px;
    font-weight: 600;

    background: #edf3eb;
    color: #526258;
}

.tens-worksheet.subtraction
.worksheet-instruction {
    background: #f8e8dc;
    color: #81513c;
}


/* PERSAMAAN */

.tens-equation {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 35px;

    min-height: 185px;

    padding: 15px;
}

.tens-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.digital-blocks {
    display: flex;
    align-items: flex-end;
    justify-content: center;

    gap: 7px;

    min-height: 125px;
}

.digital-tens-block {
    width: 18px;
    height: 125px;

    display: flex;
    flex-direction: column;

    border: 2px solid #71816f;
    border-radius: 4px;

    background: #dfe8dc;
}

.digital-tens-block span {
    flex: 1;

    border-bottom: 1px solid #9aaa97;
}

.digital-tens-block
span:last-child {
    border-bottom: none;
}

.tens-group strong {
    margin-top: 10px;

    font-size: 22px;

    color: #26352f;
}

.big-operator,
.big-equals {
    font-size: 48px;
    font-weight: 700;

    color: #26352f;
}


/* ========================================
   AREA JAWABAN KETIK
   LATIHAN 3 & 4
   ======================================== */

.typed-answer-row {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 12px;

    margin-top: 5px;
}


.typed-equals {
    font-size: 42px;

    font-weight: bold;

    color: #26352f;
}


/* ========================================
   INPUT JAWABAN
   ======================================== */

.typed-answer {
    width: 300px;
    height: 100px;

    border: 3px solid #a9c9b1;

    border-radius: 18px;

    background: #fff;

    color: #26352f;

    font-family: Arial, sans-serif;

    font-size: 52px;

    font-weight: 700;

    text-align: center;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}


.subtraction .typed-answer {
    border-color: #efc09f;
}


.typed-answer::placeholder {
    color: #c4cbc5;

    opacity: 1;
}


.typed-answer:focus {
    border-color: #7fae8d;

    box-shadow:
        0 0 0 4px
        rgba(127, 174, 141, 0.12);

    transform: scale(1.02);
}


.subtraction .typed-answer:focus {
    border-color: #d99b78;

    box-shadow:
        0 0 0 4px
        rgba(217, 155, 120, 0.12);
}


/* ========================================
   HAPUS
   ======================================== */

.clear-answer {
    width: 65px;

    min-height: 70px;

    border: none;

    border-radius: 15px;

    background: #f3f1eb;

    color: #747a74;

    cursor: pointer;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 4px;

    transition: 0.15s ease;
}


.clear-answer:hover {
    transform: translateY(-2px);

    background: #ebe8df;
}


.clear-answer:active {
    transform: scale(0.97);
}


.clear-answer:disabled {
    opacity: 0.6;

    cursor: default;

    transform: none;
}


.clear-answer span {
    font-size: 11px;
}


/* ========================================
   PETUNJUK
   ======================================== */

.typed-answer-hint {
    margin-top: 10px;

    font-size: 13px;

    color: #8b918b;
}


/* ========================================
   CEK JAWABAN
   ======================================== */

.check-writing {
    margin-top: 16px;

    border: none;

    padding: 14px 25px;

    border-radius: 15px;

    font-size: 16px;

    font-weight: bold;

    color: white;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.check-writing.addition {
    background: #4f9b72;
}


.check-writing.subtraction {
    background: #d56f43;
}


.check-writing:hover {
    transform: translateY(-2px);

    box-shadow:
        0 7px 18px
        rgba(70, 70, 60, 0.15);
}


.check-writing:active {
    transform: scale(0.97);
}


.check-writing:disabled {
    opacity: 0.6;

    cursor: default;

    transform: none;
}


.check-writing span {
    margin-left: 8px;
}


/* ========================================
   WORKSHEET
   ======================================== */

.tens-worksheet {
    width: 100%;

    text-align: center;

    padding: 8px 5px 0;
}


.worksheet-instruction {
    display: inline-block;

    padding: 10px 20px;

    margin-bottom: 22px;

    border-radius: 14px;

    font-size: 16px;

    font-weight: 600;

    background: #edf3eb;

    color: #526258;
}


.tens-worksheet.subtraction
.worksheet-instruction {
    background: #f8e8dc;

    color: #81513c;
}


/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 700px) {

    .tens-equation {
        gap: 15px;
    }


    .digital-blocks {
        gap: 4px;
    }


    .digital-tens-block {
        width: 13px;

        height: 90px;
    }


    .big-operator,
    .big-equals {
        font-size: 34px;
    }


    .tens-group strong {
        font-size: 18px;
    }


    .typed-answer-row {
        gap: 7px;
    }


    .typed-answer {
        width: 250px;

        height: 90px;

        font-size: 45px;
    }


    .typed-equals {
        font-size: 32px;
    }


    .clear-answer {
        width: 52px;

        min-height: 60px;
    }

}


@media (max-width: 500px) {

    .tens-equation {
        gap: 8px;

        transform: scale(0.9);

        transform-origin: center;
    }


    .digital-blocks {
        min-height: 85px;
    }


    .digital-tens-block {
        width: 11px;

        height: 85px;
    }


    .typed-answer {
        width: 180px;

        height: 75px;

        font-size: 38px;
    }


    .typed-answer-hint {
        font-size: 11px;
    }


    .typed-equals {
        font-size: 28px;
    }

}
/* ========================================
   LATIHAN 3 & 4
   JAWABAN KETIK
   ======================================== */

.typed-answer-row {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    margin-top: 12px;
}


.typed-equals {
    font-size: 42px;
    font-weight: 700;

    color: #26352f;
}


/* ========================================
   INPUT
   ======================================== */

.typed-answer {
    width: 260px;
    height: 78px;

    border: 3px solid #a9c9b1;
    border-radius: 18px;

    background: #fff;

    color: #26352f;

    font-family: Arial, sans-serif;

    font-size: 42px;
    font-weight: 700;

    text-align: center;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}


.subtraction .typed-answer {
    border-color: #efc09f;
}


.typed-answer::placeholder {
    color: #c4cbc5;
}


.typed-answer:focus {
    border-color: #7fae8d;

    box-shadow:
        0 0 0 4px
        rgba(127, 174, 141, 0.13);

    transform: scale(1.02);
}


/* ========================================
   TOMBOL CEK
   ======================================== */

.typed-answer-row .check-writing {
    margin-top: 0;

    height: 58px;

    padding: 0 22px;

    white-space: nowrap;
}


.check-writing.addition {
    background: #4f9b72;
}


.check-writing.subtraction {
    background: #d56f43;
}


.check-writing:hover {
    transform: translateY(-2px);

    box-shadow:
        0 7px 18px
        rgba(70, 70, 60, 0.15);
}


.check-writing:active {
    transform: scale(0.97);
}


.check-writing:disabled {
    opacity: 0.65;

    cursor: default;

    transform: none;
}


/* ========================================
   PETUNJUK
   ======================================== */

.typed-answer-hint {
    margin-top: 10px;

    font-size: 13px;

    color: #8b918b;
}


/* ========================================
   MOBILE
   ======================================== */

@media (max-width: 600px) {

    .typed-answer-row {
        gap: 8px;
    }


    .typed-equals {
        font-size: 32px;
    }


    .typed-answer {
        width: 190px;

        height: 68px;

        font-size: 36px;
    }


    .typed-answer-row .check-writing {
        height: 52px;

        padding: 0 14px;

        font-size: 13px;
    }

}


@media (max-width: 450px) {

    .typed-answer {
        width: 150px;

        font-size: 32px;
    }


    .typed-answer-row .check-writing {
        padding: 0 10px;

        font-size: 12px;
    }

}

/* ========================================
   SUBSKILL NILAI TEMPAT
   ======================================== */

.subskill-header {
    text-align: center;
    margin: 25px 0 20px;
}

.subskill-header h2 {
    margin: 0 0 6px;
    font-size: 25px;
    color: #263b32;
}

.subskill-header p {
    margin: 0;
    color: #758075;
}


/* ========================================
   RATUSAN
   ======================================== */

.hundreds-layout {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 30px;
    align-items: center;
}


.hundreds-area {
    grid-column: 1 / -1;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;

    gap: 10px;

    width: 100%;
    max-width: 570px;
    margin: 0 auto;
}

.hundreds-layout .tens-area {
    justify-content: flex-end;
}

.hundreds-layout .ones-area {
    justify-self: start;
}


/* 100 satuan = 1 balok ratusan */

.hundreds-block {
    width: 105px;
    height: 105px;

    display: grid;
    grid-template-columns:
        repeat(10, 1fr);

    grid-template-rows:
        repeat(10, 1fr);

    border: 2px solid #71816f;
    border-radius: 5px;

    background: #dfe8dc;

    overflow: hidden;
}


.hundreds-block span {
    border-right:
        1px solid #9aaa97;

    border-bottom:
        1px solid #9aaa97;
}


.hundreds-block span:nth-child(10n) {
    border-right: none;
}


.hundreds-block span:nth-last-child(-n + 10) {
    border-bottom: none;
}


/* ========================================
   RIBUAN
   ======================================== */

.thousands-question {
    width: 100%;
    text-align: center;
}


.thousands-number {
    font-size: 48px;
    font-weight: 800;
    color: #263b32;
    margin: 12px 0 22px;
}


.place-value-cards {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 8px;

    max-width: 700px;

    margin: 0 auto 20px;
}


.place-card {
    min-height: 145px;

    border-radius: 16px;

    padding: 12px 8px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: space-between;
}


.place-card strong {
    font-size: 15px;
}


.place-card span {
    font-size: 42px;
    line-height: 1;
}


.place-card b {
    font-size: 30px;
    color: #263b32;
}


.thousands-card {
    background: #e3efff;
}


.hundreds-card {
    background: #e4f1e3;
}


.tens-card {
    background: #fff1c9;
}


.ones-card {
    background: #f9dddd;
}


@media (max-width: 700px) {

    .hundreds-layout {
        gap: 18px;
    }


    .hundreds-block {
        width: 80px;
        height: 80px;
    }


    .place-value-cards {
        gap: 5px;
    }


    .place-card {
        min-height: 120px;
    }


    .place-card span {
        font-size: 30px;
    }


    .place-card b {
        font-size: 24px;
    }


    .thousands-number {
        font-size: 40px;
    }

}

/* ========================================
   MATH KIDS — RESPONSIVE SYSTEM
   ======================================== */

/* TABLET */
@media (max-width: 800px) {

    body {
        padding: 10px;
    }

    .game {
        width: 100%;
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
        padding: 30px 22px;
    }

    .page-header {
        margin-bottom: 25px;
    }

    .question-box {
        width: 100%;
        padding: 18px;
    }

    .answers {
        gap: 10px;
    }

}


/* ========================================
   MOBILE
   ======================================== */

@media (max-width: 600px) {

    body {
        padding: 8px;
    }

    .game {
        border-radius: 22px;
    }

    .main-content {
        padding: 24px 15px;
    }

    h1 {
        font-size: clamp(26px, 7vw, 32px);
    }

    .subtitle {
        font-size: 14px;
    }


    /* HEADER */

    .lesson-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .lesson-header h1 {
        font-size: clamp(20px, 5.5vw, 25px);
    }


    /* QUESTION */

    .question-card {
        padding: 18px 14px 22px;
        border-radius: 20px;
    }

    .question-box {
        padding: 15px 8px;
        border-radius: 17px;
    }

    #question {
        font-size: clamp(28px, 8vw, 38px);
    }


    /* ANSWERS */

    .answers {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .answers button {
        min-height: 58px;
        font-size: 20px;
        padding: 12px;
    }


    /* MIMI */

    #mimi-area {
        gap: 10px;
        margin-top: 18px;
    }

    #mimi-image {
        width: 62px;
        height: 62px;
    }

    .mimi-message {
        min-width: 0;
        width: 100%;
        padding: 10px 13px;
    }


    /* ========================================
       2B — RATUSAN
       ======================================== */

    .hundreds-layout {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hundreds-area {
        grid-column: 1;
        width: 100%;
        max-width: 100%;
        gap: 7px;
    }

    .hundreds-block {
        width: clamp(62px, 20vw, 80px);
        height: clamp(62px, 20vw, 80px);
    }

    .hundreds-layout .tens-area {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hundreds-layout .ones-area {
        justify-self: center;
    }


    /* ========================================
       2A — PULUHAN & SATUAN
       ======================================== */

    .blocks-area {
        width: 100%;
        gap: 20px;
        padding: 18px 5px;
    }

    .tens-area {
        gap: 5px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .tens-block {
        width: 13px;
        height: 88px;
    }

    .ones-area {
        width: 110px;
        justify-content: center;
    }

    .ones-block {
        width: 19px;
        height: 19px;
    }


    /* ========================================
       3 & 4 — EQUATION
       ======================================== */

    .tens-equation {
        width: 100%;
        gap: 8px;
        padding: 10px 3px;
        min-height: 150px;
    }

    .digital-blocks {
        gap: 3px;
        min-height: 85px;
    }

    .digital-tens-block {
        width: 11px;
        height: 85px;
    }

    .big-operator,
    .big-equals {
        font-size: clamp(28px, 8vw, 36px);
    }

    .tens-group strong {
        font-size: 17px;
    }


    /* INPUT 3 & 4 */

    .typed-answer-row {
        width: 100%;
        gap: 7px;
    }

    .typed-answer {
        width: min(190px, 55vw);
        height: 68px;
        font-size: 36px;
    }

    .typed-equals {
        font-size: 30px;
    }

    .typed-answer-row .check-writing {
        height: 52px;
        padding: 0 12px;
        font-size: 13px;
    }

}


/* ========================================
   SMALL PHONE
   ======================================== */

@media (max-width: 400px) {

    body {
        padding: 5px;
    }

    .main-content {
        padding: 20px 10px;
    }

    .question-card {
        padding-left: 10px;
        padding-right: 10px;
    }

    #question {
        font-size: 28px;
    }

    .answers button {
        min-height: 55px;
        font-size: 18px;
    }

    #mimi-image {
        width: 55px;
        height: 55px;
    }

    .mimi-message p {
        font-size: 13px;
    }

    .hundreds-block {
        width: 62px;
        height: 62px;
    }

    .tens-block {
        width: 11px;
        height: 75px;
    }

    .ones-block {
        width: 17px;
        height: 17px;
    }

}

/* =================================
   MIMI DI ATAS SOAL
   ================================= */

#game-screen:not(.hidden) {
    display: flex;
    flex-direction: column;
}

/* Urutan tampilan */
#game-screen .game-topbar {
    order: 1;
}

#game-screen .lesson-header {
    order: 2;
}

#game-screen #mimi-area {
    order: 3;
}

#game-screen .question-card {
    order: 4;
}

#game-screen .answers {
    order: 5;
}
/* =================================
   BRAND MIMI MATEMATIKA
   ================================= */

.brand {
    align-items: center;
    gap: 12px;
}

.brand-mimi {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-mimi img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    display: block;
}

.brand h2 {
    font-size: 22px;
    line-height: 1.1;
    color: #30483d;
}

.brand p {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    color: #718078;
}

/* =================================
   MIMI MATEMATIKA - BRAND TITLE
   ================================= */

.main-brand-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.main-brand-title img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    display: block;
}

@media (max-width: 500px) {
    .main-brand-title {
        gap: 10px;
    }

    .main-brand-title img {
        width: 52px;
        height: 52px;
    }
}

/* ========================================
   PENJUMLAHAN BERSUSUN
   05A — TANPA MENYIMPAN
   ======================================== */

.stacked-addition-worksheet {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.word-problem-worksheet {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.word-problem-story {
    width: min(560px, 90%);
    font-size: 24px;
    line-height: 1.6;
    text-align: center;
}

.word-problem-story p {
    margin: 0 0 10px;
}

.word-problem-story strong {
    font-weight: 700;
}

.word-problem-answer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 36px;
    font-weight: 700;
}

.word-problem-answer .typed-answer {
    width: 120px;
    height: 58px;
    font-size: 36px;
    text-align: center;
}

.stacked-addition-problem {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 180px;
    font-size: 42px;
    line-height: 1.15;
}

.stacked-number {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
}

.stacked-carry {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
    height: 24px;
}

.stacked-carry span {
    text-align: center;
}

.stacked-carry strong {
    text-align: right;
    font-size: 22px;
    line-height: 1;
    letter-spacing: 3px;
    padding-right: 42px;
}

.stacked-number span {
    text-align: center;
    font-weight: 700;
}

.stacked-number strong {
    text-align: right;
    font-weight: 700;
    letter-spacing: 3px;
}

.stacked-line {
    border-bottom: 4px solid currentColor;
    margin: 8px 0 12px 32px;
}

.stacked-answer {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
}

.stacked-answer span {
    text-align: center;
    font-weight: 700;
}

.stacked-answer .typed-answer {
    width: 110px;
    height: 58px;
    margin-left: auto;
    font-size: 36px;
    text-align: right;
}

/* ========================================
   CONFETTI CELEBRATION
   ======================================== */

.confetti-container {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 9999;
}

.confetti-piece {
    position: absolute;
    display: block;
    top: -30px;
    width: 12px;
    height: 18px;
    border-radius: 3px;
    opacity: 0;
    animation-name: confetti-fall;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
}

@keyframes confetti-fall {

    0% {
        opacity: 0;
        transform:
            translateY(-30px)
            translateX(0)
            rotate(0deg)
            scale(0.5);
    }

    10% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform:
            translateY(600px)
            translateX(var(--drift))
            rotate(var(--rotation))
            scale(1);
    }

}