/* NOUVELLE PALETTE CHALEUREUSE (Tons Ocre Pastel) */
:root {
    --bg-color: #FDFBF7; /* CrÃ¨me trÃ¨s doux, chaud */
    --text-main: #4A3B2C; /* Brun profond, trÃ¨s lisible mais moins dur que le noir */
    --text-muted: #9E8973; /* Ocre grisÃ© */
    --door-bg: #F4D1A6; /* Ocre pastel chaleureux (les boutons) */
    --door-hover: #E3BC8B; /* Ocre un peu plus soutenu */
    --accent: #C28F5A; /* Ocre terre cuite / bouton micro */
    --speaking: #7DA67D; /* Vert pastel pour indiquer la parole */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body, html {
    background-color: var(--bg-color);
    color: var(--text-main);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

/* TYPOGRAPHIE */
header {
    text-align: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    letter-spacing: -1px;
}

.subtitle {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.2rem;
}

.logo-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

/* Ã‰CRAN D'ONBOARDING (Le Contrat Moral) */
.onboarding {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
}

.onboarding-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.rules-box {
    background-color: rgba(244, 209, 166, 0.2);
    border: 1px solid var(--door-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: left;
    width: 100%;
    max-width: 400px;
}

.rules-box p {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.input-group {
    width: 100%;
    max-width: 300px;
    margin-bottom: 1.5rem;
}

.text-input {
    width: 100%;
    border: 1px solid var(--door-hover);
    border-radius: 25px;
    padding: 1rem;
    background-color: white;
    font-size: 1rem;
    color: var(--text-main);
    text-align: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.text-input:focus {
    outline: none;
    border-color: var(--accent);
}

.primary-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}

.primary-btn:hover {
    background-color: #A97A4A;
}

/* GRILLE DES 6 PORTES */
.doors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0.8rem;
    flex-grow: 1;
    margin-bottom: 0.5rem;
}

.door-btn {
    background-color: var(--door-bg);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 100%;
}

.door-btn:hover {
    background-color: var(--door-hover);
    transform: translateY(-2px);
}

.door-btn .icon {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.door-btn .title {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: var(--text-main);
    font-weight: 500;
}

/* UTILITAIRES */
.hidden {
    display: none !important;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
    text-align: left;
    flex-shrink: 0;
}

/* STYLES DU HALL */
#hall-screen {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#hall-title {
    font-weight: 400;
    margin-bottom: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.sub-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.theme-tag {
    background-color: var(--door-bg);
    color: var(--text-main);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.theme-tag:hover {
    background-color: var(--door-hover);
}

.hall-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn {
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
}

.room-card {
    background-color: #fff;
    border: 1px solid var(--door-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

/* STYLES DU SALON (CHAT) */
#room-screen {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.room-header {
    text-align: center;
    margin-bottom: 1rem;
}

.participants {
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    background-color: rgba(244, 209, 166, 0.4);
    border-radius: 20px;
    margin-bottom: 1rem;
}

.pseudo {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pseudo.active {
    color: var(--text-main);
}

.pseudo.speaking {
    color: var(--speaking);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.chat-stream {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-right: 0.5rem;
}

.message {
    padding: 0.8rem;
    border-radius: 12px;
    background-color: white;
    width: 85%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.message .sender {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.2rem;
}

.msg-ai {
    background-color: transparent;
    border-left: 3px solid var(--accent);
    box-shadow: none;
    align-self: center;
    width: 95%;
    color: var(--accent);
}

.msg-ulysse {
    align-self: flex-end;
    background-color: var(--door-bg);
}

.input-area {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.mic-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s;
}

.mic-btn:active {
    transform: scale(0.95);
}

.chat-input {
    text-align: left;
}

.send-btn {
    background-color: transparent;
    border: none;
    color: var(--accent);
    font-weight: bold;
    cursor: pointer;
    padding: 0.5rem;
}

/* FOOTER PERMANENT */
.app-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 1rem;
    flex-shrink: 0;
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.app-footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ========================================== */
/* IMPRESSION & EXPORT PDF (Zéro-Trace Server) */
/* ========================================== */
@media print {
    body, html { height: auto !important; overflow: visible !important; background-color: #fff; color: #000; }
    .input-area, .back-btn, .action-btn, .app-footer, .doors-grid, #onboarding-screen, #hall-screen, .participants, #sub-themes-container { display: none !important; }
    .container { max-width: 100%; padding: 0; }
    #room-screen { display: block !important; }
    .chat-stream { height: auto !important; overflow: visible !important; padding: 0; margin: 0; }
    .message { box-shadow: none !important; border: 1px solid #ddd; margin-bottom: 15px; page-break-inside: avoid; width: 100%; }
    .msg-ulysse { background-color: #f9f9f9; }
    .msg-ai { border-left: 3px solid #000; color: #000; }
}
