
:root {
  --bg: #050608;
  --bg-alt: #11131a;
  --bg-card: #151826;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --accent: #e6cc37;
  --accent-soft: rgba(230, 204, 55, 0.12);
  --accent-strong: #f6e47a;
  --text-main: #f5f5f7;
  --text-muted: #b4b7c8;
  --shadow-soft: 0 18px 35px rgba(0, 0, 0, 0.55);
  --radius-lg: 18px;
  --radius-xl: 26px;
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.26s ease-out;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1b2440 0, #050608 52%, #020308 100%);
  color: var(--text-main);
}

body {
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.3rem;
  background: linear-gradient(90deg, rgba(5, 6, 8, 0.98), rgba(10, 12, 20, 0.98));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, var(--accent-strong), var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #111;
  box-shadow: 0 0 18px rgba(230, 204, 55, 0.55);
}

.brand-text h1 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.brand-text p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  color: var(--text-main);
  font-size: 1rem;
  cursor: pointer;
  background-color: rgba(10, 12, 20, 0.8);
}

.app-shell {
  display: grid;
  grid-template-columns: 270px 1fr;
  flex: 1;
  min-height: 0;
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.1rem 1.1rem 1.8rem;
  background: linear-gradient(180deg, rgba(10, 12, 20, 0.98), rgba(5, 6, 8, 0.98));
}

.sidebar h2 {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.sidebar-hint {
  margin-top: 0.8rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.nav-item-btn {
  width: 100%;
  text-align: left;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.55rem 0.8rem;
  background: rgba(17, 19, 26, 0.95);
  color: var(--text-main);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

.nav-item-btn span.label-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-item-btn span.label-main .pill {
  font-size: 0.66rem;
  border-radius: 999px;
  padding: 0.1rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--accent-strong);
}

.nav-item-btn .pill-right {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background-color: rgba(230, 204, 55, 0.13);
  color: var(--accent-strong);
}

.nav-item-btn:hover {
  background: rgba(25, 30, 48, 0.96);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.nav-item-btn.active {
  border-color: rgba(230, 204, 55, 0.7);
  box-shadow: 0 0 0 1px rgba(230, 204, 55, 0.65), var(--shadow-soft);
  background: radial-gradient(circle at 20% 0, rgba(230, 204, 55, 0.22), #11131a);
}

.nav-item-btn.dragging {
  opacity: 0.4;
}

.main-content {
  padding: 1.2rem 1.4rem 1.6rem;
  overflow-y: auto;
}

.card {
  background: radial-gradient(circle at top left, rgba(230, 204, 55, 0.04), rgba(12, 14, 24, 0.96));
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  padding: 1.4rem 1.5rem 1.6rem;
  box-shadow: var(--shadow-soft);
  max-width: 1040px;
  margin-inline: auto;
}

.card h2 {
  margin-top: 0;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

.card p {
  line-height: 1.6;
  color: var(--text-main);
}

.card p span.muted {
  color: var(--text-muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.3rem 0 0.9rem;
}

.tag {
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
}

.block-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: flex-start;
}

.block-column {
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  background-color: rgba(6, 8, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.block-column h3 {
  margin-top: 0;
  font-size: 1rem;
}

.block-column h4 {
  margin-bottom: 0.2rem;
  margin-top: 0.7rem;
  font-size: 0.9rem;
}

.block-column ul {
  margin: 0.25rem 0 0.5rem 1.1rem;
  padding: 0;
  color: var(--text-muted);
}

.block-column li {
  margin-bottom: 0.15rem;
}

.subtle-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.tree-container {
  border-radius: var(--radius-lg);
  padding: 0.8rem 1rem;
  background: radial-gradient(circle at top, rgba(230, 204, 55, 0.08), rgba(5, 7, 12, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
}

.tree-pill {
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
}

.tree-pill span.dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.tree-pill .dot.sumer {
  background: #6fc0ff;
}

.tree-pill .dot.genesis {
  background: #f4aaf4;
}

.tree-pill .dot.poso {
  background: #e6cc37;
}

.tree-diagram {
  width: 100%;
  max-height: 260px;
  overflow: auto;
}

.tree-diagram svg {
  width: 100%;
  min-width: 420px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background-color: rgba(230, 204, 55, 0.16);
  color: var(--accent-strong);
}

.syn-tools {
  margin-top: 1rem;
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  background-color: rgba(6, 8, 16, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.syn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.7rem;
}

.syn-col {
  border-radius: var(--radius-lg);
  padding: 0.7rem 0.9rem;
  background-color: rgba(10, 12, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.syn-col h4 {
  margin-top: 0;
  font-size: 0.92rem;
}

.select-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.4rem;
}

.select-row label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.select-row select {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background-color: rgba(5, 7, 14, 0.96);
  color: var(--text-main);
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

.module-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.4rem;
  margin: 0.6rem -0.3rem 0;
}

.module-card {
  min-width: 180px;
  max-width: 220px;
  border-radius: 16px;
  padding: 0.6rem 0.7rem;
  background-color: rgba(10, 12, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  cursor: grab;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
}

.module-card:active {
  cursor: grabbing;
}

.module-card.dragging {
  opacity: 0.4;
  transform: scale(0.98);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.module-card h4 {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
}

.module-card p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.module-card .status {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  background-color: rgba(230, 204, 55, 0.16);
  color: var(--accent-strong);
}

.hidden {
  display: none;
}

.app-footer {
  padding: 0.6rem 1.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 6, 8, 0.96);
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 3.1rem 0 auto;
    max-height: calc(100% - 3.1rem);
    transform: translateX(-100%);
    transition: transform var(--transition-med);
    z-index: 15;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .block-layout {
    grid-template-columns: 1fr;
  }

  .syn-grid {
    grid-template-columns: 1fr;
  }
}

/* Accordéon pour la lecture posœnnoïale */
#posoList {
  list-style: none;
  margin: 0;
  padding: 0;
}
#posoList .poso-item {
  margin-bottom: 0.35rem;
}
#posoList .poso-item details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.45rem 0.75rem;
  background: rgba(10, 12, 20, 0.85);
}
#posoList .poso-item summary {
  cursor: pointer;
  font-weight: 500;
}
#posoList .poso-item p {
  margin-top: 0.35rem;
  color: var(--text-muted);
}
#posoList .poso-separator h4 {
  margin: 0.8rem 0 0.35rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
}
#posoList .poso-item.secondary details {
  border-style: dashed;
  background: rgba(15, 18, 28, 0.95);
}

/* Sélection de modules dans l’Atlas */
.module-card.selected {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* Vue constellation de l’Atlas */
.atlas-constellation {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.constellation-hint {
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.constellation-svg {
  width: 100%;
  max-width: 340px;
  display: block;
  margin: 0 auto 0.75rem;
}

.constellation-link {
  stroke: var(--accent-soft);
  stroke-width: 1;
  opacity: 0.7;
  cursor: pointer;
}

.constellation-link:hover {
  opacity: 1;
}

.constellation-node circle {
  fill: var(--bg-elevated);
  stroke: var(--accent-strong);
  stroke-width: 1;
}

.constellation-node text {
  font-size: 0.7rem;
  text-anchor: middle;
  dominant-baseline: middle;
}

.constellation-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  font-size: 0.72rem;
}

.constellation-legend .node-dot {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--accent-strong);
  text-align: center;
  line-height: 1.1rem;
  margin-right: 0.25rem;
  font-size: 0.68rem;
}

/* Ajustements de lisibilité pour la constellation posœnnoïale – V13c */
.constellation-svg {
  width: 100%;
  max-width: 420px;
  display: block;
  margin: 0 auto 0.9rem;
}

.constellation-link {
  stroke: var(--accent-soft);
  stroke-width: 1.4;
  opacity: 0.75;
  cursor: pointer;
  transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

.constellation-link.major {
  stroke: var(--accent-strong);
  stroke-width: 1.8;
  opacity: 0.9;
}

.constellation-link:hover {
  opacity: 1;
  stroke-width: 2;
}

.constellation-node circle {
  fill: var(--bg-elevated);
  stroke: var(--accent-strong);
  stroke-width: 1.4;
  filter: drop-shadow(0 0 6px rgba(230, 204, 55, 0.55));
}

.constellation-node text {
  font-size: 0.78rem;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
}

.constellation-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  font-size: 0.74rem;
}

.constellation-legend .node-dot {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--accent-strong);
  text-align: center;
  line-height: 1.2rem;
  margin-right: 0.25rem;
  font-size: 0.7rem;
  background: rgba(230, 204, 55, 0.08);
}


/* Synchrêssion des yeux */
.synchression-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 0.75rem 0 1rem;
}

.synch-column label {
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.25rem;
  color: #9ca3af;
}

.synch-column select {
  width: 100%;
  padding: 0.3rem 0.4rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.8rem;
}

.synch-foyers {
  margin: 0.4rem 0 0.3rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.synch-list {
  list-style: disc;
  padding-left: 1.1rem;
  margin: 0;
  font-size: 0.78rem;
  color: #d1d5db;
}

.synch-poso {
  margin-top: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid #1f2937;
  background: #020617;
}

.synch-poso h3 {
  margin-top: 0;
  font-size: 0.9rem;
}

#synchPosoList {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0;
}

#synchPosoList li {
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
}

#synchPosoList details {
  background: #030712;
  border-radius: 0.5rem;
  padding: 0.25rem 0.45rem;
  border: 1px solid #1f2937;
}

#synchPosoList summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
}

#synchPosoList p {
  margin: 0.25rem 0 0.15rem;
  font-size: 0.76rem;
  color: #d1d5db;
}

.external-link-block{
 margin:0.85rem 0;
 text-align:center;
}
.external-link-btn{
 display:inline-block;
 padding:0.45rem 1rem;
 border:1px solid gold;
 border-radius:999px;
 color:gold;
 text-decoration:none;
 font-size:0.9rem;
}

.external-link-block{
  margin: 0.75rem 0 0.25rem;
  text-align: center;
}
.external-link-btn{
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.95);
  background: radial-gradient(circle at top left, rgba(252, 211, 77, 0.2), rgba(15, 23, 42, 1));
  color: #facc15;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35), 0 10px 22px rgba(15, 23, 42, 0.9);
}
.external-link-btn:hover{
  box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.2), 0 12px 26px rgba(15, 23, 42, 1);
  transform: translateY(-1px);
}

.site-footer{
  margin-top: 2rem;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: #cbd5e1;
  opacity: 0.75;
}


/* Icônes des yeux pour la Cartographie */
.eye-icon-circle {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  margin: 0 auto 12px auto;
  background: radial-gradient(circle at 20% 0, rgba(230, 204, 55, 0.36), #11131a);
  border: 1px solid rgba(230, 204, 55, 0.75);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
}

.eye-icon-img {
  max-width: 72%;
  max-height: 72%;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.75));
}



/* Cercle blanc autour des icônes */



/* Cercle blanc réduit et anneau doré vibrant autour des icônes */
.module-icon-circle{
  width:68px;
  height:68px;
  border-radius:50%;
  background:#ffffff;
  margin:0 auto 12px auto;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  box-shadow:0 6px 14px rgba(0,0,0,0.45);
}

.module-icon-circle::before{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:50%;
  border:2px solid var(--accent);
  box-shadow:0 0 12px rgba(230,204,55,0.65);
  opacity:0.9;
  animation:eyeRingPulse 2.8s ease-in-out infinite;
}

.module-icon{
  max-width:64%;
  max-height:64%;
  display:block;
}

@keyframes eyeRingPulse{
  0%{
    transform:scale(1);
    opacity:0.9;
    box-shadow:0 0 10px rgba(230,204,55,0.6);
  }
  50%{
    transform:scale(1.08);
    opacity:0.4;
    box-shadow:0 0 18px rgba(230,204,55,0.85);
  }
  100%{
    transform:scale(1);
    opacity:0.9;
    box-shadow:0 0 10px rgba(230,204,55,0.6);
  }
}
