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

.cf-code,
.cf-lines,
.cf-option pre {
  margin: 0;
  font: 0.92rem/1.55 var(--mono);
  tab-size: 4;
}

.cf-code {
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  white-space: pre;
}

/* Spot the bug: every line is a button, numbered. */
.cf-lines { list-style: none; padding: 6px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-x: auto; counter-reset: line; }
.cf-lines li { counter-increment: line; }
.cf-line {
  display: block;
  width: 100%;
  min-height: 1.9em;
  padding: 2px 12px 2px 3.2em;
  position: relative;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  white-space: pre;
  cursor: pointer;
}
.cf-line::before { content: counter(line); position: absolute; left: 0.8em; width: 1.6em; color: var(--muted); text-align: right; }
.cf-line:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, transparent); border-left-color: var(--accent); }
.cf-line:disabled { cursor: default; }
.cf-line.blank { cursor: default; }
.cf-line.tried { text-decoration: line-through; color: var(--muted); }
.cf-line.is-answer { background: var(--good-soft); border-left-color: var(--good); }
.cf-fix { margin: 8px 0 0; font-size: 0.9rem; }
.cf-fix code { font: 0.88rem var(--mono); padding: 1px 4px; border-radius: 4px; background: var(--good-soft); }

/* Trace and pick: options to choose. */
.cf-options { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.cf-options.trace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cf-option {
  display: grid;
  grid-template-columns: auto 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;
}
.cf-option pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.cf-letter { font: 700 0.85rem/1.6 system-ui, sans-serif; color: var(--muted); }
.cf-option:hover:not(:disabled) { border-color: var(--accent); }
.cf-option:disabled { cursor: default; }
.cf-option.tried { opacity: 0.6; }
.cf-option.tried pre { text-decoration: line-through; }
.cf-option.is-answer { border: 2px solid var(--good); background: var(--good-soft); opacity: 1; }
.cf-option.is-answer pre { text-decoration: none; }

@media (max-width: 480px) {
  .cf-options.trace { grid-template-columns: 1fr; }
  .cf-code, .cf-lines, .cf-option pre { font-size: 0.84rem; }
}
