/* Optimizer race page. The palette, buttons, panels and the log come from style.css and app.css; this file
   styles the landscape frame, the optimizer rows and the chart. */

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

.ol-stage { display: flex; flex-direction: column; gap: 0.7rem; width: 100%; min-width: 0; }
.ol-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.ol-hint { font-family: var(--raj); font-size: 0.85rem; color: var(--dim); }
.ol-controls { justify-content: center; }
.ol-controls .cyber-btn { min-width: 8.5rem; }

/* The landscape sits in a neon frame, like the Pac-Man maze. The canvas height follows the surface's aspect. */
.ol-frame {
  position: relative;
  padding: 8px;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  background: radial-gradient(ellipse at center, rgba(0, 245, 255, 0.07), #020610 75%);
  box-shadow: 0 0 22px rgba(0, 245, 255, 0.3), 0 0 60px rgba(155, 0, 255, 0.18), inset 0 0 30px rgba(0, 245, 255, 0.06);
}
#ol-canvas { display: block; width: 100%; height: auto; touch-action: manipulation; cursor: crosshair; }
.ol-readout {
  position: absolute;
  left: 14px;
  bottom: 12px;
  max-width: calc(100% - 28px);
  padding: 0.2rem 0.45rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--cyan);
  background: rgba(2, 6, 16, 0.78);
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.ol-chart-wrap { margin-top: 1.4rem; }
.ol-chart-panel { padding: 0.5rem; }
#ol-chart { width: 100%; height: 180px; display: block; }
.ol-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-family: var(--mono); font-size: 0.66rem; color: var(--dim); }
.ol-legend span { display: inline-flex; align-items: center; gap: 0.3rem; }

/* Optimizer rows: swatch, name, a learning-rate slider on a log scale, and the state badge. */
.ol-opts-panel { gap: 0.6rem; }
.ol-shared-row { font-family: var(--mono); font-size: 0.72rem; color: var(--text); display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.ol-shared-row input { accent-color: var(--green); }
.ol-opt { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.5rem; align-items: center; padding: 0.45rem 0; border-top: 1px solid rgba(0, 245, 255, 0.1); }
.ol-opt:first-of-type { border-top: 0; }
.ol-opt-name { display: flex; align-items: center; gap: 0.45rem; font-family: var(--orb); font-size: 0.62rem; letter-spacing: 0.06em; cursor: pointer; min-width: 0; }
.ol-opt-name input { accent-color: var(--cyan); }
.ol-sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 8px currentColor; flex: 0 0 auto; }
.ol-opt-lr { grid-column: 1 / 2; display: flex; align-items: center; gap: 0.5rem; }
.ol-opt-lr input { flex: 1; min-width: 0; }
.ol-lr-val { font-family: var(--mono); font-size: 0.66rem; color: var(--text); min-width: 3.6rem; text-align: right; }
.ol-opt.off .ol-opt-lr { opacity: 0.35; }
.ol-shared .ol-opt-lr input { pointer-events: none; opacity: 0.35; }
.ol-shared-lr { margin-bottom: 0.2rem; }

.ol-badge {
  grid-column: 2 / 3;
  grid-row: 1;
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  padding: 0.12rem 0.38rem;
  border: 1px solid var(--dim);
  color: var(--dim);
  white-space: nowrap;
}
.ol-badge.run { border-color: var(--cyan); color: var(--cyan); }
.ol-badge.ok { border-color: var(--green); color: var(--green); box-shadow: 0 0 10px rgba(0, 255, 136, 0.35); }
.ol-badge.boom { border-color: var(--pink); color: var(--pink); box-shadow: 0 0 12px rgba(255, 0, 160, 0.5); animation: ol-blink 0.9s steps(2, start) infinite; }
@keyframes ol-blink { to { visibility: hidden; } }

.ol-hyper { gap: 0.55rem; }
.ol-slider { display: flex; flex-direction: column; gap: 0.2rem; }
.ol-slider .field-lbl { margin-bottom: 0; }
.ol-slider .field-hint { font-variant-numeric: tabular-nums; }
.ol-slider input[type=range] { width: 100%; }
.ol-card { margin-top: 0.5rem; padding: 0.6rem; }
.ol-paint { gap: 0.6rem; flex-wrap: wrap; }
.ol-radio { font-family: var(--mono); font-size: 0.7rem; color: var(--text); display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.ol-radio input { accent-color: var(--pink); }

/* Stacks the controls and the frame on phones; the stats chips wrap. */
@media (max-width: 600px) {
  .ol-frame { padding: 5px; }
  .ol-controls .cyber-btn { min-width: 0; flex: 1 1 30%; padding-left: 0.6rem; padding-right: 0.6rem; white-space: nowrap; }
  .ol-readout { font-size: 0.58rem; left: 8px; bottom: 8px; }
  #ol-chart { height: 150px; }
  .ol-hint { font-size: 0.78rem; }
}
