* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
 
body {
    background-color: rgb(255, 255, 255);
    transition: background-color 0.3s, color 0.3s;
}
 
/* ── Header ── */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: rgb(63, 1, 55);
    color: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 2px 2px 10px rgb(58, 58, 58);
}
header h1 { font-size: 90px; }
header div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header #nombre { width: 400px; }
header #points  { margin: 0 0 0 60px; }
 
/* ── Mode sombre ── */
.mode {
    display: flex;
    justify-content: flex-end;
    padding: 6px 10px;
}
.mode span {
    font-family: 'Times New Roman', Times, serif;
    font-weight: 900;
}
.sombreBody {
    background-color: rgb(15, 15, 15);
    color: white;
}
.sombreBody .answer {
    background-color: rgb(40, 40, 40);
    color: white;
    border: 1px solid rgb(80, 80, 80);
}
.sombreBody #start input {
    background-color: rgb(30, 30, 30);
    color: white;
    border-bottom: 3px solid rgb(180, 0, 160);
}
.sombreBody #choixNbQuestions select {
    background-color: rgb(30, 30, 30);
    color: white;
}
 
/* ── Accueil ── */
#start {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}
#start input {
    height: 40px;
    width: 240px;
    border-radius: 5px;
    border-color: transparent;
    background-color: rgb(255, 255, 255);
    border-bottom: 3px solid rgb(63, 1, 55);
    outline: none;
    transition: border-color 0.4s, background-color 0.3s;
}
#start input:focus {
    border-color: rgb(0, 0, 0);
    background-color: rgb(238, 236, 236);
}
#start input::placeholder {
    color: rgb(58, 58, 58);
    font-family: monospace;
}
#start button {
    height: 36px;
    padding: 7px 20px;
    background-color: rgb(63, 1, 55);
    color: white;
    border-color: transparent;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    transition: background-color 0.2s;
}
#start button:hover {
    background-color: rgb(100, 0, 88);
}
 
/* Choix nombre de questions */
#choixNbQuestions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
#choixNbQuestions label {
    font-weight: bold;
    font-size: 14px;
}
#choixNbQuestions select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 2px solid rgb(63, 1, 55);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}
#choixNbQuestions select:focus {
    border-color: rgb(150, 0, 130);
}
 
/* ── Progress bar ── */
#div-load {
    margin: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
#loader {
    width: 400px;
    height: 12px;
    appearance: none;
}
#loader::-webkit-progress-bar {
    background-color: rgb(220, 220, 220);
    border-radius: 20px;
}
#loader::-webkit-progress-value {
    background: rgb(63, 1, 55);
    border-radius: 8px;
    transition: all 0.5s;
}
#loader::-moz-progress-bar {
    background: rgb(63, 1, 55);
    border-radius: 8px;
}
 
/* ── Timer ── */
#timer-container {
    width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
#timer-text {
    font-weight: bold;
    font-size: 15px;
}
#timer-bar-bg {
    width: 100%;
    height: 8px;
    background-color: rgb(220, 220, 220);
    border-radius: 10px;
    overflow: hidden;
}
#timer-bar {
    height: 100%;
    width: 100%;
    background-color: #4caf50;
    border-radius: 10px;
    transition: width 1s linear, background-color 0.5s;
}
 
/* ── Animation question ── */
#question-wrapper {
    opacity: 0;
    transform: translateX(40px);
    transition: none;
}
#question-wrapper.slide-in {
    animation: slideIn 0.35s ease forwards;
}
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
 
/* ── Quizz & Résultat ── */
#quizz, #result {
    max-width: 400px;
    margin: 30px auto;
    text-align: center;
}
#result { display: none; }
 
/* ── Réponses ── */
.answer {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    cursor: pointer;
    border: 1px solid rgb(200, 200, 200);
    border-radius: 10px;
    background-color: rgb(245, 245, 245);
    transition: background-color 0.2s, transform 0.1s;
}
.answer:not(:disabled):hover {
    background-color: rgb(230, 215, 230);
    transform: scale(1.02);
}
.correct {
    background-color: green !important;
    color: white;
}
.wrong {
    background-color: red !important;
    color: white;
}
 
/* ── Boutons nav ── */
#next {
    margin-top: 12px;
    padding: 8px 20px;
    border-color: transparent;
    border-radius: 5px;
    cursor: pointer;
    background-color: green;
    color: white;
    box-shadow: 2px 2px 10px rgb(170, 170, 170);
    transition: opacity 0.2s;
}
#next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
#restart {
    padding: 10px 20px;
    border-color: transparent;
    border-radius: 5px;
    cursor: pointer;
    margin: 15px;
    box-shadow: 2px 2px 10px rgb(170, 170, 170);
    background-color: rgb(63, 1, 55);
    color: white;
    transition: background-color 0.2s;
}
#restart:hover {
    background-color: rgb(100, 0, 88);
}
 
/* ── Score & Stats ── */
#score {
    margin: 20px;
    font-size: 26px;
    line-height: 1.6;
}
#stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 10px 0 20px;
    font-size: 15px;
}
 
/* ── Responsive ── */
@media screen and (max-width: 850px) {
    header h1 { font-size: 45px; }
    #start     { max-width: 450px; }
    #quizz     { max-width: 350px; }
    #loader, #timer-container { max-width: 300px; width: 300px; }
    #stats     { flex-direction: column; align-items: center; gap: 8px; }
}