/* Neuroplasticity Simulator — native Edground layout */

.neuro-page {
  display: grid;
  gap: 18px;
}

.neuro-shell {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.neuro-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) 1fr;
  gap: 20px;
  align-items: start;
}

.neuro-control-panel {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
  padding: 20px;
}

.neuro-control-panel h2,
.neuro-stage-header h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.neuro-stage-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.neuro-button-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.neuro-button-stack button {
  width: 100%;
  min-height: 44px;
}

.neuro-mini-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.neuro-mini-section h3 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.neuro-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.neuro-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 0.86rem;
  color: var(--muted);
}

.dot,
.line {
  flex-shrink: 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.line {
  width: 16px;
  height: 3px;
  border-radius: 3px;
}

.dot.neuron { background: #22dffa; }
.dot.neuron-new { background: #ff7a3d; }
.dot.frontal { background: #b89aff; }
.dot.parietal { background: #ff90b8; }
.dot.temporal { background: #7adba0; }
.dot.occipital { background: #8ab8ff; }
.dot.hippocampus { background: #ffc97a; }

.line.synapse { background: #26c6e6; }
.line.spine { background: #ffd24c; }
.line.active { background: #ff3b30; }

.neuro-log-entries {
  height: 165px;
  max-height: 165px;
  min-height: 165px;
  overflow-y: auto;
  padding-right: 4px;
}

.neuro-log-entries .entry {
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.neuro-log-entries .entry.learn { color: #cf5b24; }
.neuro-log-entries .entry.practice { color: #0d84a0; }
.neuro-log-entries .entry.fire { color: #a87500; }
.neuro-log-entries .entry.neglect { color: #5f6a80; }

.neuro-stage-panel {
  min-height: min(76vh, 860px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 9%, var(--panel)) 0%, var(--panel) 56%),
    var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line-strong));
  backdrop-filter: blur(10px);
}

.neuro-stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.neuro-stage-header__copy {
  max-width: 58ch;
}

.neuro-stage-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.neuro-stat-chip {
  background: rgba(8, 14, 30, 0.72);
  border: 1px solid rgba(143, 194, 255, 0.24);
  border-radius: 10px;
  padding: 6px 10px;
  min-width: 102px;
  backdrop-filter: blur(4px);
}

.neuro-stat-chip strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1;
  color: #eaf8ff;
}

.neuro-stat-chip span {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #adcde3;
}

.neuro-stat-chip--wide {
  grid-column: 1 / -1;
}

.neuro-stat-chip--neurons strong { color: #22dffa; }
.neuro-stat-chip--synapses strong { color: #ff4b40; }
.neuro-stat-chip--spines strong { color: #ffd24c; }

.neuro-stage-stats--overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 26;
}

.neuro-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: min(64vh, 700px);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #89a8ff 24%, transparent);
  background:
    radial-gradient(circle at 24% 20%, rgba(142, 92, 255, 0.16), transparent 52%),
    radial-gradient(circle at 78% 74%, rgba(67, 170, 255, 0.12), transparent 56%),
    linear-gradient(155deg, #10172d 0%, #0c1326 48%, #0a1020 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 80px rgba(80, 120, 255, 0.06);
}

#neuroCanvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#neuroCanvas.dragging {
  cursor: grabbing;
}

.hippo-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: hidden;
}

.floater {
  position: absolute;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 20px;
  white-space: nowrap;
  animation: neuroFloatUp 2.6s ease-out forwards;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

@keyframes neuroFloatUp {
  0% { opacity: 0; transform: translateY(0) scale(0.84); }
  12% { opacity: 1; transform: translateY(-12px) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-76px) scale(0.95); }
}

.neuro-zoom-controls {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  gap: 8px;
  z-index: 25;
}

.neuro-zoom-controls button {
  min-width: 44px;
}

.neuro-log--model {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.neuro-log--model h3 {
  margin-bottom: 8px;
}

.neuro-resources {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  max-width: 760px;
}

.neuro-resources h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.neuro-resources p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.neuro-resources__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.neuro-resources__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.neuro-control-panel .neuro-resources--embedded {
  margin-top: 16px;
  max-width: none;
  box-shadow: none;
  padding: 14px 0 0;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.neuro-control-panel .neuro-resources--embedded h3 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.neuro-control-panel .neuro-resources--embedded p {
  margin: 0 0 10px;
  font-size: 0.85rem;
}

.neuro-control-panel .neuro-resources--embedded .neuro-resources__links a {
  text-decoration: none;
}

.neuro-control-panel .neuro-resources--embedded .neuro-resources__links .primary {
  box-shadow: 0 1px 2px rgba(91, 33, 182, 0.2);
}

.neuro-collapsible {
  cursor: default;
}

.neuro-collapsible > summary {
  list-style: none;
  cursor: pointer;
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 600;
}

.neuro-collapsible > summary::-webkit-details-marker {
  display: none;
}

.neuro-collapsible > summary::after {
  content: "▾";
  float: right;
  transition: transform 0.15s ease;
}

.neuro-collapsible:not([open]) > summary::after {
  transform: rotate(-90deg);
}

@media (max-width: 980px) {
  .neuro-layout {
    grid-template-columns: 1fr;
  }

  .neuro-control-panel {
    position: static;
  }

  .neuro-button-stack {
    grid-template-columns: 1fr;
  }

  .neuro-stage-header {
    flex-direction: column;
  }

  .neuro-stage-stats--overlay {
    top: 10px;
    right: 10px;
  }

  .neuro-stage-panel {
    min-height: 70vh;
  }

  .neuro-log-entries {
    height: 150px;
    max-height: 150px;
    min-height: 150px;
  }
}
