* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #a1a1a1;          /* clair */
    color: #333;                  /* texte foncé */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
}

.app {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    max-width: 1100px;
    width: 100%;
    box-shadow: 0 0 60px rgba(0,0,0,0.25);
}

.layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

/* Colonne mascotte */
.mascot-container {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.mascot-battery {
    transform: scale(1.0);
    margin-top: 10px;
}
.mascot-container img {
    height: 220px;         /* tu peux ajuster cette valeur */
    width: auto;
    object-fit: contain;
}
/* Colonne formulaire */
.main-content {
    flex: 1;
}

h1 {
    margin-top: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #2D2E87; /* bleu */
}
h1 span {
    color: #CA1023; /* rouge */
}
.subtitle {
    text-align: center;
    margin-bottom: 20px;
    color: #555;
}

/* Messages PHP */
.msg {
    margin-bottom: 15px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
}
.msg-ok {
    background: #123d1c;
    border: 1px solid #2ecc71;
    color: #c9f7d1;
}
.msg-error {
    background: #3d1212;
    border: 1px solid #e74c3c;
    color: #f7c9c9;
}

/* Formulaire de départ */
.start-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    margin: 30px auto;
    max-width: 700px;
}

.field {
    flex: 1;
    min-width: 200px;
}
label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #333;
}
input[type="text"],
select,
input[type="number"],
input[type="password"],
textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-primary {
    background: #2D2E87; /* bleu */
    color: #fff;
}
.btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
.btn-secondary {
    background: #eeeeee;
    color: #2D2E87;
    border: 1px solid #d0d0d0;
}
.btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

/* Batterie & timer */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.battery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.battery-tip {
    position: absolute;
    right: -10px;
    top: 25%;
    width: 6px;
    height: 50%;
    background: #2D2E87;
    border-radius: 2px;
}
.timer-text {
    font-size: 1.1rem;
    font-weight: 600;
}
.battery {
    width: 120px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #2D2E87; /* bleu */
    position: relative;
    padding: 3px;
    box-sizing: border-box;
    background: #fdfdfd;
    transform: scale(1.1);
    margin-bottom: 5px;
}
.battery-body {
    width: 100%;
    height: 100%;
    background: #e9ecf5;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.battery-level {
    height: 100%;
    width: 100%;
    background: #9AC31C; /* vert par défaut */
    transform-origin: left center;
    transform: scaleX(1);
    transition: transform 0.3s linear, background-color 0.2s linear;
}
.timer-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2D2E87;
}

.line-info {
    font-size: 0.9rem;
    color: #2D2E87;
}
#lineInfoValue {
    color: #9AC31C; /* rouge de ta palette */
}

/* Questions */
.quiz-layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    margin-top: 20px;
}

.questions-container {
    flex: 1;
}

.question {
    display: none;
    padding: 30px 40px;
    margin: 25px auto;
    max-width: 700px;            /* centrage propre */
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #eee;
}

.question.active {
    display: block;
}
.question-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #2D2E87;
}
.question-desc {
    margin-bottom: 20px;
    color: #444;
    line-height: 1.5;
}

.answers {
    margin-bottom: 15px;
}
.answers label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    cursor: pointer;
}
.answers input[type="radio"] {
    margin-top: 3px;
}

.btn-validate {
    display: inline-block;
    margin-top: 15px;
    float: right;             /* alignement à droite */
}
.feedback {
    font-size: 0.9rem;
    margin-top: 8px;
}
.feedback.bad {
    color: #CA1023;
}
.feedback.good {
    color: #9AC31C;
}

/* Question 2 : drag & drop */
.drag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.tiles-pool, .slots {
    flex: 1;
    min-width: 250px;
}
.tiles-pool-title,
.slots-title {
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #ccc;
}
.tile {
    padding: 8px 10px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 8px;
    cursor: grab;
    text-align: center;
    user-select: none;
}

.slot {
    border: 1px dashed #bbb;
    border-radius: 6px;
    padding: 10px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background: #fafafa;
}

.tile.wrong {
    background: #ffe6e8 !important;
    border: 2px solid #CA1023 !important;
    color: #CA1023;
}

.slot.filled {
    border-style: solid;
}
.slot-index {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 3px;
}

/* Question 4 */
.info-oral {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 8px;
}
textarea {
    width: 100%;
    min-height: 60px;
    border-radius: 6px;
    border: 1px solid #555;
    background: #222;
    color: #f5f5f5;
    padding: 8px 10px;
    resize: vertical;
}

/* Fin */
.final-note {
    font-size: 0.9rem;
    color: #ccc;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .battery-container {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
        align-items: center;
    }

    .mascot-container {
        order: -1;  /* mascotte au-dessus sur mobile */
    }
}

.msg {
    transition: opacity 0.5s ease;
}
.msg.hidden {
    opacity: 0;
}
.msg-ok {
    background: #e9f5d0;
    border: 1px solid #9AC31C;
    color: #355400;
}
.msg-error {
    background: #ffe6e8;
    border: 1px solid #CA1023;
    color: #7a0614;
}
/* Torche */
.torch-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 140px;
    pointer-events: none;
    z-index: 20;
}

.torch-img {
    width: 100%;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.4));
}

/* Faisceau de lumière */
.torch-beam {
    position: fixed;
    right: 110px;    /* ajuste si besoin pour aligner avec la tête de la lampe */
    bottom: 70px;
    width: 70vw;
    height: 70vh;
    pointer-events: none;
    z-index: 10;

    /* Faisceau plus doux, elliptique */
    background: radial-gradient(
        ellipse at 100% 100%,                 /* origine en bas à droite */
        rgba(255, 255, 210, 0.65) 0%,         /* centre lumineux */
        rgba(255, 255, 210, 0.35) 25%,
        rgba(255, 255, 210, 0.15) 55%,
        rgba(255, 255, 210, 0.04) 75%,
        transparent 100%                      /* complètement fondu avant le bord */
    );

    mix-blend-mode: screen;   /* se mélange avec le fond */
    opacity: 0.9;
    filter: blur(12px);       /* adoucit encore les bords pour éviter la coupure franche */
}
