/* /mouse-test/ — the mouse diagram and its press counters. Replaces the
   page's inline mt- style block. Frame, h1 and subline come from games.css;
   buttons and the counter strip from utility-tools.css. Hardware accent. */

/* Diagram panel: a category panel (accent top strip) around the SVG. */
#mouse-tester-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
#mouse-tester.glass-panel {
  inline-size: 100%;
  max-inline-size: 22rem;
  padding: var(--space-4);
  border: 0;
  background: none;
  box-shadow: none;
}
#mouse-tester svg {
  display: block;
  inline-size: auto;
  block-size: min(19rem, 52svh);
  max-inline-size: 100%;
  margin-inline: auto;
}
.mt-outline { fill: var(--bg-raised); stroke: var(--cyan); stroke-width: 2.5; }
.mt-btn {
  fill: var(--hci-pad, var(--bg-raised));
  stroke: var(--mouse-tone, var(--cyan));
  stroke-width: 2;
  transition: fill var(--dur-fast) var(--ease), stroke var(--dur-fast) var(--ease);
}
.mt-btn.lit { fill: var(--mouse-tone, var(--cyan)); stroke: var(--text); }
#mt-left, #mt-forward { --mouse-tone: var(--neon-cyan); }
#mt-right { --mouse-tone: var(--neon-amber); }
#mt-middle { --mouse-tone: var(--neon-pink); }
#mt-back { --mouse-tone: var(--neon-lime); }
#mouse-tester svg:has(#mt-left.lit) .mt-label:nth-of-type(1),
#mouse-tester svg:has(#mt-right.lit) .mt-label:nth-of-type(2) { fill: var(--primary-ink); }
.mt-arrow { fill: var(--text-faint); transition: fill var(--dur-fast) var(--ease); }
.mt-arrow.lit { fill: var(--accent); }
.mt-label {
  fill: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
}
.mt-status {
  min-block-size: 1.5em;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--step--1);
  text-align: center;
}
.mt-status b { color: var(--accent); font-weight: 700; }

/* Counters: seven seamed cells, 4 + 3 on phones, one strip from 768px. */
.mt-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .mt-counts { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .mt-count { min-block-size: 56px; }
}

/* Laptop: diagram beside the controls and counters, all on the first
   screen at 1366x768. */
@media (min-width: 1080px) {
  main > .container > .mt-play {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas:
      "title title"
      "intro intro"
      "diagram controls"
      "diagram counts";
    grid-template-rows: auto auto auto 1fr;
    column-gap: var(--space-6);
  }
  .mt-play > h1 { grid-area: title; }
  .mt-play > h1 + p { grid-area: intro; }
  .mt-play > .mt-controls { grid-area: controls; justify-content: flex-start; align-self: end; }
  .mt-play > #mouse-tester-wrap { grid-area: diagram; }
  .mt-play > .mt-counts { grid-area: counts; align-self: start; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mt-play > .mt-counts .mt-count { min-block-size: 72px; }
  .mt-play > .mt-counts .mt-count-val { font-size: var(--step-3); }
  #mouse-tester svg { block-size: min(21rem, calc(100svh - 360px)); }
}

/* Fullscreen: the diagram alone on the page ground. */
#mouse-tester-wrap:fullscreen { justify-content: center; block-size: 100%; padding: var(--space-7); background: var(--bg); }
#mouse-tester-wrap:-webkit-full-screen { justify-content: center; block-size: 100%; padding: var(--space-7); background: var(--bg); }
#mouse-tester-wrap:fullscreen #mouse-tester { max-inline-size: min(30rem, 80vw); }
#mouse-tester-wrap:fullscreen #mouse-tester svg { block-size: min(36rem, 72vh); }

@media (prefers-reduced-motion: reduce) {
  .mt-btn, .mt-arrow { transition: none; }
}

/* Seven cells in a four-column strip: the last one closes the row. */
@media (max-width: 767.98px) { .mt-count:last-child { grid-column: span 2; } }
@media (min-width: 1080px) { .mt-play > .mt-counts .mt-count:last-child { grid-column: span 2; } }
