[data-bs-theme=dark] {
  --bs-body-bg: #0b0b0b;
  --bs-body-color: #e6e6e6;
  --bs-tertiary-bg: #141414;
  --bs-tertiary-bg-rgb: 20, 20, 20;
  --bs-secondary-bg: #1a1a1a;
  --bs-border-color: #2c2c2c;
  --bs-primary: #ff8c00;
  --bs-primary-rgb: 255, 140, 0;
  --bs-link-color: #ff9d2e;
  --bs-link-color-rgb: 255, 157, 46;
  --bs-link-hover-color: #ffb257;
  --bs-link-hover-color-rgb: 255, 178, 87;
}

/* Barre de navigation */
.navbar {
  border-bottom: 2px solid #ff8c00;
}
.navbar-brand {
  color: #ff8c00 !important;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Titres */
h1, .h3 {
  color: #ff8c00;
}

/* Cartes et listes */
.card, .list-group-item {
  background-color: #141414;
  border-color: #2c2c2c;
}
.card-header, .card-footer {
  background-color: #1a1a1a;
  border-color: #2c2c2c;
}
.list-group-item-action:hover {
  background-color: #1f1a14;
}

/* Champs de formulaire */
.form-control, .form-select {
  background-color: #141414;
  border-color: #333;
  color: #e6e6e6;
}
.form-control:focus, .form-select:focus {
  background-color: #141414;
  color: #fff;
  border-color: #ff8c00;
  box-shadow: 0 0 0 0.25rem rgba(255, 140, 0, 0.25);
}

/* Boutons */
.btn-primary {
  --bs-btn-color: #000;
  --bs-btn-bg: #ff8c00;
  --bs-btn-border-color: #ff8c00;
  --bs-btn-hover-color: #000;
  --bs-btn-hover-bg: #ffa333;
  --bs-btn-hover-border-color: #ffa333;
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: #e67e00;
  --bs-btn-active-border-color: #e67e00;
  --bs-btn-disabled-color: #000;
  --bs-btn-disabled-bg: #ff8c00;
  --bs-btn-disabled-border-color: #ff8c00;
}
.btn-outline-primary {
  --bs-btn-color: #ff8c00;
  --bs-btn-border-color: #ff8c00;
  --bs-btn-hover-color: #000;
  --bs-btn-hover-bg: #ff8c00;
  --bs-btn-hover-border-color: #ff8c00;
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: #e67e00;
  --bs-btn-active-border-color: #e67e00;
}
.btn-outline-secondary {
  --bs-btn-color: #bbb;
  --bs-btn-border-color: #444;
  --bs-btn-hover-bg: #2a2a2a;
  --bs-btn-hover-border-color: #ff8c00;
  --bs-btn-hover-color: #ff8c00;
}
.btn-link {
  --bs-btn-color: #ff9d2e;
  --bs-btn-hover-color: #ffb257;
}

/* Onglets de la page du joueur */
.nav-pills .nav-link {
  color: #ccc;
}
.nav-pills .nav-link:hover {
  color: #ff8c00;
}
.nav-pills .nav-link.active {
  background-color: #ff8c00;
  color: #000;
  font-weight: 600;
}

/* Messages d'alerte : teinte orange */
.alert-info, .alert-success {
  background-color: #2a1a05;
  border-color: #ff8c00;
  color: #ffc680;
}
.alert-info strong, .alert-success strong {
  color: #ff8c00;
}
.alert-secondary {
  background-color: #1a1a1a;
  border-color: #333;
  color: #ccc;
}

/* Texte secondaire plus lisible sur fond noir */
.text-muted, .form-text {
  color: #9a9a9a !important;
}

/* Badges */
.badge.bg-secondary {
  background-color: #3a3a3a !important;
}
.badge.bg-success {
  background-color: #ff8c00 !important;
  color: #000;
}
.echeance {
  color: #ff3b30;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
}
.minuteur {
  color: #ff3b30; /* rouge : moins de 4 h */
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  line-height: 1.1;
}
.minuteur.vert { color: #34c759; }
.minuteur.orange { color: #ff9500; }
.minuteur-sm { font-size: 1rem; }
.minuteur-md { font-size: 1.4rem; }
.minuteur-lg { font-size: 2rem; }
.minuteur-xl { font-size: 3rem; }
.minuteur.fini { animation: clignote 1s steps(2, start) infinite; }
@keyframes clignote { to { visibility: hidden; } }

.journal {
  background: #e8dcc0 radial-gradient(ellipse at center, #efe5cb 0%, #d9c9a3 100%);
  color: #2b2118;
  font-family: 'IM Fell English', Georgia, serif;
  padding: 2rem;
  border: 1px solid #a8946a;
  box-shadow: 0 6px 24px rgba(0,0,0,.6), inset 0 0 60px rgba(120,90,40,.35);
}
.journal-titre {
  font-family: 'UnifrakturCook', 'IM Fell English', serif;
  font-size: clamp(2rem, 6vw, 4rem);
  text-align: center;
  border-bottom: 4px double #2b2118;
  padding-bottom: .3rem;
}
.journal-sous-titre {
  text-align: center; font-style: italic; margin: .4rem 0 1.5rem;
  border-bottom: 1px solid #2b2118; padding-bottom: .4rem;
}
.journal-colonnes { column-count: 2; column-gap: 2.5rem; column-rule: 1px solid #8b7a55; }
.journal-article { break-inside: avoid; margin-bottom: 1.5rem; }
.journal-article h2 { font-size: 1.4rem; font-weight: bold; color: #2b2118; margin-bottom: .1rem; }
.journal-signature { font-size: .85rem; font-style: italic; color: #5a4a32; border-bottom: 1px solid #b8a37a; margin-bottom: .5rem; }
.journal-article p { text-align: justify; white-space: pre-wrap; margin-bottom: 0; }
@media (max-width: 768px) { .journal-colonnes { column-count: 1; } }

/* Journal par année */
.journal-bilan { text-align: center; border-top: 1px solid #8b7a55; border-bottom: 1px solid #8b7a55; padding: .4rem; margin-bottom: 1.5rem; font-size: .95rem; }
.journal-edition { border-top: 3px double #5a4a32; padding-top: .6rem; margin-bottom: 2rem; }
.journal-edition-tete { text-transform: uppercase; letter-spacing: .15em; font-size: .75rem; color: #5a4a32; text-align: center; }
.journal-une { font-size: 2rem; font-weight: bold; text-align: center; margin: .3rem 0; color: #2b2118; }
.journal-chapeau { text-align: center; font-style: italic; margin-bottom: 1rem; }
.journal-article h3 { font-size: 1.1rem; font-weight: bold; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid #b8a37a; color: #2b2118; }
.journal-article p { margin-bottom: .5rem; }
.journal-officiel { margin-top: .8rem; font-size: .9rem; }
.journal-officiel summary { cursor: pointer; font-weight: bold; }
.journal-officiel h4 { font-size: 1rem; margin: .6rem 0 .2rem; }
.journal-officiel ul { margin-bottom: .3rem; }
.journal-officiel a { color: #7a3b00; }

/* Journal : une colonne, sections par saison */
.journal-entete { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 1rem; }
.journal-centre { text-align: center; }
.journal-annee { font-size: 2.6rem; font-weight: bold; line-height: 1; letter-spacing: .1em; color: #5a4a32; }
.journal-nav a { color: #7a3b00; font-size: 1.2rem; font-weight: bold; text-decoration: none; }
.journal-nav a:hover { text-decoration: underline; }
.journal > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.journal > .journal-entete { max-width: 100%; }
.saison { margin-bottom: 2.5rem; }
.saison-titre { display: flex; align-items: center; gap: .6rem; font-size: 1.7rem; border-top: 3px double #5a4a32; border-bottom: 1px solid #b8a37a; padding: .4rem 0; margin-bottom: 1rem; color: #2b2118; }
.saison-icone { width: 38px; height: 38px; }
.saison-encours { font-size: .8rem; font-style: italic; color: #7a3b00; margin-left: auto; }
.journal-rubrique h4 { font-size: 1rem; font-weight: bold; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid #b8a37a; margin: 1rem 0 .4rem; color: #2b2118; }
.journal-rubrique p { margin-bottom: .4rem; text-align: justify; }
.journal-classement { margin-top: 1rem; font-size: .9rem; }
.journal-carte { margin: 1rem 0; }
.journal-carte summary { cursor: pointer; font-weight: bold; color: #7a3b00; }
.journal-tribune { margin-top: 1.5rem; padding: .8rem 1rem; background: rgba(255,255,255,.35); border: 1px solid #a8946a; }
.journal-annonce { display: flex; gap: .9rem; padding: .8rem 0; border-bottom: 1px dotted #8b7a55; }
.journal-annonce:last-child { border-bottom: 0; }
.journal-annonce-drapeau { flex: 0 0 56px; padding-top: .3rem; }
.journal-annonce-drapeau svg { display: block; max-width: 100%; height: auto; }
.journal-annonce-corps h3 { font-size: 1.25rem; font-weight: bold; margin: 0; color: #2b2118; }
.journal-annonce-corps p { white-space: pre-wrap; text-align: justify; margin: 0; }
.journal-publier summary { display: inline-block; }

/* Messagerie : reçus / envoyés dans une seule liste */
.table > tbody > tr.msg-envoye > * { --bs-table-bg: rgba(80, 150, 230, .16); --bs-table-hover-bg: rgba(80, 150, 230, .26); box-shadow: inset 3px 0 0 #4f9be6; }
.table > tbody > tr.msg-envoye > :not(:first-child) { box-shadow: none; }
.legende-msg { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: middle; margin-right: .25rem; }
.legende-recu { background: rgba(255,255,255,.25); border: 1px solid #888; }
.legende-envoye { background: #4f9be6; }

/* Pastille de connexion */
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: .2rem; }
.pastille-verte { background: #2ecc40; box-shadow: 0 0 6px #2ecc40; }
.pastille-rouge { background: #e03131; }

/* Tchat privé */
.fil-direct { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; }
.bulle { max-width: 80%; padding: .35rem .65rem; border-radius: .7rem; white-space: pre-wrap; word-break: break-word; }
.bulle small { display: block; font-size: .7rem; opacity: .65; }
.bulle-moi { align-self: flex-end; background: #c2570c; color: #fff; }
.bulle-autre { align-self: flex-start; background: #2e2e2e; color: #eee; border: 1px solid #444; }

/* Pages légales */
.legal h2 { font-size: 1.25rem; margin-top: 1.6rem; color: #ff9d3c; }
.legal ul { padding-left: 1.2rem; }
.a-completer { background: #ffe066; color: #000; padding: 0 .25rem; border-radius: 3px; }
.pied-site a { color: inherit; }

/* Séparation entre la messagerie et le tchat */
.separateur-blocs { height: 0; border-top: 2px solid #c2570c; opacity: .45; margin: 2rem 0; }

/* Messagerie façon Outlook : conversation dépliable */
.conversation .mail { border-left: 3px solid #888; background: rgba(255,255,255,.04); border-radius: 4px; margin-bottom: .5rem; }
.conversation .mail-moi { border-left-color: #4f9be6; background: rgba(80,150,230,.10); }
.conversation .mail > summary { cursor: pointer; padding: .45rem .75rem; list-style: none; }
.conversation .mail > summary::-webkit-details-marker { display: none; }
.conversation .mail[open] .apercu { display: none; }
.conversation .mail-corps { padding: .25rem .75rem .75rem; border-top: 1px solid rgba(255,255,255,.08); }
.msg-tchat .pastille { margin-right: .35rem; }
