*{
    box-sizing:border-box;
}

body{
    margin:0;
    padding:20px;
    /*background:#ffffff;*/
    font-family:Arial,Helvetica,sans-serif;
    color:#333;
}

.exam-wrapper{

    max-width:1100px;

    margin:0 auto;

    background:#fff;

    border:1px solid #dcdcdc;

    border-radius:6px;

    padding:20px;

}

h1{

    margin:0 0 20px;

    font-size:28px;

}

.question-menu{

    margin-bottom:25px;

}

.question-menu a{

    display:inline-block;

    width:40px;

    height:40px;

    line-height:40px;

    text-align:center;

    text-decoration:none;

    color:#333;

    background:#fafafa;

    border:1px solid #ccc;

    border-radius:4px;

    margin-right:5px;

    margin-bottom:5px;

    font-weight:bold;

}

.question-menu a:hover{

    background:#eee;

}

.question-menu .current{

    background:#2d7ef7;

    color:#fff;

    border-color:#2d7ef7;

}

.question-block{

    display:block;

}

.question-text{

    margin-bottom:25px;

}

.question-image{

    width:100%;

    text-align:center;

    margin:0 0 30px;

}

.question-image img{

    max-width:100%;

    width:auto;

    height:auto;

}

.answers{

    width:100%;

    display:block;

}

.answer{

    display:block;

    padding:12px 0;

    margin:0;

    border:0;

    border-bottom:1px solid #ddd;

    background:none;

    cursor:pointer;

    font-size:18px;

    transition:.2s;

}

.answer:hover{

    background:#eef5ff;

}

.answer.selected{

    background:#dfeeff;

}

.bottom-nav{

    display:flex;

    justify-content:space-between;

    margin-top:35px;

}

.nav-button{

    display:inline-block;

    padding:12px 20px;

    background:#2d7ef7;

    color:#fff;

    text-decoration:none;

    border-radius:5px;

}

.nav-button:hover{

    background:#1565d8;

}

.result-modal{

    display:none;

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.45);

    justify-content:center;

    align-items:center;

    z-index:9999;

}

.result-window{

    width:420px;

    max-width:92%;

    background:#fff;

    border-radius:8px;

    padding:30px;

    text-align:center;

    box-shadow:0 15px 40px rgba(0,0,0,.3);

}

.result-title{

    font-size:34px;

    font-weight:bold;

    margin-bottom:15px;

}

.result-text{

    margin-bottom:20px;

    font-size:18px;

}

.result-modal.correct .result-title{

    color:#28a745;

}

.result-modal.wrong .result-title{

    color:#d93025;

}

#ruleContainer{

    margin:20px 0;

    font-size:18px;

}

#ruleContainer a{

    font-weight:bold;

    color:#1565d8;

    text-decoration:none;

}

#ruleContainer a:hover{

    text-decoration:underline;

}

.result-buttons button{

    padding:12px 25px;

    cursor:pointer;

    border:none;

    border-radius:5px;

    background:#2d7ef7;

    color:#fff;

    font-size:16px;

}

.result-buttons button:hover{

    background:#1565d8;

}

@media (max-width:768px){

    body{

        padding:10px;

    }

    .exam-wrapper{

        padding:15px;

    }

    .question-block{

        display:block;

    }

    .question-image{

        width:100%;

        margin-bottom:20px;

    }

    .answers{

        width:100%;

    }

    .question-text{

        font-size:20px;

    }

    .question-menu{

        overflow-x:auto;

        white-space:nowrap;

        padding-bottom:10px;

    }

    .question-menu a{

        width:38px;

        height:38px;

        line-height:38px;

    }

    .bottom-nav{

        flex-direction:column;

        gap:15px;

    }

    .nav-button{

        text-align:center;

    }

}
.result-box{

    display:none;

    margin-top:30px;

    padding:25px;

    text-align:center;

    border-radius:6px;

    color:#fff;

}

.result-ok{

    background:#3fa34d;

}

.result-error{

    background:#d93025;

}

.result-title{

    font-size:42px;

    font-weight:bold;

}

.result-rule{

    margin-top:15px;

    font-size:22px;

}

.result-rule a{

    color:#fff;

    font-weight:bold;

    text-decoration:underline;

}
/* ==========================
   RULE MODAL
========================== */

.rule-modal{

    display:none;

    position:fixed;

    left:0;
    top:0;
    right:0;
    bottom:0;

    background:rgba(0,0,0,.6);

    z-index:9999;

    justify-content:center;
    align-items:center;

    padding:20px;

}

.rule-dialog{

    background:#fff;

    width:760px;
    max-width:95%;

    max-height:85vh;

    overflow:hidden;

    display:flex;

    flex-direction:column;

    border-radius:14px;

    position:relative;

    padding:30px 36px;

    box-sizing:border-box;

    box-shadow:0 20px 50px rgba(0,0,0,.35);

}
.rule-scroll{

    flex:1;

    overflow-y:auto;

    overflow-x:hidden;

    padding-right:8px;
z-index:5;
}

.rule-close{

    position:absolute;

    right:18px;
    top:18px;

    width:38px;
    height:38px;

    border:0;

    border-radius:50%;

    background:#f2f4f7;

    color:#666;

    font-size:28px;

    line-height:38px;

    text-align:center;

    cursor:pointer;

    transition:.15s;

}

.rule-close:hover{

    background:#2458a6;

    color:#fff;

}

.rule-window h2{

    margin:0 0 14px;

    font-size:30px;

    color:#2458a6;

}

.rule-text{

    margin-bottom:14px;

    line-height:1.75;

    font-size:18px;

    white-space:pre-wrap;

}

/* ==========================
   HEADER
========================== */

.ticket-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:#2458a6;
    color:#fff;
    padding:10px 15px;
    margin-bottom:15px;
    font-size:18px;
    font-weight:bold;
}

.ticket-title{
    text-transform:uppercase;
}

.ticket-topic{
    text-transform:uppercase;
    text-align:right;
}
.question-counter{

    margin:0 0 14px;

    font-size:18px;

    font-weight:600;

    color:#555;

}
.menu-button{
    width:auto !important;
    padding:0 14px;
    min-width:80px;
}
/* ==========================
   OUTPUT PAGE
========================== */

.exam-section{
    margin:30px 0;
}

.exam-title{
    font-size:28px;
    font-weight:bold;
    margin-bottom:15px;
}

.exam-description{
    font-size:18px;
    line-height:1.6;
    margin-bottom:25px;
}

/* ==========================
   CHAPTERS
========================== */

.chapter-list{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.chapter-row{
    display:flex;

    width:100%;
    min-width:0;

    align-items:center;
    gap:15px;
    padding:8px 8px;
    margin-bottom:6px;
    background:#fff;
    border:1px solid #ddd;
    border-radius:4px;
    text-decoration:none;
    color:#333;
    transition:.15s;
}

.chapter-row:hover{
    background:#2458a6;
    border-color:#2458a6;
    color:#fff;
}

.chapter-row:hover .chapter-num,
.chapter-row:hover .chapter-title,
.chapter-row:hover .chapter-total{
    color:#fff;
}

.chapter-num{

    width:80px;

    flex-shrink:0;

    font-weight:bold;

    color:#2458a6;

}

.chapter-title{

    flex:1;

    min-width:0;

    color:#333;

    overflow-wrap:anywhere;

    word-break:break-word;

}

.chapter-total{

    margin-left:12px;

    flex-shrink:0;

    color:#666;

    font-size:14px;

    white-space:nowrap;

}

/* ==========================
   MOBILE
========================== */

@media(max-width:768px){

    .exam-title{
        font-size:24px;
    }

    .exam-description{
        font-size:16px;
    }
.question-counter{

    margin:10px 0 14px;

    font-size:16px;

    text-align:center;

}
   

    .ticket-grid{
        grid-template-columns:repeat(5,1fr);
    }

}
/* ==========================
   TICKETS
========================== */

.ticket-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(46px,1fr));
    gap:6px;
}

.ticket-grid a{
    display:flex;
    align-items:center;
    justify-content:center;
    height:42px;
    border:1px solid #d8d8d8;
    border-radius:4px;
    text-decoration:none;
    color:#2458a6;
    background:#f2f2f2;
    transition:.15s;
}

.ticket-grid a:hover{
    background:#2458a6;
    color:#fff;
}
/* ==========================
   APP
========================== */

.app-block{
    margin-top:30px;
    padding:20px;
    background:#fff;
    border:1px solid #ddd;
    border-radius:4px;
}

.app-block h2{
    margin:0 0 12px;
    font-size:26px;
    font-weight:600;
    color:#222;
}

.app-block p{
    margin:0 0 18px;
    line-height:1.6;
    color:#555;
}

.app-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    height:42px;
    padding:0 18px;
    border:1px solid #d8d8d8;
    border-radius:4px;
    background:#419e4c;
    color:#fff;
    text-decoration:none;
    font-weight:600;
    transition:.15s;
}

.app-button:hover{
    background:#2458a6;
    border-color:#2458a6;
    color:#fff;
}

@media(max-width:768px){

    .app-block{
        padding:16px;
    }

    .app-block h2{
        font-size:22px;
    }

    .app-button{
        width:100%;
    }

}
.rule-subpoint{

    margin:10px 0;

    padding:12px 16px;

    background:#f8f9fb;

    border-left:4px solid #2458a6;

    border-radius:6px;

    line-height:1.7;

}

.rule-code{

    display:inline-block;

    min-width:56px;

    font-weight:bold;

    color:#2458a6;

}