/* ============================================
   IMC-COG — IMC Cognitive Assessment replica
   Visual fidelity to the real SHL-style screens:
   white card, "Question" label, dark-blue icon squares,
   dark-blue Next pill, solid green + purple polka-dot fills,
   thin gray grid lines, green node chains.
   ============================================ */

:root {
  --ic-green: #4e7f2c;        /* solid cell fill (sampled) */
  --ic-node: #7ab648;         /* visited node green */
  --ic-node-line: #8bc34a;    /* chain line green */
  --ic-purple: #8f8ce0;       /* polka-dot base */
  --ic-blue: #2d5f8a;         /* icon squares + Next pill */
  --ic-grid: #c9cdd4;         /* thin gray grid lines */
}

/* ---------- page shell ---------- */
.ic-doc { max-width: 760px; margin: 0 auto; padding: 0 4px; }
.ic-doc + .ic-doc { margin-top: 40px; }
.ic-doc h2 { font: 800 1.45rem/1.25 Inter, system-ui, sans-serif; color: var(--text-bright, #111); margin: 0 0 14px; letter-spacing: -.01em; }
.ic-doc p { font-size: 1rem; line-height: 1.7; color: var(--text-secondary, #4a5160); margin: 0 0 14px; }
.ic-doc a { color: var(--accent-primary, #3b6fd4); text-decoration: none; font-weight: 600; }
.ic-doc a:hover { text-decoration: underline; }
.ic-doc ul { margin: 0 0 14px; padding-left: 22px; }
.ic-doc li { margin-bottom: 8px; line-height: 1.65; color: var(--text-secondary, #4a5160); }
.ic-doc code { font: 600 .9em "JetBrains Mono", ui-monospace, monospace; background: var(--bg-secondary, #eef1f6); color: var(--accent-primary, #3b6fd4); padding: 1.5px 6px; border-radius: 5px; }

.ic-hero { max-width: 760px; margin: 0 auto 30px; padding: 0 4px; }
.ic-hero__kicker { font: 800 .72rem/1 Inter, sans-serif; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-primary, #3b6fd4); margin-bottom: 10px; }
.ic-hero h1 { font-size: clamp(27px, 5vw, 38px); font-weight: 800; line-height: 1.14; color: var(--text-bright, #101318); margin: 0 0 10px; }
.ic-hero h1 .acc { color: var(--accent-primary, #3b6fd4); }
.ic-hero__sub { font-size: 17px; color: var(--text-secondary, #4a5160); line-height: 1.58; margin: 0 0 16px; }
.ic-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ic-stat { display: inline-flex; flex-direction: column; gap: 2px; padding: 9px 14px; border: 1px solid var(--border-color, rgba(0,0,0,.09)); border-radius: 12px; background: var(--bg-secondary, #f7f9fc); }
.ic-stat b { font-size: 15px; color: var(--text-bright, #111); }
.ic-stat span { font-size: 11.5px; color: var(--text-secondary, #6a7181); }
.ic-crumb { max-width: 760px; margin: 0 auto 16px; padding: 0 4px; font-size: 13px; color: var(--text-secondary, #6a7181); }
.ic-crumb a { color: var(--text-secondary, #6a7181); text-decoration: none; }
.ic-crumb a:hover { color: var(--accent-primary, #3b6fd4); }

/* ---------- app root ---------- */
#ic-root { max-width: 760px; margin: 0 auto 46px; }

/* intro */
.ic-intro { background: var(--bg-card, #fff); border: 1px solid var(--border-color, rgba(0,0,0,.09)); border-radius: 16px; padding: 26px 26px 24px; }
.ic-intro__badge { font: 800 .7rem/1 Inter, sans-serif; letter-spacing: .09em; text-transform: uppercase; color: var(--ic-blue); margin-bottom: 10px; }
.ic-intro h2 { margin: 0 0 10px; font-size: 22px; font-weight: 800; color: var(--text-bright, #14181f); }
.ic-intro__p { font-size: 15px; line-height: 1.65; color: var(--text-secondary, #4a5160); margin: 0 0 18px; }
.ic-intro__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ic-intro__hints { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-secondary, #79808f); }

.ic-btn { font: 700 14px/1 Inter, sans-serif; border-radius: 999px; padding: 13px 22px; cursor: pointer; border: 1px solid transparent; }
.ic-btn--primary { background: var(--ic-blue); color: #fff; }
.ic-btn--primary:hover { filter: brightness(1.08); }
.ic-btn--ghost { background: transparent; color: var(--text-primary, #2a2f38); border-color: var(--border-color, rgba(0,0,0,.16)); }
.ic-btn--ghost:hover { border-color: var(--ic-blue); color: var(--ic-blue); }

/* play shell */
.ic-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ic-prog { font: 700 12.5px/1 Inter, sans-serif; color: var(--text-secondary, #6a7181); letter-spacing: .04em; text-transform: uppercase; }
.ic-timer { font: 700 15px/1 "JetBrains Mono", monospace; color: var(--text-bright, #1c222b); background: var(--bg-secondary, #f2f5f9); border: 1px solid var(--border-color, rgba(0,0,0,.09)); border-radius: 8px; padding: 6px 10px; }
.ic-timer--low { color: #c0392b; border-color: #c0392b; }

/* THE CARD — deliberately white in both site themes, like the real test */
.ic-card { background: #fff; border: 1px solid #e3e6ea; border-radius: 14px; padding: 20px 22px 22px; box-shadow: 0 1px 4px rgba(15, 25, 40, .05); }
.ic-q { font: 600 12.5px/1 Inter, sans-serif; color: #8a8f98; margin-bottom: 6px; }
.ic-instr { font: 600 14.5px/1.4 Inter, sans-serif; color: #3c424c; margin-bottom: 10px; }

.ic-stage { position: relative; }
.ic-tools { display: flex; margin-bottom: 4px; }
.ic-tools--left { justify-content: flex-start; }
.ic-tools--right { justify-content: flex-end; }
.ic-icobtn { width: 32px; height: 32px; border-radius: 7px; background: var(--ic-blue); border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ic-icobtn:hover { filter: brightness(1.12); }

.ic-thumbs { display: flex; justify-content: center; gap: 26px; margin: 6px 0 14px; flex-wrap: wrap; }
.ic-thumb { width: 84px; height: auto; display: block; }
.ic-thumb--big { width: 150px; }
.ic-thumb .ic-cell { stroke: var(--ic-grid); stroke-width: 1.6; }
.ic-thumb .ic-decor { stroke: var(--ic-grid); stroke-width: 1.6; }

.ic-main { display: flex; justify-content: center; }
.ic-canvas { width: min(360px, 82vw); height: auto; touch-action: none; }
.ic-canvas .ic-cell { stroke: var(--ic-grid); stroke-width: 1; }
.ic-cell--tap { cursor: pointer; }
.ic-cell--tap:hover { stroke: #9aa1ab; stroke-width: 1.6; }
.ic-decor { fill: none; stroke: var(--ic-grid); stroke-width: 1; pointer-events: none; }

/* Type B canvas */
.ic-main--nodes { display: block; }
.ic-canvas--nodes { width: 100%; height: auto; }
.ic-link { stroke: var(--ic-node-line); stroke-width: 2; }
.ic-drag { stroke: var(--ic-node-line); stroke-width: 2; stroke-dasharray: 5 5; pointer-events: none; }
.ic-node circle { fill: #fff; stroke: #d7dbe0; stroke-width: 1.6; cursor: pointer; }
.ic-node text { font: 700 11px Inter, sans-serif; fill: var(--ic-node); pointer-events: none; user-select: none; }
.ic-node--on circle { fill: var(--ic-node); stroke: var(--ic-node); }
.ic-node--on text { fill: #234310; }
.ic-node--tail circle { stroke: #5a9331; stroke-width: 2.4; }
.ic-node:not(.ic-node--on) circle:hover { stroke: var(--ic-node); }

.ic-nextrow { display: flex; justify-content: center; margin-top: 16px; }
.ic-next { background: var(--ic-blue); color: #fff; font: 700 13.5px/1 Inter, sans-serif; border: none; border-radius: 999px; padding: 12px 58px; cursor: pointer; letter-spacing: .02em; }
.ic-next:hover { filter: brightness(1.08); }

/* feedback (practice) */
.ic-fb { margin-top: 14px; border-radius: 12px; padding: 16px 18px; border: 1px solid; }
.ic-fb--ok { background: rgba(78, 127, 44, .07); border-color: rgba(78, 127, 44, .35); }
.ic-fb--no { background: rgba(192, 57, 43, .06); border-color: rgba(192, 57, 43, .3); }
.ic-fb__verdict { font: 800 15px/1 Inter, sans-serif; margin-bottom: 10px; color: var(--text-bright, #171c24); }
.ic-fb--ok .ic-fb__verdict { color: #4e7f2c; }
.ic-fb--no .ic-fb__verdict { color: #c0392b; }
.ic-fb__figs { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 10px; }
.ic-fb__cap { font: 700 11.5px/1 Inter, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary, #6a7181); display: block; margin-bottom: 6px; }
.ic-fb__fig { background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; padding: 8px; }
.ic-fb__seq { display: flex; gap: 10px; background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; padding: 8px; }
.ic-fb__chains { font: 600 13.5px/1.9 "JetBrains Mono", monospace; color: var(--text-primary, #2a2f38); margin-bottom: 10px; overflow-x: auto; }
.ic-fb__chains .ic-fb__cap { display: inline; margin-right: 6px; }
.ic-fb__rule { font-size: 13.5px; line-height: 1.6; color: var(--text-secondary, #4a5160); }

/* results */
.ic-results { background: var(--bg-card, #fff); border: 1px solid var(--border-color, rgba(0,0,0,.09)); border-radius: 16px; padding: 26px; }
.ic-res__score { font: 800 40px/1 Inter, sans-serif; color: var(--text-bright, #14181f); margin-bottom: 4px; }
.ic-res__score b { color: var(--ic-green); }
.ic-res__split { font: 700 13px/1 Inter, sans-serif; color: var(--text-secondary, #6a7181); margin-bottom: 12px; }
.ic-res__note { font-size: 14.5px; line-height: 1.65; color: var(--text-secondary, #4a5160); margin: 0 0 18px; }
.ic-res__list { margin-bottom: 20px; }
.ic-res__row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-color, rgba(0,0,0,.08)); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.ic-res__row:hover { border-color: var(--ic-blue); }
.ic-res__mark { font-weight: 800; width: 18px; text-align: center; }
.ic-res__row.ok .ic-res__mark { color: var(--ic-green); }
.ic-res__row.no .ic-res__mark { color: #c0392b; }
.ic-res__t { font: 600 13.5px/1.3 Inter, sans-serif; color: var(--text-primary, #2a2f38); flex: 1; }
.ic-res__more { font: 700 11px/1 Inter, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary, #8a8f98); }
.ic-res__detail { padding: 12px 6px 18px; }

@media (max-width: 560px) {
  .ic-card { padding: 16px 12px 18px; }
  .ic-thumbs { gap: 12px; }
  .ic-thumb { width: 64px; }
  .ic-fb__figs { gap: 12px; }
  .ic-thumb--big { width: 120px; }
  .ic-intro__btns { flex-direction: column; }
  .ic-btn { text-align: center; }
}
