        /* =========================================
   RESET
========================================= */

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

        html,
        body {
            width: 100%;
            overflow-x: hidden;
        }

        /* =========================================
   BODY
========================================= */

        body {

            min-height: 100vh;

            display: flex;
            flex-direction: column;
            align-items: center;

            padding: 30px;

            font-family: 'Comic Neue', cursive;

            background:
                linear-gradient(180deg,
                    #c7eeff 0%,
                    #fff0ae 100%);
        }

        /* =========================================
   TITLE
========================================= */

        .title {

            font-size: 3rem;

            color: #174b6b;

            margin-bottom: 10px;

            text-align: center;
        }

        .sub {

            color: #5d7284;

            font-size: 1.1rem;

            margin-bottom: 40px;

            text-align: center;
        }

        /* =========================================
   BOOK WRAPPER
========================================= */

        .book-wrapper {

            width: 100%;

            display: flex;
            justify-content: center;

            perspective: 5000px;

            overflow-x: auto;
            overflow-y: hidden;

            padding-bottom: 20px;

            margin-bottom: 70px;

            -webkit-overflow-scrolling: touch;
        }

        /* =========================================
   BOOK
========================================= */

        .book {

            position: relative;

            width: min(1000px, 100vw - 30px);

            aspect-ratio: 1000 / 620;

            min-width: 320px;

            height: 80vh;

            transform-style: preserve-3d;
        }

        /* =========================================
   PAPER
========================================= */

        .paper {

            position: absolute;

            top: 0;
            left: 50%;

            width: 50%;
            height: 100%;

            transform-origin: left;

            transform-style: preserve-3d;

            transition:
                transform 1.2s cubic-bezier(.77, 0, .175, 1);

            cursor: pointer;
        }

        .paper.flipped {

            transform: rotateY(-180deg);
        }

        /* =========================================
   FRONT + BACK
========================================= */

        .front,
        .back {

            position: absolute;

            inset: 0;

            width: 100%;
            height: 100%;

            padding: clamp(14px, 2vw, 38px);

            display: flex;
            flex-direction: column;

            overflow: hidden;

            backface-visibility: hidden;

            background:
                linear-gradient(180deg,
                    #fffef7,
                    #f5ecd3);

            box-shadow:
                0 10px 30px rgba(0, 0, 0, .15);
        }

        .front {

            border-radius: 0 18px 18px 0;
        }

        .back {

            transform: rotateY(180deg);

            border-radius: 18px 0 0 18px;
        }

        /* =========================================
   PAPER LINES
========================================= */

        .front::before,
        .back::before {

            content: "";

            position: absolute;

            inset: 0;

            background:
                repeating-linear-gradient(to bottom,
                    transparent,
                    transparent 30px,
                    rgba(0, 0, 0, 0.03) 31px);

            pointer-events: none;
        }

        /* =========================================
   COVER
========================================= */

        .cover {

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

            text-align: center;

            color: white;

            background:
                linear-gradient(145deg,
                    #744422,
                    #4a2812);
        }

        .cover h1 {

            font-size: 4rem;

            margin-bottom: 20px;
        }

        .cover p {

            color: #ffe2b0;

            font-size: 1.3rem;
        }

        .cover-icon {

            font-size: 7rem;

            margin-bottom: 20px;
        }

        /* =========================================
   END PAGE
========================================= */

        .end-page {

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

            text-align: center;

            background:
                linear-gradient(180deg,
                    #fff5cf,
                    #ffe29d);
        }

        .end-page h1 {

            font-size: 4rem;

            color: #8b5b22;

            margin-bottom: 18px;
        }

        .end-page p {

            max-width: 320px;

            font-size: 1.2rem;

            line-height: 1.8;

            color: #7c643d;
        }

        .star {

            font-size: 7rem;

            margin-bottom: 20px;

            animation: glow 2s infinite alternate;
        }

        @keyframes glow {

            from {
                transform: scale(1);
            }

            to {
                transform: scale(1.08);
            }
        }

        /* =========================================
   CONTENT
========================================= */

        h2 {

            position: relative;
            z-index: 2;

            font-size: 1.8rem;

            margin-bottom: 22px;

            color: #8b5b22;
        }

        .page-text {

            position: relative;
            z-index: 2;

            font-size: 25px;

            line-height: 1.5;

            color: #4d5964;
        }



        .moral {

            position: relative;
            z-index: 2;

            margin-top: auto;

            padding: 15px;

            border-radius: 16px;

            font-weight: 700;

            line-height: 1.6;
            font-size: 20px;
            color: #735100;

            background: #fff0b3;
        }

        .bold-text {
            font-weight: bolder;
            font-size: 25px;
            display: block;
        }

        .page-number {

            position: absolute;

            bottom: 18px;
            right: 25px;

            z-index: 3;

            font-weight: 800;

            color: #987a55;
        }

        /* =========================================
   QUIZ
========================================= */

        .quiz-section {

            width: 100%;
            max-width: 1200px;

            padding: 30px;

            border-radius: 35px;

            background:
                rgba(255, 255, 255, 0.72);

            backdrop-filter: blur(7px);

            box-shadow:
                0 15px 35px rgba(0, 0, 0, .12);
        }

        .quiz-title {

            text-align: center;

            font-size: 2rem;

            margin-bottom: 12px;

            color: #175474;
        }

        .quiz-sub {

            text-align: center;

            margin-bottom: 30px;

            color: #5b7486;
        }

        .quiz-layout {

            display: grid;

            grid-template-columns: 1fr 1fr;

            gap: 24px;

            align-items: stretch;
        }

        .quiz-column {

            padding: 20px;

            border-radius: 24px;

            display: flex;
            flex-direction: column;

            background:
                rgba(255, 255, 255, 0.85);
        }

        .quiz-column h3 {

            text-align: center;

            margin-bottom: 20px;

            color: #8a581e;
        }

        #slots,
        #items {

            display: flex;
            flex-direction: column;

            gap: 12px;

            flex: 1;
        }

        /* =========================================
   SLOT
========================================= */

        .slot {

            position: relative;

            min-height: 72px;

            padding: 10px 14px;

            border-radius: 18px;

            border: 3px dashed #bde7ff;

            background: white;

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

            transition: .2s;
        }

        .slot.drag-over {

            background: #eefaff;

            transform: scale(1.02);
        }

        .slot.correct {

            border-color: #79d77f;

            background: #eef9ef;
        }

        .slot-number {

            width: 38px;
            height: 38px;

            min-width: 38px;

            border-radius: 50%;

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

            font-weight: 800;

            position: relative;
            z-index: 2;

            background: #ffd96c;
        }

        .slot-text {

            font-size: 1rem;

            font-weight: 700;

            line-height: 1.4;

            color: #4d5964;

            transition: .2s;
        }

        .slot.correct .slot-text {

            text-decoration: line-through;

            opacity: .45;
        }

        /* =========================================
   SLOT INNER
========================================= */

        .slot-inner {

            width: 100%;

            display: flex;
            align-items: center;

            gap: 14px;
        }

        /* =========================================
   DRAG ITEM
========================================= */

        .drag-item {

            padding: 12px 16px;

            border-radius: 16px;

            border: 2px solid #dcefff;

            cursor: grab;

            transition: .2s;

            touch-action: none;

            user-select: none;

            word-break: break-word;

            background:
                linear-gradient(135deg,
                    white,
                    #f5fbff);
        }

        .drag-item.correct-item {

            position: absolute;

            top: 50%;
            right: 14px;

            transform: translateY(-50%);

            max-width: 70%;

            margin: 0;

            font-size: .95rem;

            pointer-events: none;

            border-color: #84d889;

            background:
                linear-gradient(135deg,
                    #eaffea,
                    #f4fff4);
        }

        .drag-item.used {

            opacity: .55;

            text-decoration: line-through;

            pointer-events: none;

            border-color: #7fd27f;

            background:
                linear-gradient(135deg,
                    #eaf8ea,
                    #d9f3d9);
        }

        .done-check {

            margin-right: 10px;

            font-weight: 800;

            color: #2f9b2f;
        }

        /* =========================================
   COMPLETE MESSAGE
========================================= */

        .complete-message {

            display: none;

            margin-top: 25px;

            padding: 18px;

            border-radius: 18px;

            border: 3px solid #79d77f;

            text-align: center;

            font-size: 1.2rem;

            font-weight: 800;

            color: #2e6d35;

            background: #f0fff1;
        }

        .complete-message.show {

            display: block;
        }

        /* =========================================
   SHAKE
========================================= */

        @keyframes shake {

            0% {
                transform: translateX(0);
            }

            20% {
                transform: translateX(-6px);
            }

            40% {
                transform: translateX(6px);
            }

            60% {
                transform: translateX(-6px);
            }

            80% {
                transform: translateX(6px);
            }

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

        .shake {

            animation: shake .35s;
        }

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

        @media (max-width: 768px) {

            body {

                padding: 12px;
            }

            .title {

                font-size: 1.6rem;

                line-height: 1.3;
            }

            .sub {

                font-size: .95rem;

                margin-bottom: 20px;

                padding: 0 10px;
            }

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

            .book-wrapper {

                width: 100%;

                overflow-x: auto;

                overflow-y: hidden;

                justify-content: center;

                padding-bottom: 20px;

                -webkit-overflow-scrolling: touch;
            }

            .book {

                width: 95vw;

                height: 50vh;
               



                aspect-ratio: auto;
            }

            .paper {

                width: 50%;

                height: 100%;
            }

            .front,
            .back {

                padding: 16px;
            }

            h2 {

                font-size: 1rem;

                margin-bottom: 10px;
            }

            .page-text {

                font-size: .78rem;

                line-height: 1.6;
            }

            .moral {

                font-size: 11px;

                padding: 10px;

                border-radius: 10px;
            }

            .bold-text {
                font-weight: 900;
                font-size: 13px;
                display: block;
            }

            .cover h1,
            .end-page h1 {

                font-size: 1.7rem;
            }

            .cover p,
            .end-page p {

                font-size: .82rem;
            }

            .cover-icon,
            .star {

                font-size: 3.2rem;

                margin-bottom: 10px;
            }

            .page-number {

                font-size: .72rem;

                bottom: 10px;
                right: 14px;
            }

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

            .quiz-section {

                padding: 16px;

                border-radius: 20px;
            }

            /* يبقى عمودين حتى في الهاتف */

            .quiz-layout {

                grid-template-columns: 1fr 1fr;

                gap: 10px;
            }

            .quiz-column {

                padding: 12px;
            }

            .quiz-column h3 {

                font-size: .9rem;

                margin-bottom: 12px;
            }

            .quiz-title {

                font-size: 1.3rem;
            }

            .quiz-sub {

                font-size: .85rem;
            }

            .slot {

                padding: 8px;

                min-height: 62px;
            }

            .slot-inner {

                align-items: flex-start;
            }

            .slot-number {

                width: 26px;
                height: 26px;

                min-width: 26px;

                font-size: .72rem;
            }

            .slot.correct {

                align-items: flex-start;

                padding-top: 10px;
            }

            .drag-item,
            .drag-item.correct-item {

                font-size: .72rem;

                padding: 8px;

                line-height: 1.3;
            }

            .drag-item.correct-item {

                position: static;

                transform: none;

                width: 100%;

                max-width: 100%;

                margin-top: 4px;

                border-radius: 12px;

                font-size: .78rem;

                line-height: 1.35;

                padding: 10px;

                box-shadow: none;
            }

            .complete-message {

                font-size: .9rem;
            }
        }