/* Light and optics games (SNC2D): ray diagrams, single-ray builders, spectrum order, decimal number pad. */
.op-q { color: var(--ink) !important; font-size: 1.12rem !important; line-height: 1.45; }
.op-q small { color: var(--muted); font-size: .9rem; }
.qcard .op-svg, .qcard .op-wave { display: block; width: 100%; max-width: 380px; height: auto; margin: 10px auto 0; }
.op-given { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.op-given span { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; background: var(--bg); color: var(--muted); font-size: .95rem; }
.op-given b { color: var(--ink); }
.op-eq { font-weight: 700; color: var(--ink); margin-top: 8px; font-size: 1.05rem; }
.op-sign { font-size: .85rem; color: var(--muted); margin-top: 6px; }

/* Long text answers: smaller type than the chemistry games' short answers. */
.op-page .choice { font-size: 1rem; line-height: 1.3; min-height: 64px; padding: 12px 10px; }
.op-page .choices.two .choice { font-size: 1.15rem; min-height: 88px; }

.op-box { text-align: left; }
.op-stage { margin: 4px auto 0; max-width: 420px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); overflow: hidden; }
.op-svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.op-box.locked .op-svg { cursor: default; }
.op-axis { stroke: var(--muted); stroke-width: 1; opacity: .7; }
.op-floor { stroke: var(--line); stroke-width: 2; }
.op-dev { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.op-back { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 2 4; }
.op-hatch { stroke: var(--muted); stroke-width: 1; }
.op-lens { fill: rgba(120, 170, 220, .18); stroke: #7fb0de; stroke-width: 2; }
.op-plane { stroke: #7fb0de; stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.op-pt { fill: var(--ink); }
.op-ptl { fill: var(--muted); font: 600 13px 'IBM Plex Sans', sans-serif; }
.op-obj-l { stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.op-obj-h { fill: var(--accent); }
.op-img-l { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-dasharray: none; }
.op-img-h { fill: var(--ink); }
.op-gimg-l { stroke: var(--good); stroke-width: 3; stroke-linecap: round; }
.op-gimg-h { fill: var(--good); }
.op-in { stroke-width: 2.2; fill: none; }
.op-chev { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.op-out { stroke-width: 2.2; }
.op-out.sel { stroke-width: 3; }
.op-ext { stroke-width: 1.4; stroke-dasharray: 5 4; opacity: .8; }
.op-hit { fill: var(--card); stroke-width: 2.5; }
.op-normal { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; }
.op-good { stroke: var(--good); stroke-width: 2.4; stroke-dasharray: 8 5; }
.op-good.ext { stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .85; }
.op-med { fill: rgba(127, 176, 222, .07); }
.op-med.top { fill: transparent; }
.op-med.dense { fill: rgba(127, 176, 222, .2); }
.op-bound { stroke: #7fb0de; stroke-width: 2; }
.op-ml { fill: var(--muted); font: 600 13px 'IBM Plex Sans', sans-serif; }
.op-ml.strong { fill: var(--ink); }
.op-wl { fill: none; stroke: #4fb0d8; stroke-width: 2.5; }
.op-wl.b { stroke: #e3a13b; }
/* Marked parts are orange, not red, so they never look like the red object arrow (and red–green colour-blind students can tell them apart). */
.op-mark { stroke: var(--op-mark, #f08c00); stroke-width: 3.5; stroke-linecap: round; }
.op-markc { fill: none; stroke: var(--op-mark, #f08c00); stroke-width: 3.5; }
.op-arc { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.op-hl { stroke: var(--op-mark, #f08c00) !important; stroke-width: 5 !important; stroke-dasharray: none !important; }
circle.op-hl { fill: var(--op-mark, #f08c00); }
.op-plain { stroke: var(--ink); }
/* Law of reflection pictures: the given angle in red with its value, the unknown as a grey "?" */
.op-ang-g { fill: none; stroke: var(--op-red, #e03131); stroke-width: 3; }
.op-ang-gt { fill: var(--op-red, #e03131); font: 700 15px 'IBM Plex Sans', sans-serif; }
.op-ang-q { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 4 3; }
.op-ang-qt { fill: var(--muted); font: 700 15px 'IBM Plex Sans', sans-serif; }
.op-ang-gt, .op-ang-qt { paint-order: stroke; stroke: var(--card); stroke-width: 5px; stroke-linejoin: round; }

.op-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.op-chip { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; min-height: 40px; padding: 0 12px; font: inherit; font-size: .9rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.op-chip i { width: 14px; height: 4px; border-radius: 2px; background: var(--rc, var(--ink)); }
.op-chip.img i { width: 4px; height: 14px; }
.op-chip.on { border-color: var(--rc, var(--ink)); box-shadow: 0 0 0 1.5px var(--rc, var(--ink)) inset; }
.op-chip.done::after { content: '✓'; color: var(--muted); font-size: .85rem; }
.op-read { text-align: center; color: var(--muted); font-size: .92rem; min-height: 1.4em; margin: 6px 0 2px; }
.op-read b { color: var(--ink); font-variant-numeric: tabular-nums; }
.op-row { display: flex; justify-content: center; margin: 4px 0; }
.op-tog { border: 1.5px dashed var(--line); background: transparent; color: var(--muted); border-radius: 10px; min-height: 38px; padding: 0 12px; font: inherit; font-size: .88rem; font-weight: 600; }
.op-tog.on { color: var(--ink); border-color: var(--muted); }

.op-saltbox { margin-top: 10px; display: grid; gap: 8px; }
.op-sl { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: start; }
.op-sk { color: var(--muted); font-size: .9rem; padding-top: 9px; }
.op-sk b { color: var(--accent); font-size: 1.05rem; }
.op-salt { display: flex; flex-wrap: wrap; gap: 6px; }
.op-salt button { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; min-height: 40px; padding: 4px 10px; font: inherit; font-size: .9rem; font-weight: 600; text-align: left; }
.op-salt button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.op-salt button.right { outline: 3px solid var(--good); outline-offset: 2px; }
@media (max-width: 420px) { .op-sl { grid-template-columns: 1fr; gap: 4px; } .op-sk { padding-top: 0; } }

/* Spectrum order */
.op-axislbl { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; font-weight: 600; margin: 0 2px 6px; }
.op-axislbl span:last-child::after { content: ' →'; }
.op-slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.op-slot { width: 100%; min-height: 64px; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: .78rem; font-weight: 700; padding: 2px; line-height: 1.15; word-break: break-word; }
.op-slot em { font-style: normal; color: var(--muted); opacity: .6; font-weight: 600; }
.op-slot.full { border-style: solid; background: var(--card); }
.op-slot.right { border-color: var(--good); }
.op-slot.wrong { border-color: var(--bad); }
.op-pool { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.op-tile { border: 0; border-radius: 10px; min-height: 44px; padding: 0 12px; background: var(--multi); color: #fff; font: inherit; font-weight: 700; font-size: .95rem; }
.op-tile:disabled { opacity: .25; }
.op-tip { color: var(--muted); font-size: .85rem; text-align: center; margin: 8px 0 0; }
@media (max-width: 520px) {
  .op-slots { grid-template-columns: 1fr; }
  .op-slot { min-height: 40px; font-size: .95rem; text-align: left; padding: 6px 12px; }
  .op-axislbl { flex-direction: column; }
  .op-axislbl span:first-child::after { content: ' (top)'; }
  .op-axislbl span:last-child::after { content: ' (bottom) ↓'; }
}

/* Number pad with decimals */
.op-num { display: flex; justify-content: center; align-items: baseline; gap: 8px; }
.op-numv { min-width: 150px; text-align: center; font-size: 2rem; font-weight: 800; min-height: 1.5em; border-bottom: 3px solid var(--line); font-variant-numeric: tabular-nums; }
.op-unit { color: var(--muted); font-weight: 700; font-size: 1.1rem; }
.op-pad .key.wide { grid-column: span 3; }
/* Partial reflection: the "No refracted ray" toggle under a two-ray diagram */
.op-both-row { text-align: center; margin: 4px 0 2px; }
.op-none { font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink); background: transparent; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.op-none.on { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
.op-box.locked .op-none { opacity: .6; cursor: default; }
/* Direction chevrons on every ray (incident, reflected, refracted, and the shown answer): arms as thick as the ray */
.op-chv { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.op-chv.sel { stroke-width: 3; }
.op-chv.good { stroke: var(--good); stroke-width: 2.4; }
/* Paper-first SALT questions */
.op-paper { margin: 10px 0 4px; padding: 10px 12px; border: 1.5px dashed var(--line); border-radius: 12px; text-align: left; }
.op-paper p { margin: 0 0 8px; color: var(--ink); font-size: .95rem; line-height: 1.4; }
.op-paper.done p { margin: 0; color: var(--muted); font-size: .88rem; }
.op-paper-go { width: 100%; }
