*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

body {
    background: radial-gradient(circle at center, var(--bg-light) 0%, var(--bg-deep) 100%);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transition: background 0.5s ease;
    overflow-x: hidden;
}

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

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(15, 17, 26, 0.2);
    border-radius: 50%;
    border-top-color: #0f111a;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 10px;
    will-change: transform;
}

.spinner-gold {
    border-top-color: var(--accent);
    border-left-color: var(--accent);
    border-bottom-color: transparent;
    border-right-color: transparent;
}

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

/* Typography */
h1, h2, h3 {
    color: var(--accent);
    font-family: 'Cinzel', serif;
    font-weight: 400;
    text-shadow: 0 0 15px var(--accent-soft);
    margin-top: 0;
}

.subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--text-dim);
    font-size: 1.1em;
    margin-bottom: 25px;
}

/* Containers */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(12px);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 420px;
    max-width: 95vw;
    text-align: center;
    margin-top: 15vh;
    margin-bottom: 50px;
}

#screen-dashboard {
    width: 90%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    margin-top: 8vh;
    margin-bottom: 8vh;
}

/* Inputs & Buttons */
input {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    transition: all 0.3s;
}

input:focus {
    outline: none;
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(0, 0, 0, 0.6);
}

button {
    width: 100%;
    padding: 16px;
    margin-top: 15px;
    border-radius: 10px;
    border: none;
    background: var(--accent-grad);
    color: #0f111a;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(184, 134, 11, 0.4);
}

button:disabled {
    background: #555;
    color: #888;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent-soft);
    color: #fff;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--accent-soft);
    padding-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    cursor: pointer;
    padding: 10px 20px;
    transition: 0.3s;
    width: auto;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    font-weight: 600;
}

/* Dashboard Layout */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Centrage et mise en page des onglets */
.tab-content-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Changé de stretch à flex-start pour éviter les bugs de hauteur */
    margin-top: 0;
    margin-bottom: 30px;
    min-height: 65vh;
}

/* On override les propriétés de .glass-panel quand il est utilisé comme contenu d'onglet */
.tab-content-container.glass-panel {
    width: 100%;
    max-width: 1200px;
    margin-top: 0;
    text-align: left;
    box-sizing: border-box;
    align-items: stretch; /* Les glass-panels comme 'Détails' doivent rester larges */
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    align-items: start;
}

/* Grille uniforme pour les 12 maisons */
#grid-maisons.dashboard-grid {
    align-items: stretch; /* Les cartes d'une même ligne auront la même hauteur */
}

#grid-maisons .card {
    display: flex;
    flex-direction: column;
}

#grid-maisons .card .content {
    flex-grow: 1;
}

.card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px;
    border-radius: 15px;
    text-align: left;
    transition: transform 0.3s;
    line-height: 1.6;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15em;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-soft);
}

.card h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--accent-soft);
    padding-bottom: 10px;
}

/* Chat UI */
.chat-area {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--accent-soft);
}

#chat-history {
    flex-grow: 1;
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 10px;
}

.chat-input-row {
    display: flex;
    gap: 10px;
}

.chat-input-row button {
    width: 150px;
    margin: 0;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.hamburger-btn {
    background: transparent;
    border: 1px solid var(--accent-soft);
    color: var(--accent);
    font-size: 1.5em;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    transition: 0.3s;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background-color: var(--bg-deep);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.6);
    z-index: 100;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
}

.dropdown-content.show {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.theme-switcher {
    display: flex;
    gap: 12px;
    align-items: center;
}

.theme-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dot-gold { background: #ffd700; }
.dot-amethyst { background: #c38eff; }
.dot-emerald { background: #50c878; }
.dot-eclipse { background: #ff4d00; }
.dot-parchment { background: #d9d2c5; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal-content {
    background: var(--bg-deep);
    border: 1px solid var(--accent-soft);
    max-width: 800px;
    width: 100%;
    max-height: none;
    border-radius: 24px;
    padding: 40px;
    overflow-y: visible;
    position: relative;
    margin: auto;
}

.modal-illustration {
    float: left;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 40px rgba(255, 215, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    font-size: 2em;
    color: var(--accent);
    cursor: pointer;
}

.deep-text {
    line-height: 1.8;
    font-size: 1.1em;
    white-space: pre-line;
}

/* Details Tab & Technical Grids */
.details-container {
    width: 100% !important;
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
    box-sizing: border-box;
}

.details-section {
    margin-bottom: 40px;
}

.details-section h3 {
    border-bottom: 1px solid var(--accent-soft);
    padding-bottom: 10px;
    margin-bottom: 25px;
    font-size: 1.4em;
}

.mini-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.mini-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mini-card:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.mc-title {
    font-size: 0.85em;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mc-value {
    font-size: 1.2em;
    color: var(--accent);
    font-weight: 600;
    font-family: 'Cinzel', serif;
}

.mc-deg {
    font-size: 0.9em;
    color: var(--text);
    opacity: 0.7;
}
/* ------------------------------------- */
/* TIMELINE CHRONO-DESTIN (SYNCHRONICITÉS) */
/* ------------------------------------- */

.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 60px auto;
    padding: 40px 0;
    width: 100%;
    min-height: 400px;
}

/* La ligne centrale parfaite */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent-soft), var(--accent), var(--accent-soft), transparent);
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-item {
    position: relative;
    width: 100%;
    margin-bottom: 120px;
    min-height: 100px;
    display: block;
}

/* ÉVÉNEMENTS MAJEURS */
.major-event {
    width: 100%;
    position: relative;
}

.timeline-content-card {
    width: 44%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    padding: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    z-index: 2;
}

/* Positionnement Gauche */
.major-event.left .timeline-content-card {
    margin-left: 0;
    margin-right: auto;
}

/* Positionnement Droite */
.major-event.right .timeline-content-card {
    margin-left: auto;
    margin-right: 0;
}

/* Titres (Dates et Aspects) fixés sur la ligne */
.major-event .timeline-date, 
.major-event .timeline-aspect {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    white-space: nowrap;
    text-align: center;
    z-index: 10;
}

.major-event .timeline-date {
    top: -55px;
    background: var(--bg-deep);
    border: 1px solid var(--accent-soft);
    padding: 4px 15px;
    border-radius: 20px;
    color: var(--accent);
    font-family: 'Cinzel', serif;
    font-size: 1em;
}

.major-event .timeline-aspect {
    top: -20px;
    font-size: 0.9em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px var(--accent);
}

.timeline-content-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.25);
}

.major-img-container {
    float: right;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin-left: 15px;
    margin-bottom: 10px;
    /* Suppression de la bordure pour éviter le détourage blanc */
    border: none; 
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
    background: transparent;
    position: relative;
}

.major-img-container img {
    width: 140%; /* Zoom plus fort pour cacher les bords de l'image source */
    height: 140%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-mask-image: radial-gradient(circle, black 60%, transparent 80%);
    mask-image: radial-gradient(circle, black 60%, transparent 80%);
    filter: brightness(1.1) contrast(1.1);
}

/* Surbrillance des événements actuellement actifs */
.timeline-item.active-transit .timeline-content-card {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.8);
}

.timeline-item.active-transit .minor-planet-dot {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
}

/* ÉVÉNEMENTS MINEURS */
.minor-event {
    height: 70px;
    margin-bottom: 100px;
}

.minor-planet-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: transparent;
    border: none; /* Suppression bordure */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.minor-planet-dot img {
    width: 140%; /* Zoom plus fort */
    height: 140%;
    object-fit: cover;
    -webkit-mask-image: radial-gradient(circle, black 60%, transparent 80%);
    mask-image: radial-gradient(circle, black 60%, transparent 80%);
    filter: brightness(1.1) contrast(1.1);
}

.minor-planet-dot:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 40px var(--accent);
    border-color: var(--accent);
}






.minor-info-box {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    pointer-events: none;
    z-index: 15;
}

/* Alternance du texte mineur */
.minor-event.left-text .minor-info-box {
    right: calc(50% + 40px);
    text-align: right;
}

.minor-event.right-text .minor-info-box {
    left: calc(50% + 40px);
    text-align: left;
}

.minor-date {
    font-family: 'Cinzel', serif;
    font-size: 0.85em;
    color: var(--accent);
    font-weight: bold;
}

.minor-aspect {
    font-size: 0.75em;
    opacity: 0.7;
    display: block;
}

.sync-score, .sync-duration {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.7em;
    font-weight: bold;
    margin-top: 5px;
}

.sync-score {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent);
    border: 1px solid var(--accent-soft);
}

.sync-duration {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
}

.timeline-content-card p:last-child {
    margin-bottom: 0;
}

/* ---- Scoreboard Thème du Mois ---- */
.destiny-score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.score-item {
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 25px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.score-label {
    font-size: 0.8em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.score-value {
    font-size: 1.5em;
    font-family: 'Cinzel', serif;
    color: var(--accent);
}


/* ---- Fin de la Frise ---- */


/* ---- Overrides pour thème clair (parchment) ---- */
.theme-parchment .card {
    background: rgba(93, 64, 55, 0.1);
    border-color: rgba(93, 64, 55, 0.2);
    box-shadow: 0 4px 20px rgba(93, 64, 55, 0.08);
}

.theme-parchment .card:hover {
    background: rgba(93, 64, 55, 0.17);
}

.theme-parchment .timeline-content-card {
    background: rgba(93, 64, 55, 0.1);
    border-color: rgba(93, 64, 55, 0.2);
    box-shadow: 0 4px 20px rgba(93, 64, 55, 0.08);
}

.theme-parchment .timeline-content-card:hover {
    background: rgba(93, 64, 55, 0.17);
}

.theme-parchment .score-item {
    background: rgba(93, 64, 55, 0.1);
    border-color: rgba(93, 64, 55, 0.2);
}

/* ---- CHAT MODALE ---- */
#modal-chat-container {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 215, 0, 0.12);
}

.modal-chat-collapsed {
    max-height: 130px; /* Input + teaser */
}

.modal-chat-expanded {
    max-height: 500px;
}

/* Override des styles globaux input/button DANS le chat modale */
#modal-chat-container .chat-input-wrapper input {
    width: auto;
    margin: 0;
    padding: 12px 16px;
    flex: 1;
    min-width: 0;
    border-radius: 8px;
    border: 1px solid var(--accent-soft);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
}

#modal-chat-container .chat-input-wrapper button {
    width: auto;
    flex-shrink: 0;
    margin: 0;
    padding: 0 20px;
    font-size: 0.95rem;
    border-radius: 8px;
    background: var(--accent);
    color: var(--bg-deep);
    border: none;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    height: 46px;
}

#modal-chat-mic, #chat-mic {
    background: #2a2825; /* Fond sombre et mat */
    color: var(--accent); /* Icône dorée par défaut */
    border: 1px solid rgba(255, 215, 0, 0.15);
    width: 46px;
    height: 46px;
    border-radius: 50%; /* Cercle parfait */
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

#modal-chat-mic svg, #chat-mic svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

#modal-chat-mic:hover, #chat-mic:hover {
    background: #36332f;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

#modal-chat-mic:hover svg, #chat-mic:hover svg {
    transform: scale(1.1);
}

/* État actif - En cours d'enregistrement */
#modal-chat-mic.recording, #chat-mic.recording {
    background: rgba(255, 77, 77, 0.15) !important;
    border-color: #ff4d4d !important;
    color: #ff4d4d !important;
    animation: mic-pulse 1.5s infinite ease-in-out;
}

/* État intermédiaire - Connexion / Initialisation du micro */
#modal-chat-mic.connecting, #chat-mic.connecting {
    background: rgba(255, 215, 0, 0.1) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    animation: mic-connecting 1s infinite ease-in-out;
}

/* Style du bouton d'écoute des messages individuels */
.chat-speak-btn {
    opacity: 0.5;
    transition: all 0.2s ease;
}

.chat-speak-btn:hover, .chat-speak-btn.playing {
    opacity: 1 !important;
    color: var(--accent) !important;
    transform: scale(1.1);
}

@keyframes mic-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 5px rgba(255, 77, 77, 0.3);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 18px rgba(255, 77, 77, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 5px rgba(255, 77, 77, 0.3);
    }
}

@keyframes mic-connecting {
    0% {
        transform: scale(1);
        opacity: 0.6;
        box-shadow: 0 0 3px rgba(255, 215, 0, 0.1);
    }
    50% {
        transform: scale(1.04);
        opacity: 1;
        box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
        box-shadow: 0 0 3px rgba(255, 215, 0, 0.1);
    }
}


#modal-chat-history {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    padding-right: 10px;
    border-top: 1px solid rgba(255,215,0,0.15);
    padding-top: 15px;
    margin-top: 15px;
}

.modal-chat-message {
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.9em;
    line-height: 1.4;
}

.modal-chat-user {
    align-self: flex-end;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--accent-soft);
    color: white;
}

.modal-chat-oracle {
    align-self: flex-start;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text);
}

.theme-parchment .mini-card {
    background: rgba(93, 64, 55, 0.1);
}

/* --- SYNASTRIE --- */
.partner-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.partner-card:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.partner-card-info h4 {
    margin: 0 0 5px 0;
    color: var(--accent);
    font-size: 1.1em;
}

.partner-card-info p {
    margin: 0;
    font-size: 0.85em;
    opacity: 0.8;
}

.partner-relation-badge {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- SYNASTRY MODAL & GAUGES --- */

.synastry-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.synastry-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.synastry-modal-content {
    background: var(--bg-deep);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 20px rgba(255,215,0,0.05);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.synastry-modal.show .synastry-modal-content {
    transform: translateY(0);
}

.synastry-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 30px;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
    width: auto;
    margin: 0;
    padding: 0;
}

.synastry-close-btn:hover {
    color: var(--accent);
}

.synastry-header {
    text-align: center;
    margin-bottom: 40px;
}

.synastry-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, rgba(0,0,0,0) 70%);
    border: 2px solid var(--accent);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(255,215,0,0.2);
}

.synastry-score-circle .score-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--accent);
    line-height: 1;
}

.synastry-score-circle .score-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

.synastry-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 3px solid var(--accent);
}

.synastry-gauge-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.synastry-gauge-title {
    font-weight: bold;
    color: var(--accent);
    min-width: 130px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.synastry-gauge-container {
    flex-grow: 1;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.synastry-gauge-fill {
    height: 100%;
    background: var(--accent-grad);
    width: 0%;
    transition: width 1.5s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.synastry-gauge-value {
    font-weight: bold;
    min-width: 35px;
    text-align: right;
    color: var(--accent);
}

.synastry-text {
    line-height: 1.6;
    opacity: 0.9;
    font-size: 0.95em;
    color: var(--text) !important;
}

/* --- FIREBASE AUTHENTICATION CUSTOM STYLES --- */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: var(--text) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 1em !important;
    font-weight: 500 !important;
    margin-top: 10px;
    margin-bottom: 15px;
    text-shadow: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    text-transform: none !important;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--accent) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2) !important;
}

.google-icon {
    display: block;
    flex-shrink: 0;
}

.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-dim);
    margin: 15px 0;
    font-size: 0.9em;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-separator:not(:empty)::before {
    margin-right: 1em;
}

.auth-separator:not(:empty)::after {
    margin-left: 1em;
}

.auth-toggle-container {
    margin-top: 22px;
    font-size: 0.95em;
}

.auth-toggle-container a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.15em;
}

.auth-toggle-container a:hover {
    color: var(--accent);
}

.toggle-action {
    color: var(--accent);
    text-decoration: underline;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-size: 0.85em;
    margin-left: 5px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

/* Tablet Portrait & Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
    #screen-dashboard {
        width: 95%;
        margin-top: 4vh;
        margin-bottom: 4vh;
    }
    
    .tab-content-container.glass-panel {
        padding: 30px;
    }
}

/* Mobile Screens (max-width: 768px) */
@media (max-width: 768px) {
    /* Global modifications & containers */
    body {
        align-items: flex-start;
        padding: 10px 0;
    }
    
    .glass-panel {
        padding: 20px 10px;
        border-radius: 16px;
        margin-top: 5vh;
        margin-bottom: 25px;
        width: 100%;
        max-width: calc(100% - 16px);
        box-sizing: border-box;
    }
    
    #screen-dashboard {
        width: 100%;
        padding: 10px 8px;
        margin-top: 10px;
        margin-bottom: 10px;
        box-sizing: border-box;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .dashboard-header h1 {
        font-size: 1.5em;
        text-align: center;
    }
    
    .dashboard-header .subtitle {
        font-size: 0.95em;
        text-align: center;
    }
    
    .dashboard-header > div:last-child {
        display: flex;
        justify-content: center;
        gap: 10px;
    }
    
    /* Scrollable Tabs */
    .tabs {
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        margin-bottom: 20px;
        scrollbar-width: none; /* Firefox */
        gap: 10px;
    }
    
    .tabs::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    .tab-btn {
        flex: 0 0 auto;
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    /* Tab Content Containers */
    .tab-content-container {
        min-height: auto;
        margin-bottom: 20px;
    }
    
    .tab-content-container.glass-panel {
        padding: 15px 10px;
        border-radius: 16px;
    }
    
    /* Grids & Cards */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .card {
        padding: 15px;
        font-size: 1.05em;
    }
    
    .card h3 {
        font-size: 1.2em;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .mini-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .mini-card {
        padding: 12px 8px;
        border-radius: 10px;
    }
    
    .mc-title {
        font-size: 0.75em;
    }
    
    .mc-value {
        font-size: 1em;
    }
    
    .mc-deg {
        font-size: 0.8em;
    }
    
    /* Timeline (Synchronicités) */
    .timeline-container {
        padding: 20px 0;
        margin: 20px auto;
    }
    
    .timeline-container::before {
        left: 20px;
    }
    
    .timeline-item {
        margin-bottom: 80px;
    }
    
    .timeline-content-card {
        width: calc(100% - 35px) !important;
        margin-left: 35px !important;
        margin-right: 0 !important;
        padding: 15px 12px;
    }
    
    .major-event .timeline-date {
        left: 35px;
        transform: none;
        top: -42px;
        font-size: 0.85em;
        padding: 3px 8px;
    }
    
    .major-event .timeline-aspect {
        left: 35px;
        width: calc(100% - 45px);
        transform: none;
        top: -18px;
        font-size: 0.8em;
        text-align: center;
        white-space: normal;
    }
    
    .major-img-container {
        width: 60px;
        height: 60px;
        margin-left: 8px;
        margin-bottom: 5px;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }
    
    .minor-event {
        height: 40px;
        margin-bottom: 60px;
    }
    
    .minor-planet-dot {
        left: 20px;
        width: 40px;
        height: 40px;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }
    
    .minor-event.left-text .minor-info-box,
    .minor-event.right-text .minor-info-box {
        left: 50px;
        right: auto;
        text-align: left;
        width: calc(100% - 65px);
    }
    
    .minor-date {
        font-size: 0.8em;
    }
    
    .minor-aspect {
        font-size: 0.7em;
    }
    
    /* Synastrie Specific Card Resizing */
    #grid-synastrie .card {
        min-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Modals */
    .modal-overlay {
        padding: 10px 5px;
    }
    
    .modal-content {
        padding: 20px 12px;
        border-radius: 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .modal-close {
        top: 10px;
        right: 12px;
        font-size: 1.8em;
    }
    
    .modal-close:hover {
        color: var(--accent);
    }
    
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-top: 10px;
        margin-bottom: 15px;
    }
    
    .modal-header h2 {
        font-size: 1.2em;
        margin: 0;
        line-height: 1.3;
    }
    
    .modal-header > div {
        width: 100%;
        justify-content: space-between;
    }
    
    #voice-selector {
        max-width: 120px !important;
    }
    
    #btn-voice-toggle {
        padding: 8px 12px !important;
    }
    
    .modal-illustration {
        float: none !important;
        width: 160px !important;
        height: 160px !important;
        margin: 0 auto 20px !important;
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2) !important;
    }
    
    .deep-text {
        font-size: 1em;
        line-height: 1.6;
    }
    
    #modal-chat-container .chat-input-wrapper {
        gap: 5px;
    }
    
    /* Synastrie Modal */
    .synastry-modal-content {
        padding: 20px 15px;
        width: 95%;
    }
    
    .synastry-close-btn {
        top: 12px;
        right: 12px;
        font-size: 24px;
    }
    
    .synastry-score-circle {
        width: 90px;
        height: 90px;
    }
    
    .synastry-score-circle .score-number {
        font-size: 1.8em;
    }
    
    .synastry-gauge-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .synastry-gauge-title {
        min-width: unset;
        font-size: 0.8em;
    }
    
    .synastry-section {
        padding: 15px;
    }
    
    /* Chat Area & Chat Input Row */
    .chat-area {
        padding: 15px 10px;
        margin-top: 15px;
    }
    
    #chat-history {
        min-height: 180px;
        max-height: 250px;
    }
    
    .chat-input-row {
        gap: 5px;
    }
    
    .chat-input-row button:not(.chat-mic-btn) {
        width: auto !important;
        padding: 0 12px !important;
        font-size: 0.9em;
    }
}


