/* Cluster lab. The palette, buttons, panels and the how-it-works section come from style.css and app.css;
   this file only styles the plot frame, the chart boxes and the preset chips. */

/* Buttons and panels set their own display, which would override the hidden attribute. */
[hidden] { display: none !important; }

.cl-stage { display: flex; flex-direction: column; align-items: center; gap: 1rem; width: 100%; }

/* The plot sits in a neon frame with a faint scanline overlay, like the maze pages. */
.cl-frame {
  position: relative;
  box-sizing: border-box;
  padding: 10px;
  width: min(100%, 580px);  /* the canvas fills the frame; an auto width would shrink to the canvas's default size */
  border: 1px solid var(--cyan);
  border-radius: 6px;
  background: radial-gradient(ellipse at center, rgba(0, 245, 255, 0.07), #020610 70%);
  box-shadow: 0 0 22px rgba(0, 245, 255, 0.35), 0 0 60px rgba(155, 0, 255, 0.2),
              inset 0 0 30px rgba(0, 245, 255, 0.08);
}
.cl-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 4px;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px);
}
#cl-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  touch-action: none;   /* the spray brush and centroid drags own the pointer */
  cursor: crosshair;
  border-radius: 4px;
}
.cl-controls .cyber-btn { min-width: 8.5rem; }

.cl-phase {
  font-family: var(--orb);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
  min-height: 1.2em;
  text-align: center;
}

.cl-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.cl-presets .cyber-btn { width: 100%; padding: 0.4rem 0.2rem; min-width: 0; }
.cl-presets .cyber-btn.is-on { background: rgba(0, 245, 255, 0.12); box-shadow: 0 0 14px rgba(0, 245, 255, 0.45); }

.cl-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.4rem; }
.cl-chart-box { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.cl-chart { width: 100%; height: 170px; display: block; border: 1px solid rgba(0, 245, 255, 0.2); background: rgba(2, 6, 16, 0.7); }

.cl-readouts { display: flex; flex-direction: column; gap: 0.5rem; }
.cl-table td { font-family: var(--mono); font-size: 0.8rem; }
.cl-table td.num { text-align: right; color: var(--yellow); }
.cl-table tr.is-live td.num { color: var(--green); }

@media (max-width: 900px) {
  .cl-charts { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cl-controls .cyber-btn { min-width: 0; flex: 1 1 40%; }
  .cl-frame { padding: 6px; }
  .cl-frame::after { inset: 6px; }
  .cl-chart { height: 150px; }
}
