/* EpsilonFables: the styles this game adds to FablesCore. */

.ep-title { margin: 0 0 8px; font-weight: 600; }
.ep-note { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }
.ep-prompt { margin: 14px 0 0; font-weight: 600; }

/* Code: one or two lines of Python or NumPy. */
.ep-code {
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font: 0.92rem/1.55 var(--mono);
  white-space: pre;
}

/* Matrices: small grids with brackets, readable on a phone. */
.ep-matrices { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 4px 0; }
.ep-matrix { display: flex; align-items: center; gap: 8px; margin: 0; }
.ep-name { font: italic 600 1.05rem var(--serif); }
.ep-grid {
  border-collapse: separate;
  border-spacing: 0;
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  border-radius: 6px;
  padding: 2px 4px;
  font: 0.95rem/1.35 var(--mono);
}
.ep-grid td { padding: 3px 9px; text-align: right; white-space: nowrap; }

/* An iteration's first steps. */
.ep-iterates { margin: 10px 0 0; border-collapse: collapse; font: 0.88rem/1.4 var(--mono); }
.ep-iterates th, .ep-iterates td { padding: 3px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.ep-iterates thead th { color: var(--muted); font-weight: 600; }

/* Choices. */
.ep-options { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.ep-options.ep-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ep-options.ep-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ep-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ep-option:hover:not(:disabled) { border-color: var(--accent); }
.ep-option:disabled { cursor: default; }
.ep-option.tried { opacity: 0.6; text-decoration: line-through; }
.ep-option.is-answer { border: 2px solid var(--good); background: var(--good-soft); opacity: 1; text-decoration: none; }
.ep-choice-label { font-weight: 600; }
.ep-choice-code { margin: 0; font: 0.85rem/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Error sparklines: log10 of the measured error, step by step. */
.ep-spark { display: block; width: 100%; max-width: 160px; height: auto; }
.ep-spark .ep-axis { stroke: var(--line); stroke-width: 1.5; }
.ep-spark .ep-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Tap in order. */
.ep-order-list { display: grid; gap: 8px; margin: 12px 0 8px; padding: 0; list-style: none; }
.ep-snippet {
  display: grid; grid-template-columns: 2em 1fr; gap: 10px; align-items: start;
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.ep-snippet pre { margin: 6px 0 0; font: 0.82rem/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.ep-place { display: grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 50%; border: 2px solid var(--accent); font-weight: 700; }
.ep-snippet.placed { border-color: var(--accent); }
.ep-snippet.placed .ep-place { background: var(--accent); color: var(--paper); }
.ep-snippet:disabled { cursor: default; }

@media (max-width: 480px) {
  .ep-options.ep-pair { grid-template-columns: 1fr; }
  .ep-code, .ep-choice-code { font-size: 0.82rem; }
  .ep-grid { font-size: 0.86rem; }
  .ep-grid td { padding: 3px 6px; }
}
