/* OpenSpace — Odyssée Stellaire
   Identité bleu spatial / cyan lumineux / orange solaire.
   Le thème conserve la structure et les dimensions d'Origine 26. */
:root {
  color-scheme: light;
  --os-night: #071a2d;
  --os-deep: #092b49;
  --os-blue: #075b91;
  --os-blue-2: #087db8;
  --os-cyan: #35c9f5;
  --os-cyan-soft: #dff7ff;
  --os-orange: #ff9d00;
  --os-orange-2: #ffbd32;
  --os-ink: #10283e;
  --os-muted: #526b80;
  --os-border: #b8d8e8;
  --os-card: #ffffff;
  --os-page: #edf4f8;
  --os-shadow: 0 3px 12px rgba(4, 35, 61, .15);
}
html {
  min-height: 100%;
  background: var(--os-night);
}
body {
  min-height: 100vh;
  color: var(--os-ink);
  background-color: var(--os-night);
  background-image:
    linear-gradient(rgba(3, 15, 29, .28), rgba(3, 15, 29, .38)),
    url("../../images/N%C3%A9buleuse%20bleue%20au-dessus%20de%20la%20Terre.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-family: Arial, Helvetica, sans-serif;
}
.os-theme-banner {
  display: block;
  width: min(1500px, calc(100% - 28px));
  aspect-ratio: 899 / 71;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 7px auto 6px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(53, 201, 245, .9);
  border-radius: 9px;
  background-color: #061a30;
  background-image: url("../../images/OpenSpace_bandeau_odyssee_899x71_sans_bande.png");
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: 0 0 10px rgba(53, 201, 245, .58), 0 0 22px rgba(0, 133, 220, .22);
}
@media (max-width: 700px) {
  .os-theme-banner {
    width: calc(100% - 16px);
    margin: 5px auto;
    border-radius: 6px;
  }
}

a { color: #006fb1; }
a:hover { color: #e07800; }
.menu {
  position: relative;
  z-index: 2;
  width: min(1500px, calc(100% - 32px));
  max-width: 1500px;
  margin: 0 auto 8px;
  background: linear-gradient(100deg, #06182b 0%, #0b3558 58%, #08233c 100%);
  color: #fff;
  border: 1px solid rgba(68,211,255,.85);
  border-radius: 9px;
  box-shadow: 0 0 0 2px rgba(18,145,202,.15), 0 0 18px rgba(25,190,245,.25);
}
.menu-logo, .menu-user-info, .menu-links a, .player-link { color: #fff; }
.menu-logo { text-shadow: 0 1px 8px rgba(52,199,255,.25); }
.menu-links a { border: 1px solid transparent; transition: .18s ease; }
.menu-links a:hover, .menu-links a:focus {
  color: #15283a;
  background: linear-gradient(110deg, var(--os-orange), #ffd15b);
  border-color: #ffe09a;
  text-decoration: none;
  box-shadow: 0 0 12px rgba(255,157,0,.35);
}
.conteneur {
  background: rgba(237, 244, 248, .90);
  color: var(--os-ink);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.24);
  backdrop-filter: blur(2px);
}
h1, h2, h3, h4 { color: #103e61; }
button, input[type="submit"], .btn, .button {
  color: #fff;
  background: linear-gradient(110deg, #087db8, #075487);
  border: 1px solid #0a6c9e;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(4,65,104,.18);
}
button:hover, input[type="submit"]:hover, .btn:hover, .button:hover {
  color: #10283e;
  background: linear-gradient(110deg, #ffad19, #ffd05a);
  border-color: #f29a00;
}
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  color: #18364d;
  background: #fff;
  border: 1px solid #a9c6d8;
  border-radius: 5px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(42,190,239,.35);
  border-color: #159ed0;
}
table { color: #18364d; border-color: #d3e1e9; }
th { color: #fff; background: #124d73; }
td, th { border-color: #d4e1e9; }
tr:nth-child(even) { background: #f1f7fa; }
progress { accent-color: #079bd2; }
hr { border-color: #c8dce8; }
::selection { color: #08243a; background: #a8eaff; }


/* V6 — conteneurs Odyssée : même coque bleu spatial que la navigation */
.section,
.chat-container,
.dashboard-section,
.event-card,
.stat-card,
.panel,
.bloc,
.module,
.fenetre {
  background: linear-gradient(112deg, #06182b 0%, #0b3558 58%, #08233c 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(68, 211, 255, .88) !important;
  border-radius: 12px !important;
  box-shadow:
    0 0 0 2px rgba(18, 145, 202, .13),
    0 0 15px rgba(25, 190, 245, .24),
    inset 0 1px 0 rgba(255,255,255,.10) !important;
}

/* Les titres restent bien lisibles sur la coque sombre. */
.section > h2,
.chat-container > .chat-header,
.chat-container .chat-header {
  color: #ffffff !important;
  background: linear-gradient(100deg, #075486 0%, #087db8 70%, #000000 100%) !important;
  border-radius: 8px !important;
  border: 1px solid rgba(80, 218, 255, .7) !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
}
.section > h2 { padding: 7px 10px !important; }
.section > p,
.section > small,
.section > label,
.section > div:not(.objectif):not(.ea-alerte):not(.ea-bilan):not(.ac-alea):not(.jauges),
.chat-container .no-messages {
  color: #f1f8ff;
}

/* Les cartes intérieures restent claires pour ne pas sacrifier la lisibilité. */
.section .objectif,
.section .ea-alerte,
.section .ea-bilan,
.section .ac-alea,
.section .aventure,
.section .card,
.chat-messages,
.chat-message {
  color: #18364d !important;
  background: #f8fcff !important;
  border: 1px solid #a9d8ec !important;
  border-radius: 9px !important;
  box-shadow: 0 2px 8px rgba(0, 20, 38, .16) !important;
}
.chat-header { border-bottom: 1px solid rgba(68,211,255,.75) !important; }
.chat-messages { background: #e7f2f8 !important; }

/* Les conteneurs internes des jauges ne doivent pas hériter du fond sombre. */
.section .barre,
.section progress { background-color: #dce8ef; }


/* V9 — titres compacts, identité du menu persistante */
/* La taille des titres s'adapte à la largeur réelle de chaque conteneur. */
.section {
  container-type: inline-size;
}
.section > h2 {
  font-size: clamp(13px, 5.4cqi, 19px) !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.section > h2 .os-section-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  font-size: 1.7em;
}

.icone-titre {
    width: 1em;
    height: 1em;
    object-fit: contain;
    vertical-align: -0.15em;
    display: inline-block;
    margin-right: 4px;
}

/* Le pseudo et les PA de Gorzak conservent leur accent orange. */
.menu .player-link,
.menu .player-link:visited {
  color: var(--os-orange) !important;
  text-decoration-color: rgba(255,157,0,.65);
}
.menu .player-link:hover {
  color: #ffd36b !important;
}

/* Le lien de la page en cours conserve le même surlignage que le survol. */
.menu-links a.active,
.menu-links a.active:visited {
  color: #15283a !important;
  background: linear-gradient(110deg, var(--os-orange), #ffd15b) !important;
  border-color: #ffe09a !important;
  text-decoration: none !important;
  box-shadow: 0 0 12px rgba(255,157,0,.35), inset 0 1px 0 rgba(255,255,255,.35) !important;
}
.menu-links a.active:hover,
.menu-links a.active:focus {
  color: #15283a !important;
}


/* V8 RESTAUREE — boutons, sous-titres, icones et titre du chat */

/* Titres des panneaux : espacement explicite entre pictogramme et libellé. */
.section > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.section > h2 .os-section-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin: 0 2px 0 0;
}

/* Boutons Contribuer : format intermédiaire et relief bleu de la V8. */
.section .objectif form button[type="submit"],
.section .objectif button[type="button"] {
  box-sizing: border-box;
  min-height: 29px !important;
  padding: 6px 11px !important;
  font-size: .92rem !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  color: #fff !important;
  background: linear-gradient(110deg, #087db8, #075487) !important;
  border: 1px solid #21b9eb !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(0, 150, 220, .30),
              inset 0 1px 0 rgba(255,255,255,.28) !important;
}
.section .objectif form button[type="submit"]:hover:not(:disabled) {
  background: linear-gradient(110deg, #ffad19, #ffd05a) !important;
  color: #10283e !important;
}

/* Titre #general : blanc lisible sur le bandeau bleu/orange. */
.chat-container > .chat-header {
  background: linear-gradient(100deg, #075486 0%, #087db8 72%, #000000 100%) !important;
  border: 1px solid rgba(68, 211, 255, .88) !important;
  border-radius: 8px 8px 0 0 !important;
}
.chat-container > .chat-header h2,
.chat-container > .chat-header h2 *,
.chat-container > .chat-header .os-section-icon {
  color: #fff !important;
  background: transparent !important;
  text-shadow: 0 1px 3px rgba(0, 15, 35, .7) !important;
}

/* Sous-titres et informations secondaires blancs sur les panneaux sombres. */
.jauge p[style*="color: #555"],
.jauge p[style*="color:#555"],
.section > p[style*="color: #666"],
.section > p[style*="color:#666"] {
  color: #f1f8ff !important;
}


/* V11 — état actif du menu toujours lumineux + respiration du bloc événement */

/* Renforce le surlignage orange du lien actif, même sans survol. */
.menu .menu-links a.active,
.menu .menu-links a.active:link,
.menu .menu-links a.active:visited,
.menu .menu-links a[aria-current="page"] {
  color: #15283a !important;
  background: linear-gradient(110deg, #ff9d00 0%, #ffd15b 100%) !important;
  border: 1px solid #ffe09a !important;
  border-radius: 7px !important;
  text-decoration: none !important;
  box-shadow:
    0 0 12px rgba(255, 157, 0, .48),
    0 0 20px rgba(255, 190, 55, .22),
    inset 0 1px 0 rgba(255, 255, 255, .42) !important;
}

/* Le survol ne retire pas l'identité visuelle de la page active. */
.menu .menu-links a.active:hover,
.menu .menu-links a.active:focus,
.menu .menu-links a[aria-current="page"]:hover,
.menu .menu-links a[aria-current="page"]:focus {
  color: #15283a !important;
  background: linear-gradient(110deg, #ffad19 0%, #ffda75 100%) !important;
  border-color: #fff0bf !important;
}

/* Espace entre le titre Événement aléatoire et son panneau de contenu,
   comme l'espacement déjà présent sous Recherche & Développement. */
.section > h2 + .ea-alerte {
  margin-top: 10px !important;
}


/* V12 — halo permanent du lien actif et espacement du bloc événement. */
.menu .menu-links a.active,
.menu .menu-links a.active:link,
.menu .menu-links a.active:visited {
  color: #15283a !important;
  background: linear-gradient(110deg, #ff9d00 0%, #ffd15b 100%) !important;
  border: 1px solid #ffe09a !important;
  border-radius: 7px !important;
  box-shadow: 0 0 12px rgba(255,157,0,.48),
              0 0 20px rgba(255,190,55,.22),
              inset 0 1px 0 rgba(255,255,255,.42) !important;
  text-decoration: none !important;
}

/* Sur la passerelle, l'événement récent utilise .ea-bilan, pas .ea-alerte. */
.section > h2 + .ea-bilan,
.section > h2 + .ea-alerte {
  margin-top: 10px !important;
}


/* Correctif ciblé : bouton Contribuer d'un objectif d'aventure indisponible.
   Seuls les boutons réellement désactivés (attribut disabled) deviennent gris.
   Les boutons actifs et tous les autres éléments restent inchangés. */
.section .objectif form button[type="submit"]:disabled,
.section .objectif form button[type="submit"]:disabled:hover {
  color: #526b80 !important;
  background: linear-gradient(110deg, #dce5eb, #cbd7df) !important;
  border: 1px solid #aebfca !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75) !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}
