/* Impedance Curves: its colours, schematic, impedance graph, probe and answer options; the general
   look is in ui.css (shared by the apps). */
:root {
  --zc: #1f5fc4;
  --tan: #d4620a;
  --grid: #ebe8e1;
  --grid-major: #d2cec4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --zc: #79a8ff;
    --tan: #ffa057;
    --grid: #2a2e33;
    --grid-major: #3d4248;
  }
}

#prompt { margin: 6px 0; }

/* circuit schematic */
svg text { font-family: var(--serif); font-size: 15px; }
svg .w { stroke: var(--ink); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
svg .c { stroke: var(--ink); stroke-width: 1.8; fill: var(--card); }
svg .coil { stroke: var(--ink); stroke-width: 1.8; fill: none; }
svg .mask { fill: var(--card); stroke: none; }
svg .dot { fill: var(--ink); }
svg .lbl { fill: var(--ink); }
svg .it { font-style: italic; }

/* impedance graph */
.gwrap { flex: 1 1 100%; touch-action: none; }
.zgraph { display: block; width: 100%; height: auto; }
.schematic { display: block; max-width: 100%; height: auto; }
svg .grid { stroke: var(--grid); stroke-width: 1; }
svg .grid.major { stroke: var(--grid-major); }
svg .frame { fill: none; stroke: var(--muted); stroke-width: 1.2; }
svg .tick { fill: var(--muted); font-size: 12px; font-family: system-ui, sans-serif; }
svg .axis { fill: var(--ink); font-size: 14px; }
svg .curve { stroke: var(--zc); stroke-width: 2.6; fill: none; stroke-linejoin: round; }
svg .aline { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 6 5; fill: none; opacity: 0.75; }
svg .atan, svg .ptan { stroke: var(--tan); stroke-width: 2; fill: none; }
svg .apt { fill: var(--tan); stroke: var(--card); stroke-width: 2; }
svg .ann .sub { font-size: 10px; }
svg .ann { fill: var(--ink); font-size: 13px; font-family: system-ui, sans-serif; font-weight: 600; paint-order: stroke; stroke: var(--card); stroke-width: 4px; }
svg .guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
svg .pdot { fill: var(--tan); stroke: var(--card); stroke-width: 2; }
svg .pin { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
svg .pin-n { fill: var(--accent); font-size: 11px; font-weight: 700; font-family: system-ui, sans-serif; }
.readout { display: flex; flex-wrap: wrap; gap: 4px 18px; min-height: 1.6em; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.readout .muted { color: var(--muted); font-size: 0.9rem; }
.pins { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.pins li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.pin-label { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border: 2px solid var(--accent); border-radius: 50%; color: var(--accent); font-weight: 700; font-size: 0.8rem; }
.unpin { padding: 0 8px; line-height: 1.4; }
.k-tan { color: var(--tan); font-weight: 600; }
.steps h4 { margin: 14px 0 2px; font-size: 1rem; }

/* answers: one row of options per unknown */
#fields { display: grid; gap: 12px; margin-bottom: 14px; }
.field { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); align-items: center; gap: 6px 8px; }
.field .sym { text-align: right; }
.field .fb { grid-column: 2; font-size: 0.9rem; }
.field .fb:empty { display: none; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts label { position: relative; }
.opts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opts span {
  display: block;
  min-width: 6.5em;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.opts label:hover span { border-color: var(--accent); }
.opts input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.opts input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.field.ok input:checked + span { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.field.bad input:checked + span { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
#hint-list ul { margin: 4px 0; padding-left: 1.2em; }
#hint-list ul li { margin: 6px 0; }

@media (max-width: 600px) {
  svg .tick { font-size: 15px; }
  svg .axis { font-size: 17px; }
  svg .ann { font-size: 15px; }
}
@media (max-width: 560px) {
  .opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opts span { min-width: 0; padding-inline: 8px; }
  .field .sym { grid-column: auto; text-align: right; margin-top: 0; }
}

/* arcade: the curve in manim's blue, the tangent in its gold */
#arcade { --zc: #58c4dd; --tan: #f0ac5f; --grid: #1c1c1c; --grid-major: #333; }
#arcade .ar-opt { font-size: 1.2rem; }
