:root {
    --fond: #f5f3ee;
    --fond-carte: #ffffff;
    --texte: #2a2620;
    --texte-attenue: #6b6558;
    --accent: #8c3b2e;
    --bordure: #d8d2c4;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font-family: Georgia, "Times New Roman", serif;
    padding: 1.5rem;
}

main {
    max-width: 700px;
    margin: 0 auto;
}

h1 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.ligne-saisie {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#champ-isbn {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border: 1px solid var(--bordure);
    border-radius: 0.4rem;
    background: var(--fond-carte);
    color: var(--texte);
}

button {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    border: 1px solid var(--accent);
    border-radius: 0.4rem;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

#bouton-scanner {
    background: var(--fond-carte);
    color: var(--accent);
}

#zone-scanner {
    margin-top: 1rem;
    text-align: center;
}

#video-scanner {
    width: 100%;
    max-width: 400px;
    border-radius: 0.4rem;
    border: 1px solid var(--bordure);
}

#video-scanner.detecte {
    border: 4px solid #2e9d4f;
    animation: flash-detection 0.6s ease-out;
}

@keyframes flash-detection {
    from { box-shadow: 0 0 0 0 rgba(46, 157, 79, 0.8); }
    to { box-shadow: 0 0 0 20px rgba(46, 157, 79, 0); }
}

#bandeau-detection {
    margin: 0.5rem 0 0;
    padding: 0.4rem 0.8rem;
    background: #e3f4e8;
    color: #1d6b36;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    display: inline-block;
}

#bandeau-detection[hidden] {
    display: none;
}

#zone-resultat {
    margin-top: 1.5rem;
}

.carte-livre {
    display: flex;
    gap: 1rem;
    background: var(--fond-carte);
    border: 1px solid var(--bordure);
    border-radius: 0.5rem;
    padding: 1rem;
}

.carte-livre img {
    width: 110px;
    height: 160px;
    object-fit: cover;
    border-radius: 0.3rem;
    background: var(--fond);
    flex-shrink: 0;
}

.carte-livre h2 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
}

.carte-livre p {
    margin: 0.15rem 0;
    color: var(--texte-attenue);
    font-size: 0.9rem;
}

.carte-livre .source {
    margin-top: 0.6rem;
    font-size: 0.75rem;
    font-style: italic;
}

.message-info {
    text-align: center;
    color: var(--texte-attenue);
    padding: 1rem;
}

@media (max-width: 480px) {
    .carte-livre { flex-direction: column; align-items: center; text-align: center; }
}
