/* A one-column grid: the start gate shares the canvas's cell, so it
 * covers exactly the canvas, and the HUD and status follow below. */
.gpu-graph {
  display: grid;
  margin: 1.5rem 0 2rem;
  border-radius: 14px;
  overflow: hidden;
  background: var(--demo-bg, #191919);
  color: var(--demo-fg, #e8e8e8);
}

.gpu-graph canvas,
.gpu-graph-gate {
  grid-area: 1 / 1;
}

.gpu-graph canvas {
  display: block;
  align-self: start;
  width: 100%;
  aspect-ratio: 16 / 10;
  cursor: grab;
  touch-action: none;
}

.gpu-graph canvas:active {
  cursor: grabbing;
}

.gpu-graph-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 1.25rem 1rem;
  font-size: 0.85rem;
}

.gpu-graph-hud strong {
  font-family: var(--bs-font-monospace, monospace);
  color: var(--demo-accent, #fbbf24);
}

/* Fixed widths for the live readouts, sized for their longest values
 * ("1,000,000", a three-digit fps, "Multi-wave → Ripple"), so the
 * slider beside them never resizes mid-drag. */
.gpu-graph-hud [data-readout] {
  display: inline-block;
  text-align: right;
}

.gpu-graph-hud [data-readout="count"] { min-width: 9ch; }
.gpu-graph-hud [data-readout="fps"] { min-width: 3ch; }
.gpu-graph-hud [data-readout="function"] {
  min-width: 20ch;
  text-align: left;
}

.gpu-graph-hud label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 14rem;
}

.gpu-graph-hud input[type="range"] {
  flex: 1;
  accent-color: var(--demo-accent, #fbbf24);
}

.gpu-graph-status {
  padding: 0 1.25rem 1rem;
  font-size: 0.8rem;
  color: var(--demo-muted, #aaa);
}

.gpu-graph-status:empty {
  display: none;
}

/* Covers the canvas until the reader starts the demo. */
.gpu-graph-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem;
  text-align: center;
  background: radial-gradient(circle at 50% 45%, var(--demo-glow, rgba(251, 191, 36, 0.08)), transparent 60%);
}

.gpu-graph-gate p {
  max-width: 32rem;
  margin: 0;
  color: var(--demo-muted, #aaa);
  font-size: 0.95rem;
}

.gpu-graph-gate strong {
  color: var(--demo-fg, #e8e8e8);
}

.gpu-graph-gate button {
  padding: 0.5rem 1.4rem;
  border: 1px solid var(--demo-accent, #fbbf24);
  border-radius: 999px;
  background: var(--demo-accent-soft, rgba(251, 191, 36, 0.12));
  color: var(--demo-accent, #fbbf24);
  font-weight: 600;
  cursor: pointer;
}

.gpu-graph-gate button:hover {
  background: var(--demo-accent-hover, rgba(251, 191, 36, 0.24));
}

/* Small screens: tighten the warning so it fits inside the canvas. */
@media (max-width: 576px) {
  .gpu-graph-gate {
    gap: 0.6rem;
    padding: 0.75rem 1rem;
  }

  .gpu-graph-gate p {
    font-size: 0.78rem;
  }

  .gpu-graph-gate button {
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
  }
}
