/* Life Graph — cinematic network viz (mobile + web) */

.life-graph-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.life-graph-stage-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(201, 168, 76, 0.12), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(107, 154, 196, 0.1), transparent 45%),
    linear-gradient(165deg, #141820 0%, #1a1f2a 55%, #12151c 100%);
  min-height: 320px;
  touch-action: none;
  user-select: none;
}

.life-graph-stage {
  width: 100%;
  height: 360px;
  cursor: grab;
  transform-origin: center center;
  transition: transform 0.05s linear;
}

.life-graph-stage.is-panning {
  cursor: grabbing;
}

.life-graph-stage svg {
  width: 100%;
  height: 100%;
  display: block;
}

.life-graph-edge {
  stroke: rgba(201, 168, 76, 0.28);
  fill: none;
  animation: lg-edge-fade 1.2s ease both;
}

.life-graph-node {
  cursor: pointer;
  animation: lg-node-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.life-graph-node circle {
  transition: r 0.2s ease, filter 0.2s ease;
  filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.35));
}

.life-graph-node:hover circle,
.life-graph-node:focus circle {
  filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.65));
}

.life-graph-node text {
  fill: rgba(244, 239, 230, 0.92);
  font-size: 10px;
  pointer-events: none;
  text-anchor: middle;
}

.life-graph-controls {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.life-graph-controls button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(201, 168, 76, 0.35);
  background: rgba(20, 24, 32, 0.85);
  color: #f4efe6;
  font-size: 16px;
  cursor: pointer;
}

.life-graph-controls button:hover {
  border-color: #c9a84c;
}

.life-graph-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  gap: 4px;
}

.life-graph-heat-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(107, 154, 196, 0.15);
  title: '';
}

.life-graph-heat-cell[data-band='sparse'] {
  background: rgba(107, 154, 196, 0.2);
}
.life-graph-heat-cell[data-band='cool'] {
  background: rgba(107, 154, 196, 0.45);
}
.life-graph-heat-cell[data-band='warm'] {
  background: rgba(143, 188, 143, 0.55);
}
.life-graph-heat-cell[data-band='hot'] {
  background: rgba(201, 168, 76, 0.75);
}

.life-graph-arc {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  padding: 8px 0;
}

.life-graph-arc-bar {
  flex: 1;
  min-width: 4px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #c9a84c, #6b9ac4);
  opacity: 0.85;
  transition: height 0.4s ease;
}

.life-graph-chapter-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.life-graph-chapter-chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 76, 0.3);
  background: rgba(201, 168, 76, 0.08);
  font-size: 12px;
  color: #f4efe6;
  white-space: nowrap;
}

.life-graph-forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.life-graph-forecast article {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.life-graph-forecast h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #c9a84c;
}

.life-graph-forecast p {
  margin: 0;
  font-size: 12px;
  color: rgba(244, 239, 230, 0.75);
  line-height: 1.4;
}

.life-graph-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@keyframes lg-node-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes lg-edge-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .life-graph-stage {
    height: 280px;
  }

  .life-graph-stage-wrap {
    min-height: 280px;
  }

  .life-graph-node text {
    font-size: 9px;
  }
}
