/* Color Blindness Test. Functional layout before the design pass; existing tokens only (spec D11,
   follow-ups). The plate's card is a neutral grey set by plate-view.js from the color math, the same
   in both themes, so the page's colors don't surround the plate. Plate diameter: 80% of the shorter
   screen side, at most 480 px. */

.b-color { padding-block: var(--s3) var(--s7); }
.b-color__intro { margin-bottom: var(--s3); }
.b-color__intro h1 { font-size: 24px; }
.b-color__intro p { margin-top: var(--s2); max-width: 60ch; }
.b-color__disclaimer { padding: var(--s3) var(--s4); font-size: 14px; border: 1px solid var(--line); }

/* ---------- test card ---------- */
.b-color__game { max-width: 560px; display: grid; gap: var(--s3); padding: var(--s3); }
@media (min-width: 400px) { .b-color__game { padding: var(--s4); } }
.b-color__game:focus { outline: none; }
.b-color__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4); min-height: 44px; }
.b-color__status { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.b-color__bar .btn { touch-action: manipulation; }

.b-color__checklist ul { margin: var(--s2) 0 0; padding-left: 1.2em; }
.b-color__checklist li + li { margin-top: var(--s1); }
.b-color__ready { display: flex; gap: var(--s2); align-items: center; min-height: 44px; margin-top: var(--s2); font-weight: 600; cursor: pointer; }
.b-color__ready input { width: 20px; height: 20px; flex: none; }

/* ---------- plate and answers ---------- */
.b-color__test { display: grid; gap: var(--s3); justify-items: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.b-color__test > * { min-width: 0; }
.b-color__card { position: relative; padding: var(--s2); border-radius: var(--r-card); }
.b-color__plate { display: block; width: min(80vmin, 480px); aspect-ratio: 1; }
.b-color__message {
  position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s5);
  color: #FFFFFF; font-size: 18px; font-weight: 700; text-align: center;
}
.b-color__message[hidden] { display: none; }

.b-color__responses { display: grid; gap: var(--s2); justify-items: center; }
.b-color__arrows { display: flex; gap: var(--s2); }
.b-color__arrow { width: 60px; height: 52px; padding: 0; touch-action: manipulation; }
.b-color__arrow .ico { width: 24px; height: 24px; }
.b-color__cant { touch-action: manipulation; }
.b-color__keys { font-size: 13px; }
.b-color__after { min-height: 52px; display: grid; place-items: center; }

/* A phone on its side: the answers beside the plate */
@media (orientation: landscape) and (max-height: 520px) {
  .b-color__test { grid-template-columns: auto auto; align-items: center; justify-content: center; }
  .b-color__plate { width: min(80vmin, 480px); }
  .b-color__arrows { flex-wrap: wrap; width: 128px; justify-content: center; }
}

/* ---------- results and saved results ---------- */
.b-color__results { display: grid; gap: var(--s3); padding-top: var(--s2); }
.b-color__results:focus, .b-color__results h2:focus { outline: none; }
.b-color__results .figs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.b-color__results .fig dd { font-size: 20px; }
.b-color__saved { display: grid; gap: var(--s2); justify-items: start; padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 14px; }
.b-color__confirm { display: grid; gap: var(--s2); }
.b-color__confirm-btns { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- mode (Phase 2) and past results ---------- */
.b-color__modes { justify-self: start; }
.b-color__modes:disabled { opacity: .6; }
.b-color__past { justify-self: stretch; }
.b-color__past summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.b-color__history { border-collapse: collapse; width: 100%; }
.b-color__history th, .b-color__history td { text-align: left; vertical-align: top; padding: 4px var(--s3) 4px 0; border-bottom: 1px solid var(--line); }
.b-color__history th { font-weight: 600; color: var(--ink-2); }
.b-color__history .num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- about ---------- */
.b-color__about { max-width: 68ch; margin-top: var(--s7); }
.b-color__about h2 { margin-top: var(--s6); }
.b-color__about h3 { margin-top: var(--s5); }
.b-color__about p, .b-color__about ol, .b-color__about ul { margin-top: var(--s3); }
.b-color__about li + li { margin-top: var(--s1); }
.b-color__keys { border-collapse: collapse; font-size: 15px; margin-top: var(--s3); } /* as the Stroop test's */
.b-color__keys th, .b-color__keys td { text-align: left; padding: 6px var(--s4) 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.b-color__keys th { font-weight: 600; white-space: nowrap; }
