/* Games pages: shared page-local styles (owned by the games session). */
.gm-page { max-width: 820px; }
.gm-intro { font-size: 14.5px; line-height: 1.55; margin: 6px 0 20px; }
.gm-list { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); overflow: hidden; }
.gm-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; padding: 16px 20px;
  border-bottom: 1px solid var(--border); color: var(--text); }
.gm-row:last-child { border-bottom: none; }
a.gm-row:hover { background: #fbfbf8; text-decoration: none; }
a.gm-row:hover .gm-title { color: var(--green-deep); }
.gm-row.is-off { background: var(--panel-2); }
.gm-row.is-off .gm-title { color: var(--muted); }
.gm-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.gm-blurb { font-size: 14px; line-height: 1.5; margin: 0; }
.gm-cmds { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.gm-cmds code { font-family: var(--mono); font-size: 11.5px; background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; color: var(--text); }
.gm-side { text-align: right; white-space: nowrap; }
.gm-count { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Section picker: a full-width grid of square tiles. */
.gm-wide { max-width: none; }
.gm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); grid-auto-rows: 1fr; gap: 14px; }
/* Square by default: the ::before spacer is as tall as the tile is wide, and
   shares one grid cell with the body, so a tile is square unless its content
   needs more height. Equal row tracks (1fr) then keep a row's tiles equal. */
.gm-tile { display: grid; padding: 18px 18px 16px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--panel); color: var(--text); }
.gm-tile::before { content: ""; grid-area: 1 / 1; padding-bottom: 100%; }
.gm-tile-body { grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0; }
a.gm-tile:hover { border-color: var(--green); text-decoration: none; box-shadow: 0 2px 10px rgba(22, 36, 27, 0.08); }
a.gm-tile:hover .gm-title { color: var(--green-deep); }
.gm-tile .gm-title { font-size: 17px; margin-bottom: 6px; }
.gm-tile .gm-blurb { font-size: 13.5px; }
.gm-tile .gm-cmds { margin-top: 10px; gap: 4px; }
.gm-tile .gm-cmds code { font-size: 11px; padding: 0 5px; line-height: 1.6; }
.gm-tile-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 12px; }
.gm-tile-foot .gm-count { margin: 0; }
.gm-tile.is-off { background: var(--panel-2); }
.gm-tile.is-off .gm-title { color: var(--muted); }
.gm-tile.is-mixed { background: var(--navy); border-color: var(--navy); color: #e8efe9; }
.gm-tile.is-mixed .gm-title { color: #ffffff; }
a.gm-tile.is-mixed:hover .gm-title { color: #9be3b4; }
.gm-tile.is-mixed .gm-blurb, .gm-tile.is-mixed .gm-count { color: #b9c7bd; }
.gm-tile.is-mixed .chip { background: #ffffff; color: var(--green-deep); }
.gm-mixed-num { margin-top: auto; font-family: var(--mono); font-size: 44px; font-weight: 700; line-height: 1; color: #ffffff; }
.gm-mixed-num small { display: block; margin-top: 6px; font-size: 12px; font-weight: 400; color: #b9c7bd; }

/* Source note: which documentation a deck follows. */
.gm-basis { display: flex; gap: 12px; align-items: baseline; margin: 0 0 20px; padding: 11px 14px; border: 1px solid var(--border);
  border-left: 3px solid var(--green); border-radius: 8px; background: var(--panel); font-size: 13.5px; line-height: 1.55; }
.gm-basis-label { flex: none; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.gm-basis a { font-weight: 600; }
.gm-basis-tag { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 6px; }

/* Deck picker: tiles grouped under headings. */
.gm-group { margin: 26px 0 0; }
.gm-group-head { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 14px; }
.gm-group-title { font-size: 14px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 0; }
.gm-group-blurb { font-size: 13.5px; color: var(--text); margin: 5px 0 0; }
/* Deck tiles size to their content: the square spacer suits the section
   pages, where a tile carries a long command list, not these. */
.gm-grid-auto .gm-tile::before { display: none; }
.gm-grid-auto .gm-tile { min-height: 170px; }

/* Flash cards: the kinds of card a section holds, on its tile. */
.gm-styles { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.gm-style { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.3px; text-transform: uppercase;
  color: var(--green-deep); background: rgba(22, 163, 74, 0.09); border: 1px solid rgba(22, 163, 74, 0.35);
  border-radius: 4px; padding: 1px 6px; }

/* ---- Flash-card and drill cards (shared by the flash-card and log-forensics pages) ---- */
/* Flash cards: page-local styles (owned by the games session). */
  .fc-page { max-width: 760px; }
  .fc-intro { font-size: 14.5px; line-height: 1.55; margin: 6px 0 18px; }
  .fc-card { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 20px 22px; }
  .fc-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .fc-topic { color: var(--muted); background: var(--panel-2); font-size: 11.5px; }
  .fc-count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
  .fc-command { margin: 0 0 16px; padding: 14px 16px; background: var(--navy); color: #e8efe9; border-radius: 8px;
    font-family: var(--mono); font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
  .fc-excerpt { margin: 0 0 16px; padding: 12px 14px; max-height: 420px; overflow: auto; background: var(--code-bg);
    border: 1px solid var(--border); border-radius: 8px; font-family: var(--mono); font-size: 12px; line-height: 1.45; white-space: pre; }
  .fc-prompt { margin: 0 0 16px; padding: 14px 16px; background: var(--panel-2); border: 1px solid var(--border);
    border-left: 3px solid var(--green); border-radius: 8px; font-size: 15px; line-height: 1.55; }
  .fc-option-code span:last-child { font-family: var(--mono); font-size: 13.5px; }
  .fc-order { display: flex; flex-direction: column; gap: 8px; }
  .fc-order-item { display: flex; gap: 12px; align-items: baseline; text-align: left; width: 100%; padding: 11px 14px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text);
    font: inherit; cursor: pointer; }
  .fc-order-text { flex: 1; }
  .fc-order-text code { font-family: var(--mono); font-size: 13.5px; }
  .fc-order-pos:empty { display: none; }
  .fc-order-pos { flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--green-deep);
    border: 1px solid var(--green); border-radius: 4px; padding: 0 6px; }
  .fc-order-item.fc-wrong .fc-order-pos { color: #b91c1c; border-color: var(--red); }
  .fc-order-item:hover:not(:disabled) { border-color: var(--green); background: #fbfbf8; }
  .fc-order-item:disabled { cursor: default; }
  .fc-order-item.fc-order-done { border-color: var(--green); background: rgba(22, 163, 74, 0.09); }
  .fc-order-item.fc-order-done .fc-key { border-color: var(--green); color: var(--green-deep); }
  .fc-order-item.fc-right { border-color: var(--green); }
  .fc-order-item.fc-wrong { border-color: var(--red); background: rgba(220, 38, 38, 0.07); }
  .fc-order-note { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); }
  .fc-list-prompt { font-style: italic; }
  .fc-list-order { margin: 4px 0; padding-left: 20px; font-family: var(--mono); font-size: 13px; }
  .fc-question { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px; }
  .fc-hint-row { display: flex; gap: 10px; align-items: baseline; margin: -2px 0 12px; }
  .fc-hintbtn { background: none; border: 1px dashed var(--border); border-radius: 6px; padding: 3px 10px; cursor: pointer;
    font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
  .fc-hintbtn:hover { border-color: var(--amber); color: var(--amber-deep); }
  .fc-hint { font-size: 13.5px; line-height: 1.5; color: var(--amber-deep); }
  .fc-hint code { background: var(--code-bg); padding: 0 4px; border-radius: 3px; font-family: var(--mono); font-size: 0.9em; }
  .fc-options { display: flex; flex-direction: column; gap: 8px; }
  .fc-option { display: flex; gap: 12px; align-items: baseline; text-align: left; width: 100%; padding: 11px 14px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text);
    font: inherit; font-size: 14.5px; line-height: 1.45; cursor: pointer; }
  .fc-option:hover:not(:disabled) { border-color: var(--green); background: #fbfbf8; }
  .fc-option:disabled { cursor: default; }
  .fc-key { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; flex: none; }
  .fc-option.fc-right { border-color: var(--green); background: rgba(22, 163, 74, 0.09); }
  .fc-option.fc-wrong { border-color: var(--red); background: rgba(220, 38, 38, 0.07); }
  .fc-option code, .fc-explain code, .fc-missed code, .fc-list code { font-family: var(--mono); font-size: 0.9em; background: var(--code-bg); padding: 0 4px; border-radius: 3px; }
  .fc-feedback:empty { display: none; }
  .fc-feedback { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
  .fc-verdict { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
  .fc-v-ok { color: var(--green-deep); }
  .fc-v-bad { color: #b91c1c; }
  .fc-explain { font-size: 14px; line-height: 1.55; margin: 0 0 12px; }
  .fc-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .fc-source { font-family: var(--mono); font-size: 12px; }
  .fc-idle-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
  .fc-missed { margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; line-height: 1.8; }
  .fc-status { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 12px 2px 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }
  .fc-status b { color: var(--text); }
  .fc-linkbtn { margin-left: auto; background: none; border: none; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
  .fc-deck { margin-top: 30px; border-top: 1px solid var(--border); padding-top: 14px; }
  .fc-deck summary { cursor: pointer; font-weight: 700; font-size: 14.5px; }
  .fc-list { list-style: none; margin: 12px 0 0; padding: 0; }
  .fc-list li { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; line-height: 1.5; }
  .fc-list .fc-list-cmd { font-family: var(--mono); font-size: 13px; font-weight: 600; }
  .fc-list .fc-list-ans { margin: 4px 0; }
  .fc-list .fc-list-exp { color: var(--muted); margin: 0; }
  .fc-list .fc-list-hint { color: var(--amber-deep); margin: 0 0 3px; font-size: 13px; }

/* The change that puts a diagnosed failure right, shown with the answer. */
.fc-fix { margin: 0 0 12px; border: 1px solid var(--border); border-left: 3px solid var(--green); border-radius: 8px;
  background: var(--panel-2); padding: 10px 12px; }
.fc-fix-label { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.fc-fix pre { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }

/* Count of what a group holds, beside its heading. */
.gm-group-count { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.4px; text-transform: none; color: var(--muted); margin-left: 8px; }

/* ---- Over / under: the design summary, the two calls, and the reveal ---- */
.ou-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 18px; margin: 0 0 12px; }
.ou-fact dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.ou-fact dd { margin: 2px 0 0; font-size: 14px; }
.ou-note { margin: 0 0 16px; padding: 10px 12px; background: var(--panel-2); border-left: 3px solid var(--amber);
  border-radius: 6px; font-size: 13.5px; line-height: 1.5; }
.ou-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ou-choice { display: flex; flex-direction: column; gap: 3px; align-items: center; padding: 14px 10px;
  border: 2px solid var(--navy); border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.ou-choice b { font-size: 16px; letter-spacing: 0.4px; }
.ou-choice span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ou-choice:hover:not(:disabled) { background: #fbfbf8; }
.ou-choice:disabled { cursor: default; }
.ou-choice.fc-right { border-color: var(--green); background: rgba(22, 163, 74, 0.10); }
.ou-choice.fc-wrong { border-color: var(--red); background: rgba(220, 38, 38, 0.07); }
.ou-scale { margin: 14px 0 16px; }
.ou-bar { position: relative; height: 10px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--border); }
.ou-tick { position: absolute; top: -5px; width: 2px; height: 18px; background: var(--navy); }
.ou-val { position: absolute; top: -7px; width: 12px; height: 22px; margin-left: -6px; border-radius: 3px;
  background: var(--green); border: 1px solid var(--green-deep); }
.ou-val.is-beyond { background: var(--amber); border-color: var(--amber-deep); }
.ou-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.ou-actual b { color: var(--text); }
@media (max-width: 560px) { .ou-choices { grid-template-columns: 1fr; } }

/* ---- Spot the pathology: maps, pairs, and the click target ---- */
.pa-page { max-width: 860px; }
.pa-stage { position: relative; display: inline-block; max-width: 100%; }
.pa-fig { margin: 0 0 10px; }
.pa-img { display: block; width: 100%; max-width: 560px; height: auto; border: 2px solid var(--navy); border-radius: 8px; background: #000; }
.pa-stage .pa-img { cursor: crosshair; }
.pa-fig figcaption { margin-top: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.pa-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pa-pair .pa-img { max-width: 100%; }
.pa-caption { margin: 2px 0 12px; font-size: 13px; color: var(--muted); }
.pa-hintline { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.pa-overlay { position: absolute; inset: 0; pointer-events: none; }
.pa-overlay:not(.is-shown) { display: none; }
.pa-target { position: absolute; border: 2px dashed var(--green); border-radius: 4px; background: rgba(22, 163, 74, 0.12); }
.pa-click { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; }
.pa-click.is-hit { background: var(--green); }
.pa-click.is-miss { background: var(--red); }
.pa-describe { margin: 0 0 10px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
@media (max-width: 620px) { .pa-pair { grid-template-columns: 1fr; } }

/* The nine numbered parts, so a click item can be answered from the keyboard. */
.pa-grid { position: absolute; inset: 0; pointer-events: none; }
.pa-grid.is-done { opacity: 0.25; }
.pa-ninth { position: absolute; border: 1px dashed rgba(255, 255, 255, 0.28); }
.pa-ninth i { position: absolute; left: 4px; top: 2px; font-style: normal; font-family: var(--mono);
  font-size: 11px; color: rgba(255, 255, 255, 0.65); }
.pa-picked { position: absolute; border: 2px solid #fff; border-radius: 4px; }
.pa-picked.is-hit { background: rgba(22, 163, 74, 0.22); border-color: var(--green); }
.pa-picked.is-miss { background: rgba(220, 38, 38, 0.18); border-color: var(--red); }
.pa-larger { font-family: var(--mono); font-size: 11px; }

/* ---- Flagging, and the review page ---- */
.fg-bar { display: flex; align-items: center; gap: 10px; margin: 14px 2px 0; flex-wrap: wrap; }
.fg-open, .fg-cancel { background: none; border: 1px dashed var(--border); border-radius: 6px; padding: 3px 10px;
  cursor: pointer; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.fg-open:hover { border-color: var(--red); color: #b91c1c; }
.fg-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fg-label { font-size: 12.5px; color: var(--muted); }
.fg-note { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; min-width: 260px; }
.fg-send { background: var(--navy); color: #fff; border: none; border-radius: 6px; padding: 4px 12px; cursor: pointer; font: inherit; font-size: 12.5px; }
.fg-said { font-family: var(--mono); font-size: 11.5px; color: var(--green-deep); }
.rv-list { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rv-item { border: 2px solid var(--navy); border-radius: 12px; background: var(--panel); padding: 14px 16px; }
.rv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rv-id { font-family: var(--mono); font-size: 12px; background: var(--code-bg); padding: 1px 6px; border-radius: 4px; }
.rv-sec, .rv-when { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.rv-when { margin-left: auto; }
.rv-text { font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
.rv-missing { color: #b91c1c; font-family: inherit; }
.rv-body { font-size: 14px; margin-top: 6px; }
.rv-note { margin: 10px 0 0; padding: 8px 10px; border-left: 3px solid var(--amber); background: var(--panel-2);
  border-radius: 6px; font-size: 13.5px; }
.rv-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.rv-file { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rv-actions { display: flex; gap: 8px; }
.rv-actions button { border: none; cursor: pointer; font: inherit; }

.gx-review { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 18px 2px 0; font-size: 13.5px; }
.gx-review-n { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.gx-review-hint { font-size: 12.5px; color: var(--muted); }

/* ---- What happens if: the situation, the choices, and the outcome table ---- */
.wi-situation { margin: 0 0 12px; font-size: 15px; line-height: 1.55; }
.wi-options { display: grid; gap: 10px; }
.wi-option { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px 14px;
  border: 2px solid var(--navy); border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.wi-option b { font-size: 14.5px; }
.wi-option span { font-size: 12.5px; color: var(--muted); }
.wi-option:hover:not(:disabled) { background: #fbfbf8; }
.wi-option:disabled { cursor: default; }
.wi-option.fc-right { border-color: var(--green); background: rgba(22, 163, 74, 0.10); }
.wi-option.fc-wrong { border-color: var(--red); background: rgba(220, 38, 38, 0.07); }
.wi-table { width: 100%; border-collapse: collapse; margin: 14px 0 12px; font-size: 13.5px; }
.wi-table th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); padding: 6px 8px; }
.wi-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; }
.wi-table td:first-child { font-family: inherit; font-size: 13.5px; }
.wi-row.is-best td { background: rgba(22, 163, 74, 0.09); }
.wi-row.is-yours td { box-shadow: inset 2px 0 0 var(--navy); }
.wi-unit { text-transform: none; letter-spacing: 0; }
.wi-tag { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-left: 6px; }
.wi-tag.is-best { color: var(--green-deep); }
.wi-caveat { margin: 0 0 12px; font-size: 13px; color: var(--muted); border-left: 3px solid var(--amber);
  padding-left: 10px; }

/* ---- Suggest a drill: the form, and the suggestions on the review page ---- */
.ct-said { border: 2px solid var(--green); border-radius: 10px; background: rgba(22, 163, 74, 0.09);
  padding: 12px 14px; margin: 0 0 18px; font-size: 14px; }
.ct-said-no { border-color: var(--amber); background: rgba(217, 119, 6, 0.09); }
.ct-form { display: grid; gap: 18px; max-width: 720px; margin: 18px 0 26px; }
.ct-field { display: block; border: none; padding: 0; margin: 0; }
.ct-field legend, .ct-label { display: block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 7px; }
.ct-radio { display: flex; align-items: center; gap: 9px; padding: 3px 0; font-size: 14px; cursor: pointer; }
.ct-form input[type="text"], .ct-form select, .ct-form textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; color: var(--text);
  background: var(--panel); border: 2px solid var(--navy); border-radius: 10px; padding: 9px 11px; }
.ct-form textarea { resize: vertical; line-height: 1.5; }
.ct-form input[type="text"]:focus, .ct-form select:focus, .ct-form textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 3px 3px 0 var(--shadow-hard); }
.ct-hint { display: block; margin-top: 7px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.ct-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ct-waiting { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.rv-kind { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.rv-source { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.rv-source b { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.rv-sub { margin: 30px 0 10px; font-size: 18px; }
