/* Keyboard and mouse controls diagram (game page and its administrator preview). */
.controls-visual { --cv-key:#1b2029; --cv-key-line:#2b3240; --cv-cap:#5f6879; --cv-active:#e9edf4; --cv-active-text:#11141b;
    --cv-accent:var(--accent,#c1f66b); --cv-text:#f2f4f8; --cv-panel:#12151c;
    margin:14px 0 0; padding:10px 8px; border:1px solid var(--line,#2a303d); border-radius:16px;
    background:radial-gradient(ellipse at 50% 0,#252b37 0,var(--cv-panel) 70%); overflow:hidden }
.cv-diagram { display:none; width:100%; height:auto; font-family:var(--font,system-ui,sans-serif) }
.cv-key rect { fill:var(--cv-key); stroke:var(--cv-key-line); stroke-width:1 }
.cv-key text { fill:var(--cv-cap); font-size:13px; font-weight:600; text-anchor:middle }
.cv-key text.cv-cap-small { font-size:10.5px }
.cv-key.is-single rect,.cv-key.is-group rect { fill:var(--cv-active); stroke:var(--cv-active) }
.cv-key.is-group rect { stroke:var(--cv-accent); stroke-width:2.5 }
.cv-key.is-single text,.cv-key.is-group text { fill:var(--cv-active-text); font-weight:700 }
.cv-mouse-body { fill:var(--cv-key); stroke:var(--cv-key-line); stroke-width:1.5 }
.cv-mouse-body.is-single { stroke:var(--cv-active); stroke-width:2.5 }
.cv-mouse-body.is-group { stroke:var(--cv-accent); stroke-width:2.5 }
.cv-mouse-button { fill:#232936 }
.cv-mouse-wheel { fill:#3a4252; stroke:var(--cv-panel); stroke-width:2 }
.cv-mouse-button.is-single,.cv-mouse-button.is-group,.cv-mouse-wheel.is-single,.cv-mouse-wheel.is-group { fill:var(--cv-active) }
.cv-mouse-button.is-group,.cv-mouse-wheel.is-group { stroke:var(--cv-accent); stroke-width:2 }
.cv-halo { fill:none; stroke:var(--cv-panel); stroke-width:4.5; stroke-linejoin:round; opacity:.9 }
.cv-line { fill:none; stroke:var(--cv-active); stroke-width:1.5; stroke-linejoin:round }
.cv-dot { fill:var(--cv-active) }
.cv-line.is-group { stroke:var(--cv-accent) }
.cv-dot.is-group { fill:var(--cv-accent) }
.cv-label rect { fill:var(--cv-panel); stroke:#343c4b; stroke-width:1 }
.cv-label text { fill:var(--cv-text); font-size:12px; font-weight:800; letter-spacing:.04em; text-anchor:middle }
.cv-label.is-group text { fill:var(--cv-accent) }
.cv-label.is-group rect { stroke:color-mix(in srgb,var(--cv-accent) 55%,transparent) }
.cv-label text.cv-hold { fill:var(--cv-accent); font-size:9.5px; font-weight:700; letter-spacing:.08em }
.cv-list { display:grid; gap:8px; margin:0; padding:4px; list-style:none }
.cv-list li { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px }
.cv-inputs { display:flex; flex-wrap:wrap; gap:4px }
.cv-inputs kbd { min-width:30px; padding:4px 8px; border-radius:6px; background:var(--cv-active); color:var(--cv-active-text);
    font:700 .85rem/1.2 var(--font,system-ui,sans-serif); text-align:center; box-shadow:inset 0 -2px 0 #b9c0cc }
.cv-inputs kbd.cv-mouse-input { background:#2a3140; color:var(--cv-text); box-shadow:inset 0 -2px 0 #1a1f28 }
.cv-action { color:var(--cv-text); font-weight:700 }
.cv-hold-tag { margin-left:4px; padding:1px 6px; border-radius:999px; background:color-mix(in srgb,var(--cv-accent) 18%,transparent); color:var(--cv-accent); font-size:.75rem; text-transform:uppercase; letter-spacing:.06em }
.controls-written { margin-top:10px; color:var(--muted,#a1a9ba) }
.controls-written summary { cursor:pointer; width:max-content; max-width:100%; font-size:.9rem }
.controls-written p { margin:8px 0 0 }
/* The keyboard is drawn only when its own box is wide enough for readable labels (at least about 0.7 of drawn size).
   Narrower boxes, and browsers without container queries, keep the list; the list remains for assistive technology. */
.controls-visual { container-type:inline-size }
@container (min-width:720px) {
    .cv-diagram { display:block }
    .cv-list { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0 }
}
/* This stylesheet loads only on game pages that show a diagram: give the controls the full content width
   below the description and How to Play columns instead of the narrow right-hand column. */
@media (min-width:900px) {
    .game-prose > .game-overview { grid-row:auto }
    .game-prose > .game-controls { grid-column:1/-1 }
}
