/* CR-1224: the Wormhole trainer. Levels, the score line, the picture, the answers, then (CR-1623) the sheets and the credits. Colours are the page's tokens. */
.wh { display: grid; gap: var(--s4); max-width: 1200px; }
.wh-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.wh-level { display: grid; gap: var(--s1); align-content: start; text-align: left; min-height: 44px; min-width: 0; padding: var(--s3); }
.wh-level b { font-size: var(--text-lg); }
.wh-level small { color: var(--muted); font-size: var(--text-sm); font-weight: 400; }
.wh-level .wh-best { color: var(--accent); font-size: var(--text-sm); font-weight: 600; }
.wh-level[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wh-hud { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin: 0; color: var(--muted); font-size: var(--text-md); }
.wh-hud b { color: var(--fg); }
.wh-play { display: grid; gap: var(--s3); }
.wh-viewer { position: relative; aspect-ratio: 16 / 10; max-width: 100%; border-radius: var(--radius-lg); overflow: hidden; background: var(--mask-solid); border: 1px solid var(--line); }
.wh-canvas { width: 100%; height: 100%; display: block; }
.wh-tag { margin: 0; font-size: var(--text-xs); letter-spacing: .06em; text-transform: uppercase; }
.wh-timer { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--warn); transform-origin: left; }
.wh-answers { display: grid; gap: var(--s2); }
.wh-answers-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wh-answers-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wh-answer { display: grid; justify-items: center; gap: var(--s1); min-height: 44px; padding: var(--s2) var(--s1); font-size: var(--text-xl); font-weight: 700; }
.wh-answer small { color: var(--muted); font-size: var(--text-xs); font-weight: 400; }
.wh-answer.wh-long { font-size: var(--text-md); }
.wh-key { color: var(--muted); font-size: var(--text-xs); font-weight: 400; }
.wh-answer.wh-right { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.wh-answer.wh-wrong { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.wh-feedback { min-height: 3em; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s2) var(--s3); }
.wh-feedback p { margin: var(--s1) 0 0; }
.wh-verdict { font-size: var(--text-xl); font-weight: 700; }
.wh-ok { color: var(--ok); }
.wh-no { color: var(--bad); }
.wh-end { display: grid; gap: var(--s3); text-align: center; justify-items: center; }
.wh-big { font-size: var(--text-display); font-weight: 700; line-height: 1; }
.wh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); margin-top: var(--s3); }
.wh-card { display: grid; gap: var(--s1); align-content: start; min-width: 0; }
.wh-card img, .wh-card canvas { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.wh-card span { color: var(--muted); font-size: var(--text-sm); }
.wh-credit { font-size: var(--text-sm); margin: 0; }
/* CR-1623: one column under 1100 px. From 1100 px the game (levels, score line, picture, answers) is the left column and the two sheets are the right column beside the picture. */
.wh-endless-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.wh-endless { min-height: 44px; min-width: 44px; padding: var(--s2) var(--s4); font-weight: 600; }
.wh-endless[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wh-endless-best { font-size: var(--text-sm); }
.wh-endrun, .wh-next { min-height: 44px; }
.wh-stage { display: grid; gap: var(--s4); }
.wh-jumps { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0; }
.wh-jump, .wh-back { min-height: 44px; }
.wh-back { margin-top: var(--s3); }
.wh-group { margin: var(--s4) 0 0; font-size: var(--text-md); scroll-margin-top: var(--s3); }
.wh-group:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wh-main { display: grid; gap: var(--s4); min-width: 0; align-content: start; }
.wh-side { display: grid; gap: var(--s3); min-width: 0; align-content: start; }
@media (min-width: 1100px) {
  .wh { max-width: 1200px; }
  .wh-stage { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); align-items: start; }
  .wh-side { padding: 2px; position: sticky; top: var(--s3); max-height: calc(100vh - 2 * var(--s4)); overflow-y: auto; }
  .wh-side .wh-cards { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--s2); }
  .wh-side .wh-card span { font-size: var(--text-xs); }
}
@media (max-width: 640px) {
  .wh-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wh-answer { font-size: var(--text-lg); }
  .wh-answer small { display: none; }
  .wh-answer.wh-long { font-size: var(--text-sm); }
}
@media (prefers-reduced-motion: reduce) { .wh-timer { transition: none !important; } }
