/* Fond quadrillé */
.grid-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 0),
        linear-gradient(180deg, rgba(255, 255, 255, .03) 1px, transparent 0);
    background-size: 40px 40px;
    z-index: -1;
}

/* Base */
body {
    margin: 0;
    background: #0b0b10;
    color: #fff;
    font-family: system-ui, sans-serif;
    padding: 0;
}

/* Header */
header {
    width: 100%;
    padding: 25px 20px;
    text-align: center;
    border-bottom: 2px solid #ff0055;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(6px);
}

header h1 {
    margin: 0;
    font-size: 3rem;
    color: #ff0055;
    letter-spacing: 2px;
}

/* Container */
.main {
    padding: 40px 20px;
    text-align: center;
}

/* Titles */
h2 {
    font-size: 1.8rem;
    margin: 30px 0 15px;
    color: #ff0055;
}

/* Sections */
.section {
    margin: 40px auto;
    max-width: 1200px;
}

/* Scroll horizontal */
.scroll-row {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
}

/* Cards */
.card {
    flex: 0 0 auto;
    width: 200px;
    background: #1a1a22;
    border-radius: 12px;
    border: 2px solid #ff0055;
    text-decoration: none;
    color: #fff;
    transition: transform .25s, background .25s;
    scroll-snap-align: start;
}

.card:hover {
    transform: scale(1.06);
    background: #ff0055;
}

.thumb {
    height: 110px;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
}

.card-title {
    padding: 12px;
    font-size: 1.2rem;
}

/* Résultat AutoChoice */
#result {
    font-size: 2.5rem;
    margin: 20px;
    opacity: 0;
    transform: scale(.5);
    transition: all .5s ease;
}

#result.show {
    opacity: 1;
    transform: scale(1);
}

/* Boutons */
button {
    padding: 12px 22px;
    font-size: 1.2rem;
    cursor: pointer;
    background: #ff0055;
    border: none;
    color: #fff;
    border-radius: 6px;
    margin: 10px;
    transition: background .25s, transform .2s;
}

button:hover {
    background: #ff336f;
    transform: scale(1.05);
}

/* Navigation */
.nav {
    margin-top: 30px;
}

.nav a {
    text-decoration: none;
    color: #fff;
    background: #444;
    padding: 10px 20px;
    border-radius: 6px;
    display: inline-block;
    transition: background .25s, transform .2s;
}

.nav a:hover {
    background: #666;
    transform: scale(1.05);
}

/* QCM */
.qcm-container {
    max-width: 900px;
    margin: auto;
    padding: 20px;
    text-align: left;
}

.qcm-info {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 20px;
}

.question {
    margin: 20px 0;
    padding: 15px;
    background: #14141f;
    border-radius: 8px;
    border: 1px solid #26263a;
}

.question-id {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}

.question-text {
    font-size: 17px;
    margin-bottom: 10px;
}

.options {
    margin-top: 8px;
}

.option {
    margin-bottom: 8px;
}

.qcm-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-next {
    background: #3b82f6;
}

.btn-finish {
    background: #22c55e;
}

.qcm-output {
    margin-top: 20px;
    padding: 10px;
    background: #020617;
    border-radius: 8px;
    border: 1px solid #1e293b;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

.qcm-hint {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

/* Footer */
footer {
    margin-top: 60px;
    padding: 20px;
    text-align: center;
    border-top: 2px solid #ff0055;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(6px);
    font-size: 0.9rem;
    color: #ccc;
}

footer a {
    color: #ff0055;
    text-decoration: none;
    font-weight: bold;
}

/* Responsive téléphone */
@media (max-width: 600px) {

    header h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .card {
        width: 150px;
    }

    .thumb {
        height: 90px;
        font-size: 2rem;
    }

    button {
        width: 100%;
        font-size: 1rem;
    }

    .qcm-buttons {
        flex-direction: column;
    }

    .qcm-buttons button {
        width: 100%;
    }
}

/* Responsive tablette */
@media (max-width: 900px) {
    .card {
        width: 170px;
    }
}
