/* إصلاح ظهور level_box على الجوال والشاشات الصغيرة */
.level_box {
    display: none !important;
}
.level_box.activeLevelBox {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
/* إجبار إخفاء info_box دائماً إلا إذا كانت activeInfo */
.info_box {
    display: none !important;
}
.info_box.activeInfo {
    display: flex !important;
    flex-direction: column;
}
@media (max-width: 600px) {
    .start_btn,
    .info_box,
    .quiz_box,
    .result_box,
    .leaderboard_box,
    .welcome_box {
        top: 50% !important;
        left: 50% !important;
    footer {
        height: 60px;
        padding: 0 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-top: 1px solid lightgrey;
        position: relative;
    }
        transform: translate(-50%, -50%) !important;
        /* لا تفرض display هنا، اتركه للصنف active فقط */
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .quiz_box header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        padding: 0 0 10px 0 !important;
        height: auto !important;
        gap: 0 !important;
    footer .total_que {
        font-size: 20px;
        display: flex;
        align-items: center;
        font-weight: 600;
        color: #109204;
        letter-spacing: 0.5px;
        margin: 0 auto;
        padding: 0 10px 0 0;
        height: 25px;
        width: auto;
        justify-content: center;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    }
    .quiz_box header .title {
        font-size: 18px !important;
        margin: 0 !important;
        flex: 1 1 60%;
        text-align: right !important;
        padding-right: 10px !important;
    footer .next_btn {
        display: none !important;
        margin: 0 auto;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        bottom: 8px;
    }
    }
    .quiz_box header .timer {
        flex: 1 1 40%;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 5px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .quiz_box header .timer .time_left_txt {
        font-size: 14px !important;
        margin-left: 5px !important;
    }
    .quiz_box header .timer .timer_sec {
        font-size: 16px !important;
    }
}
@media (max-width: 500px) {
    .welcome_box,
    .level_box {
        width: 95vw !important;
        min-width: unset !important;
        max-width: 99vw !important;
        padding: 12px 5vw !important;
        font-size: 15px !important;
    }
    .welcome_box .level-msg,
    .level_box .level-msg {
        font-size: 16px !important;
        margin: 8px 0 10px 0 !important;
    }
    .welcome_box .info-title,
    .level_box .info-title {
        font-size: 20px !important;
        height: 40px !important;
        margin-bottom: 10px !important;
    }
    .welcome_box .buttons button,
    .level_box .buttons button {
        font-size: 15px !important;
        height: 38px !important;
        padding: 0 10px !important;
    }
}
footer .next_btn {
    color: #fff;
    background: #109204;
    font-size: 20px !important;
    font-weight: 500;
    border-radius: 5px;
    border: 1px solid #109204;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 45px !important;
    min-width: 80px !important;
    width: auto !important;
    padding: 0 12px !important;
    margin: 0 3px !important;
    display: none;
}

footer .next_btn.show {
    display: inline-block;
}
.welcome_box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
    width: 500px;
    max-width: 95vw;
    padding: 32px 24px 28px 24px;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}
.welcome_box.activeWelcome {
    display: flex !important;
}
.welcome_box .info-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 18px;
    color: #109204;
    text-align: center;
    width: 100%;
    border-bottom: 1.5px solid #e0e0e0;
    padding-bottom: 10px;
}
.welcome_box .level-msg {
    font-size: 20px;
    margin: 24px auto 24px auto;
    color: #222;
    text-align: center;
    line-height: 2.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 95%;
    word-break: break-word;
}
.welcome_box .level-msg br {
    display: block;
    margin-bottom: 8px;
    content: "";
}
@media (min-width: 601px) {
    .welcome_box .level-msg {
        max-width: 70%;
    }
}
.welcome_box .buttons {
    width: 100%;
    display: flex;
    justify-content: center;
}
.welcome_box .buttons button {
    width: 80%;
    font-size: 22px;
    padding: 14px 0;
    border-radius: 6px;
    border: 1px solid #109204;
    color: #109204;
    background: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.welcome_box .buttons button:hover {
    background: #109204;
    color: #fff;
}
@media (max-width: 600px) {
    .info_box,
    .quiz_box,
    .result_box,
    .leaderboard_box {
        width: 98vw !important;
        min-width: unset;
        max-width: 99vw;
        padding: 10vw 2vw 6vw 2vw !important;
        font-size: 16px !important;
    }
    .info_box .info-title,
    .quiz_box header .title,
    .result_box .complete_text,
    .leaderboard_box .info-title,
    .level_box .info-title {
        font-size: 22px !important;
        padding: 0 2vw !important;
    }
    .quiz_box header,
    .quiz_box header .timer {
        flex-direction: column;
        height: auto;
        padding: 2vw !important;
    }
    section {
        padding: 4vw 2vw 2vw 2vw !important;
    }
    .option_list .option {
        font-size: 15px !important;
        padding: 6px 8px !important;
    }
    .result_box .score_text span,
    .leaderboard_box .leaderboard-list > div {
        font-size: 16px !important;
    }
    .show-leaderboard-btn {
        font-size: 16px;
        height: 40px;
        margin: 10px 0 0 0;
    }
}
@font-face{
    font-family: "saudi";
    src: url("fonts/Saudi-Regular.ttf") format("truetype");
} 
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "saudi", sans-serif;
}

body {
    background: #109204;
}

::selection {
    color: #fff;
    background: #109204;
}


.start_btn,
.info_box,
.quiz_box,
.result_box,
.leaderboard_box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* تم إزالة الظلال */
}

.info_box.activeInfo,
.quiz_box.activeQuiz,
.result_box.activeResult,
.leaderboard_box.activeLeaderboard {
    opacity: 1;
    z-index: 5;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.leaderboard_box {
    width: 450px;
    background: #fff;
    border-radius: 5px;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 30px;
}

.leaderboard_box .info-title {
    height: 60px;
    width: 100%;
    border-bottom: 1px solid lightgrey;
    display: flex;
    align-items: center;
    padding: 0 0 0 0;
    border-radius: 5px 5px 0 0;
    font-size: 30px;
    font-weight: 600;
    justify-content: center;
    margin-bottom: 10px;
}

.leaderboard_box .leaderboard-list {
    width: 100%;
    min-height: 120px;
    max-height: 250px;
    overflow-y: auto;
    margin: 15px 0 20px 0;
    font-size: 22px;
}

.leaderboard_box .leaderboard-list > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e6e6e6;
}

.leaderboard_box .leaderboard-list > div:last-child {
    border-bottom: none;
}

.leaderboard_box .buttons {
    display: flex;
    justify-content: center;
    width: 100%;
}

.leaderboard_box .buttons button {
    margin: 0 10px;
    height: 45px;
    padding: 0 20px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: 5px;
    border: 1px solid #109204;
    color: #109204;
    background: #fff;
    transition: all 0.3s ease;
}

.leaderboard_box .buttons button:hover {
    color: #fff;
    background: #109204;
}

.info_box .buttons button{
    margin: 0 5px;
    height: 20px;
    width: 40px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: 5px;
    border: 1px solid #109204;
    transition: all 0.3s ease;
}

/* أزرار موحدة بلون أبيض ونص أخضر وحدود خضراء */
.start_btn button,
.start_btn .show-leaderboard-btn,
.result_box .show-leaderboard-btn,
.quiz_box footer button,
.result_box .buttons button,
.leaderboard_box .buttons button,
.level_box .buttons button,
.welcome_box .buttons button {
    width: 100%;
    height: 4.5rem;
    font-size: 25px;
    font-weight: 500;
    border-radius: 5px;
    margin-bottom: 10px;
    outline: none;
    border: 1px solid #109204;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    color: #109204;
    background: #fff;
    padding: 10;
}
footer .next_btn:hover{
    background: #0263ca;
}
.start_btn button:hover,
.start_btn .show-leaderboard-btn:hover,
.result_box .show-leaderboard-btn:hover,
.info_box .buttons button:hover,
.quiz_box footer button:hover,
.result_box .buttons button:hover,
.leaderboard_box .buttons button:hover,
.level_box .buttons button:hover,
.welcome_box .buttons button:hover {
    background: #109204;
    color: #fff;
}
.welcome_box .level-msg {
    font-size: 20px;
    margin: 24px auto 24px auto;
    color: #222;
    text-align: center;
    line-height: 2.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 95%;
    word-break: break-word;
}
.welcome_box .level-msg br {
    display: block;
    margin-bottom: 8px;
    content: "";
}
@media (min-width: 601px) {
    .welcome_box .level-msg {
        max-width: 70%;
    }
}
.info_box {
    width: 540px;
    background: #fff;
    border-radius: 5px;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.info_box .info-title {
    height: 60px;
    width: 100%;
    border-bottom: 1px solid lightgrey;
    display: flex;
    align-items: center;
    padding: 0 30px;
    border-radius: 5px 5px 0 0;
    font-size: 30px;
    font-weight: 600;
}

.info_box .info-list {
    padding: 15px 30px;
}

.info_box .info-list .info {
    margin: 5px 0;
    font-size: 25px;
}

.info_box .info-list .info span {
    font-weight: 600;
    color: #109204;
}

.info_box .buttons {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 30px;
    border-top: 1px solid lightgrey;
}

.info_box .buttons button {
    margin: 0 5px;
    height: 40px;
    width: 100px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: 5px;
    border: 1px solid #109204;
    transition: all 0.3s ease;
}

.quiz_box {
    width: 550px;
    background: #fff;
    border-radius: 5px;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.quiz_box header {
    position: relative;
    z-index: 2;
    height: 70px;
    padding: 0 30px;
    background: #fff;
    border-radius: 5px 5px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0px 3px 5px 1px rgba(0, 0, 0, 0.1);
}

.quiz_box header .title {
    font-size: 40px;
    font-weight: 600;
}

.quiz_box header .timer {
    color: #005601;
    background: #cce5ff;
    border: 1px solid #b8daff;
    height: 45px;
    padding: 0 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 145px;
}

.quiz_box header .timer .time_left_txt {
    font-weight: 400;
    font-size: 15px;
    user-select: none;
}

.quiz_box header .timer .timer_sec {
    font-size: 18px;
    font-weight: 500;
    height: 30px;
    width: 45px;
    color: #fff;
    border-radius: 5px;
    line-height: 30px;
    text-align: center;
    background: #343a40;
    border: 1px solid #343a40;
    user-select: none;
}

.quiz_box header .time_line {
    position: absolute;
    bottom: 0px;
    left: 0px;
    height: 3px;
    background: #109204;
}

section {
    padding: 25px 30px 20px 30px;
    background: #fff;
}

section .que_text {
    font-size: 25px;
    font-weight: 600;
    margin-bottom: 20px;
}

section .option_list {
    padding: 20px 0px;
    display: block;
}

section .option_list .option {
    background: aliceblue;
    border: 1px solid #aeffa7;
    border-radius: 5px;
    padding: 8px 15px;
    font-size: 17px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

section .option_list .option:last-child {
    margin-bottom: 0px;
}

section .option_list .option:hover {
    color: #086500;
    background: #cce5ff;
    border: 1px solid #b8daff;
}

section .option_list .option.correct {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

section .option_list .option.incorrect {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

section .option_list .option.disabled {
    pointer-events: none;
}

section .option_list .option .icon {
    height: 26px;
    width: 26px;
    border: 2px solid transparent;
    border-radius: 50%;
    text-align: center;
    font-size: 13px;
    pointer-events: none;
    transition: all 0.3s ease;
    line-height: 24px;
}

.option_list .option .icon.tick {
    color: #23903c;
    border-color: #23903c;
    background: #d4edda;
}

.option_list .option .icon.cross {
    color: #a42834;
    background: #f8d7da;
    border-color: #a42834;
}

footer {
    height: 60px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid lightgrey;
}

footer .total_que span {
    display: flex;
    user-select: none;
}

footer .total_que span p {
    font-weight: 500;
}

footer .total_que span p:first-child {
    padding-left: 0px;
}

footer button {
    height: 40px;
    padding: 0 13px;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    border: none;
    outline: none;
    color: #fff;
    border-radius: 5px;
    background: #109204;
    border: 1px solid #109204;
    line-height: 10px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

footer button:hover {
    background: #0263ca;
}

footer button.show {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.result_box {
    background: #fff;
    border-radius: 5px;
    display: flex;
    padding: 25px 30px;
    width: 450px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.result_box .icon {
    font-size: 100px;
    color: #109204;
    margin-bottom: 10px;
}

.result_box .complete_text {
    font-size: 20px;
    font-weight: 500;
}

.result_box .score_text span {
    display: flex;
    margin: 10px 0;
    font-size: 25px;
    font-weight: 500;
}

.result_box .score_text span p {
    padding: 0 4px;
    font-weight: 600;
}

.result_box .buttons {
    display: flex;
    margin: 20px 0;
}

.result_box .buttons button {
    margin: 0 10px;
    height: 45px;
    padding: 0 20px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: 5px;
    border: 1px solid #109204;
    transition: all 0.3s ease;
}

.buttons button.restart {
    color: #fff;
    background: #109204;
    font-size: 20px;
}

.buttons button.restart:hover {
    background: #0f7506;
    color: #fff;
    border: 1px solid #109204;
}

.buttons button.quit {
    color: #109204;
    background: #fff;
    font-size: 20px;
}

.buttons button.quit:hover {
    color: #fff;
    background: #109204;
}

.total_que{
    font-size: 20px;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #109204;
    letter-spacing: 0.5px;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 0 10px 0 0;
    height: 25px;
    width: 50px;
}

.welcome_box .info-title {
    height: 60px;
    width: 100%;
    border-bottom: 1px solid lightgrey;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 18px;
    color: #109204;
    letter-spacing: 1px;
}
.level_box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
    width: 500px;
    max-width: 95vw;
    padding: 32px 24px 28px 24px;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}
.level_box.activeLevelBox {
    display: flex !important;
}
.level_box .info-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 18px;
    color: #109204;
    text-align: center;
    width: 100%;
    border-bottom: 1.5px solid #e0e0e0;
    padding-bottom: 10px;
}
.level_box .level-msg {
    font-size: 20px;
    margin: 24px auto 24px auto;
    color: #222;
    text-align: center;
    line-height: 2.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 95%;
    word-break: break-word;
}
.level_box .level-msg br {
    display: block;
    margin-bottom: 8px;
    content: "";
}
.level_box .buttons {
    width: 100%;
    display: flex;
    justify-content: center;
}
.level_box .buttons button {
    width: 80%;
    font-size: 22px;
    padding: 14px 0;
    border-radius: 6px;
    border: 1px solid #109204;
    color: #109204;
    background: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.level_box .buttons button:hover {
    background: #109204;
    color: #fff;
}
@media (max-width: 600px) {
    .level_box {
        width: 98vw;
        padding: 18px 4vw 16px 4vw;
    }
    .level_box .info-title {
        font-size: 20px;
    }
    .level_box .level-msg {
        font-size: 15px;
    }
    .level_box .buttons button {
        font-size: 16px;
        padding: 10px 0;
    }
}
