/* main_bandit_race.css — tool-only styles. Anything reusable belongs in shared/css. */

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.75rem;
}

@media (max-width: 860px) {
  .setup-grid { grid-template-columns: 1fr; }
}

.setup-col h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.setup-col h3 + .hint { margin-top: 0; }

/* ----------------------------------------------------------------- arms table */

.arms-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 0.75rem;
}

.arms-table th,
.arms-table td {
  text-align: left;
  padding: 0.4rem 0.5rem 0.4rem 0;
  border-bottom: 1px solid var(--border-color, #e3e8ef);
  vertical-align: middle;
}

.arms-table input[type="text"] { width: 100%; }

.arm-rate {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.arm-rate input[type="range"] { flex: 1 1 auto; min-width: 70px; }
.arm-rate input[type="number"] { width: 5.5rem; flex: 0 0 auto; }
.arm-rate .pct { color: var(--muted-color, #667085); }

/* A masked rate still occupies its slot, so turning "Hide the truth" on and off does
   not make the table jump. */
.arm-rate.is-hidden input { visibility: hidden; }

.arm-rate .masked {
  position: absolute;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  color: var(--muted-color, #667085);
}

.arm-rate { position: relative; }

.arms-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.4rem 0;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-row input { margin-top: 0.2rem; flex: 0 0 auto; }

/* --------------------------------------------------------------------- run row */

.run-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #e3e8ef);
}

.run-status { color: var(--muted-color, #667085); }
.run-status.is-error { color: var(--danger-color, #b42318); font-weight: 600; }

/* --------------------------------------------------------------------- results */

.chart { width: 100%; min-height: 340px; }

.chart-note {
  margin: 0.6rem 0 0;
  color: var(--muted-color, #667085);
  font-size: 0.92rem;
}

.scoreboard,
.learning-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.scoreboard th,
.scoreboard td,
.learning-table th,
.learning-table td {
  text-align: left;
  padding: 0.45rem 0.65rem 0.45rem 0;
  border-bottom: 1px solid var(--border-color, #e3e8ef);
}

.scoreboard td.num,
.learning-table td.num {
  font-variant-numeric: tabular-nums;
}

.scoreboard tr.is-winner td { background: rgba(16, 185, 129, 0.08); }

.pick-yes { color: var(--success-color, #067647); font-weight: 600; }
.pick-no { color: var(--danger-color, #b42318); font-weight: 600; }

/* The whole point of the learning table: a barely-sampled option has a wide bar. */
.interval-bar {
  position: relative;
  height: 0.55rem;
  min-width: 110px;
  background: var(--surface-alt, #f2f4f7);
  border-radius: 999px;
  overflow: hidden;
}

.interval-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--accent-color, #3b82f6);
  border-radius: 999px;
}

.learning-table tr.is-sparse .interval-bar span { background: var(--warning-color, #d97706); }

.interval-label {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--muted-color, #667085);
  margin-top: 0.15rem;
}

.contestant-name { font-weight: 600; }

.learning-table td[rowspan] {
  border-bottom: 1px solid var(--border-color, #e3e8ef);
  vertical-align: top;
}

/* ----------------------------------------------------------------- diagnostics */

.diagnostic {
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color, #e3e8ef);
}

.diagnostic:last-child { border-bottom: 0; }
.diagnostic__icon { flex: 0 0 auto; }
.diagnostic__body { flex: 1 1 auto; }
.diagnostic__body strong { display: block; }

.diagnostic__body p {
  margin: 0.2rem 0 0;
  color: var(--muted-color, #667085);
}

.epsilon-row {
  margin: 0.25rem 0 0.5rem 1.6rem;
}

.epsilon-row label {
  display: block;
  font-size: 0.92rem;
  color: var(--muted-color, #667085);
}

.advanced-settings {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color, #e3e8ef);
}

.advanced-settings summary {
  cursor: pointer;
  font-weight: 600;
}

/* --------------------------------------------------------- allocation panels */

.allocation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.allocation-panel h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.allocation-plot { width: 100%; }

/* ---------------------------------------------------------------- teaching scaffold
   These classes are the house pattern used by the other concept labs (threshold lab,
   response model lab). Only `.interpretation-aid` is defined in main.css; the rest are
   tool-local by convention, so they are defined here rather than assumed. */

.act-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 0.6rem;
  vertical-align: middle;
}

.act-narrative {
  font-size: 0.94rem;
  color: #4b5563;
  line-height: 1.65;
  margin: 0 0 1rem;
  max-width: 760px;
}

.chart-explainer {
  font-size: 0.9rem;
  color: var(--app-muted, #5f6b7a);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.run-heading {
  display: flex;
  align-items: center;
  margin-top: 1.75rem;
}

/* The "how many times" select sits beside the run buttons rather than above them, so the
   choice reads as part of the action instead of as another setting to configure. */
.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--app-muted, #5f6b7a);
}

.inline-field select { margin: 0; }

.callout-box {
  border-left: 4px solid #d1d5db;
  background: #f9fafb;
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.callout-box p { margin: 0 0 0.5rem; }
.callout-box ol, .callout-box ul { margin: 0; padding-left: 1.3rem; }
.callout-box li { margin-bottom: 0.4rem; }

.callout-amber {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.exploratory-questions {
  margin: 0;
  padding-left: 1.4rem;
  line-height: 1.65;
}

.exploratory-questions li { margin-bottom: 0.85rem; }

@media print {
  .run-row, .arms-actions, .professor-mode-toggle { display: none; }
}
