* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', 'Georgia', serif;
    background: linear-gradient(135deg, #6a6f5c 0%, #926d62 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
}

a {
    text-decoration: none;
}

.df-container {
    background-color: transparent!important;
}

/* En-tête élégant */
h1 {
    text-align: center;
    color: #d0c3a3;
    margin-bottom: 15px;
    font-size: 3em;
    font-weight: 400;
    letter-spacing: 2px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}

.subtitle {
    text-align: center;
    color: #F0F0F0;
    font-size: 1.1em;
    font-style: italic;
    letter-spacing: 1px;
}

/* Contrôles élégants et pratiques */
.controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 20px;
    background: rgba(208, 195, 163, 0.08);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.controls #prevBtn {
    grid-column: 1;
    grid-row: 1;
}

.controls #pageInfo {
    grid-column: 2;
    grid-row: 1;
}

.controls #nextBtn {
    grid-column: 3;
    grid-row: 1;
}

.controls #fullscreenBtn {
    grid-column: 1 / 4;
    grid-row: 2;
    justify-self: center;
}

button {
    padding: 14px 32px;
    font-size: 1em;
    border: 2px solid #d0c3a3;
    border-radius: 30px;
    cursor: pointer;
    background: rgba(208, 195, 163, 0.15);
    color: #d0c3a3;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
    letter-spacing: 0.5px;
    min-width: 140px;
    white-space: nowrap;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0,0,0,0.35);
    background: #d0c3a3;
    color: #6a6f5c;
}

button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#fullscreenBtn {
    background: rgba(146, 109, 98, 0.2);
    border-color: #926d62;
    color: #926d62;
    min-width: 200px;
}

#fullscreenBtn:hover:not(:disabled) {
    background: #926d62;
    color: #F0F0F0;
}

#pageInfo {
    color: #d0c3a3;
    font-size: 1.15em;
    font-weight: 600;
    padding: 14px 25px;
    background: rgba(208, 195, 163, 0.2);
    border: 2px solid #d0c3a3;
    border-radius: 30px;
    letter-spacing: 1px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Conteneur du livre */
.book-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
    perspective: 2000px;
    padding: 20px;
    position: relative;
    width: 100%;
}

/* DearFlip Book */
#dearflip-book {
    width: 100%;
    height: 600px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Loader élégant */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(106, 111, 92, 0.95) 0%, rgba(146, 109, 98, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 70px;
    height: 70px;
    border: 5px solid rgba(208, 195, 163, 0.3);
    border-top-color: #d0c3a3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loader p {
    color: #d0c3a3;
    margin-top: 25px;
    font-size: 1.3em;
    letter-spacing: 1px;
}

/* Mode plein écran */
.fullscreen .book-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #6a6f5c 0%, #926d62 100%);
    z-index: 999;
    padding: 20px;
}

/* Branding discret */
.branding {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #d0c3a3;
    font-size: 0.9em;
    opacity: 0.8;
}

.branding a {
    color: #d0c3a3;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.branding a:hover {
    border-bottom-color: #d0c3a3;
}

/* Responsive */
@media (max-width: 768px) {
    #dearflip-book {
        height: 400px;
    }

    .book-container {
        min-height: 400px;
        padding: 10px;
    }

    .controls {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
        padding: 15px;
        max-width: 100%;
    }

    .controls #prevBtn {
        grid-column: 1;
        grid-row: 2;
    }

    .controls #nextBtn {
        grid-column: 2;
        grid-row: 2;
    }

    .controls #pageInfo {
        grid-column: 1 / 3;
        grid-row: 1;
    }

    .controls #fullscreenBtn {
        grid-column: 1 / 3;
        grid-row: 3;
    }

    button {
        padding: 14px 20px;
        font-size: 0.9em;
        width: 100%;
        min-width: auto;
    }

    #pageInfo {
        font-size: 1em;
        padding: 12px 15px;
        width: 100%;
    }

    #fullscreenBtn {
        min-width: auto;
        padding: 12px 20px;
    }
}
