/* Atlantic Race Controls and How to play pages (2026-10-25), linked after race.css,
   menu-polish.css and settings.css on controls.html and tutorial.html. Only the --mp-* tokens
   (menu-polish.css), so both follow the Dark (Storm) and Light (Coast Daylight,
   html[data-look-theme=sand]) themes.
   - Controls: the mode and input pickers, the diagrams (keyboard, gamepad, phone; inline SVG
     drawn by controls.js), their numbered legend and the live tester (.live while held).
   - Tutorial: the intro cards, one lesson per mode with its picture, the read marks and the
     coach-tips switch.
   - Each action has a colour, --c, set on its keys, buttons and legend row by the scripts.
   Motion is off under html[data-motion=reduce] (settings.css) and prefers-reduced-motion (race.css). */

.lc-main { gap: 18px; }
.lc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.lc-label { color: var(--mp-ink-2); font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }

/* ---------------- pickers ---------------- */
.lc-modes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.lc-mode {
  --a-ink: var(--a);
  display: grid; justify-items: center; gap: 6px; padding: 10px 6px 9px; min-width: 0; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--mp-stroke); border-top: 3px solid var(--a);
  background: var(--mp-card); color: var(--mp-ink-2); box-shadow: var(--mp-hi);
  font: inherit; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: center; line-height: 1.15;
  transition: transform .15s var(--mp-ease), background .15s ease, border-color .15s ease;
}
html[data-look-theme='sand'] .lc-mode { --a-ink: color-mix(in oklab, var(--a) 55%, #0d1b2a); }
.lc-mode svg { width: 32px; height: 32px; color: var(--a-ink); }
.lc-mode:hover { transform: translateY(-2px); background: var(--mp-card-hover); color: var(--mp-ink); }
.lc-mode[aria-checked='true'] { background: var(--a); border-color: var(--a); color: #06192c; box-shadow: 0 6px 20px color-mix(in srgb, var(--a) 35%, transparent); }
.lc-mode[aria-checked='true'] svg { color: #06192c; }

.lc-inputs button { display: inline-flex; align-items: center; gap: 8px; }
.lc-inputs svg { width: 20px; height: 20px; flex: none; }
.lc-found { color: var(--mp-ink-2); font-size: .82rem; }
.lc-found b { color: var(--mp-ink); }

/* ---------------- the diagram card ---------------- */
.lc-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.lc-figure { margin: 0 auto; width: min(100%, 880px); min-width: 0; display: grid; gap: 10px; }
.lc-figure:focus-visible { outline-offset: 6px; border-radius: 12px; }
.lc-figure svg { display: block; width: 100%; height: auto; overflow: visible; }
.lc-tester { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 2.2em; margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--mp-well); border: 1px solid var(--mp-stroke); color: var(--mp-ink-2); font-size: .86rem; }
.lc-tester b { color: var(--mp-ink); }
.lc-tester .lc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mp-track); flex: none; }
.lc-tester.on .lc-dot { background: #3ddc84; box-shadow: 0 0 0 4px rgb(61 220 132 / .25); }
.lc-tester .ghost-btn { margin-left: auto; }

/* the legend: one row per action, numbered as on the drawing */
.lc-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.lc-legend li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 8px 10px;
  border-radius: 12px; border: 1px solid var(--mp-stroke); background: var(--mp-well);
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.lc-legend .lc-n { grid-row: span 2; }
.lc-legend b { color: var(--mp-ink); font-size: .92rem; }
.lc-legend small { color: var(--mp-ink-2); font-size: .8rem; line-height: 1.35; font-weight: 600; }
.lc-legend .lc-binds { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; color: var(--mp-ink-2); font-size: .82rem; }
.lc-legend li.none { opacity: .55; }
.lc-legend li.live { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, var(--mp-well)); transform: translateX(3px); }
.lc-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #06192c; font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* the SVG pieces */
.lc-svg text { font-family: Barlow, system-ui, sans-serif; font-weight: 800; }
.lc-key rect { fill: var(--mp-kbd-bg); stroke: var(--mp-kbd-line); stroke-width: 1.5; }
.lc-key text { fill: var(--mp-ink-2); font-size: 13px; text-anchor: middle; dominant-baseline: central; }
.lc-key.used rect { fill: color-mix(in srgb, var(--c) 78%, #fff 0%); stroke: color-mix(in srgb, var(--c) 70%, #000); }
.lc-key.used text { fill: #06192c; }
.lc-key .lc-cap { font-size: 9px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.lc-key.live rect, .lc-pad .live .lc-fill, .lc-phone .live .lc-fill { stroke: var(--mp-focus); stroke-width: 3.5; filter: brightness(1.18) drop-shadow(0 0 6px var(--c, #fff)); }
.lc-key.live { transform: translateY(2px); }
.lc-key.seen:not(.used) rect { fill: color-mix(in srgb, var(--mp-ink-2) 30%, transparent); }
.lc-key { transition: transform .06s ease; transform-box: fill-box; }
.lc-badge circle { fill: var(--c); stroke: var(--mp-glass-strong); stroke-width: 2; }
.lc-badge text { fill: #06192c; font-size: 12px; text-anchor: middle; dominant-baseline: central; }

.lc-pad .lc-body { fill: #fbf7ee; stroke: rgb(19 38 58 / .35); stroke-width: 2; }
html:not([data-look-theme='sand']) .lc-pad .lc-body { fill: #1b2a3c; stroke: rgb(255 255 255 / .22); }
.lc-pad .lc-fill { fill: var(--mp-kbd-bg); stroke: var(--mp-kbd-line); stroke-width: 1.5; }
.lc-pad .used .lc-fill { fill: color-mix(in srgb, var(--c) 80%, transparent); stroke: color-mix(in srgb, var(--c) 60%, #000); }
.lc-pad text { fill: var(--mp-ink); font-size: 14px; text-anchor: middle; dominant-baseline: central; }
.lc-pad .used text { fill: #06192c; }
.lc-pad .lc-face text { font-size: 17px; }
.lc-pad .lc-face .lc-fill { stroke-width: 2; }
.lc-pad .lc-knob { fill: var(--mp-glass-strong); stroke: var(--mp-kbd-line); stroke-width: 1.5; }
.lc-call { stroke: var(--c); stroke-width: 2; fill: none; stroke-dasharray: 3 3; opacity: .9; }

.lc-phone .lc-case { fill: #0b1018; stroke: #5b6878; stroke-width: 2; }
.lc-phone .lc-screen-sky { fill: url(#lc-sky); }
.lc-phone .lc-ground { fill: #c9b48a; }
.lc-phone .lc-road { fill: #4b5563; }
.lc-phone .lc-hud { fill: rgb(7 17 32 / .5); stroke: rgb(255 255 255 / .18); }
.lc-phone .lc-hud-t { fill: #f4f8fc; font-size: 12px; opacity: .8; }
.lc-phone .lc-fill { fill: rgb(7 17 32 / .56); stroke: rgb(255 255 255 / .35); stroke-width: 1.5; }
.lc-phone .used .lc-fill { fill: color-mix(in srgb, var(--c) 55%, rgb(7 17 32 / .5)); stroke: var(--c); stroke-width: 2.5; }
.lc-phone .lc-btn text { fill: #f4f8fc; font-size: 13px; letter-spacing: .1em; text-anchor: middle; dominant-baseline: central; text-transform: uppercase; }
.lc-phone .lc-btn .lc-arrow { font-size: 34px; letter-spacing: 0; }
.lc-phone .lc-btn { cursor: pointer; }


/* the special-actions card */
.lc-moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.lc-moves li { display: grid; gap: 6px; align-content: start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--mp-stroke); border-left: 4px solid var(--c, var(--accent)); background: var(--mp-well); }
.lc-moves b { color: var(--mp-ink); }
.lc-moves p { margin: 0; color: var(--mp-ink-2); font-size: .86rem; line-height: 1.45; }
.lc-moves .lc-binds { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.lc-links { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 14px; }

/* ---------------- tutorial ---------------- */
.tu-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: center; }
.tu-progress { display: grid; gap: 6px; min-width: 0; }
.tu-progress .pf-bar { height: 8px; }
.tu-progress p { margin: 0; color: var(--mp-ink-2); font-size: .86rem; }
.tu-progress b { color: var(--mp-ink); }
.tu-switches { display: grid; gap: 8px; justify-items: end; }
.tu-switch { display: flex; align-items: center; gap: 12px; color: var(--mp-ink); font-weight: 700; }
.tu-switch small { display: block; color: var(--mp-ink-2); font-weight: 600; font-size: .78rem; }
.tu-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tu-jump a {
  --a-ink: var(--a);
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--mp-stroke); background: var(--mp-well); color: var(--mp-ink); font-size: .8rem; font-weight: 800; letter-spacing: .06em;
}
html[data-look-theme='sand'] .tu-jump a { --a-ink: color-mix(in oklab, var(--a) 55%, #0d1b2a); }
.tu-jump a svg { width: 22px; height: 22px; color: var(--a-ink); }
.tu-jump a:hover { border-color: var(--a); }
.tu-jump a.read::after { content: '✓'; color: var(--mp-gold-ink); }

.tu-intro { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tu-intro .card { display: grid; gap: 10px; align-content: start; }
.tu-intro .card.wide { grid-column: span 2; }
.tu-intro h2 { margin-bottom: 4px !important; }
.tu-intro p, .tu-lesson p, .tu-intro li, .tu-lesson li { color: var(--mp-ink-2); line-height: 1.5; }
.tu-intro p, .tu-lesson p { margin: 0; }
.tu-intro b, .tu-lesson b, .tu-intro strong, .tu-lesson strong { color: var(--mp-ink); }
.tu-intro ul, .tu-intro ol, .tu-lesson ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.tu-fig { display: block; width: 100%; height: auto; max-height: 190px; }
.tu-fig text { font-family: Barlow, system-ui, sans-serif; font-weight: 800; fill: var(--mp-ink); font-size: 13px; }
.tu-fig .t2 { fill: var(--mp-ink-2); font-weight: 700; font-size: 11px; }
.tu-fig .ln { fill: none; stroke: var(--mp-ink-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tu-fig .well { fill: var(--mp-well); stroke: var(--mp-stroke); }
.tu-fig .acc { fill: var(--accent); }
.tu-fig .acc-s { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tu-fig .good { fill: #3ddc84; } .tu-fig .bad { fill: #ff4d5e; } .tu-fig .gold { fill: #ffd34d; } .tu-fig .blue { fill: #4da3ff; }
.tu-fig .good-s { fill: none; stroke: #2fbf6f; stroke-width: 3; stroke-linecap: round; }
.tu-fig .bad-s { fill: none; stroke: #ff4d5e; stroke-width: 3; stroke-linecap: round; }
.tu-fig .zone { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-dasharray: 5 4; }
.tu-fig .sand { fill: #d9c49a; } .tu-fig .sea { fill: #2a7fb8; } .tu-fig .road { fill: #56616f; } .tu-fig .turf { fill: #9a5b3c; }
.tu-fig .on-acc { fill: #06192c; }





.tu-lessons { display: grid; gap: 18px; }
.tu-lesson { --a-ink: var(--a); border-top: 3px solid var(--a); scroll-margin-top: 16px; display: grid; gap: 16px; }
html[data-look-theme='sand'] .tu-lesson { --a-ink: color-mix(in oklab, var(--a) 55%, #0d1b2a); }
.tu-lesson.target { box-shadow: 0 0 0 2px var(--a), var(--mp-shadow-sm); }
.tu-lesson header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.tu-lesson header h2 { margin: 0 !important; font-size: 1.25rem !important; letter-spacing: .12em !important; color: var(--mp-title) !important; }
.tu-lesson header h2::before { display: none !important; }
.tu-lesson header h2:focus { outline: none; }
.tu-lesson header p { color: var(--a-ink); font-weight: 800; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }
.tu-lesson .pf-icon { width: 52px; height: 52px; }
.tu-lesson .pf-icon svg { width: 36px; height: 36px; }
.tu-badge { padding: 4px 10px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; border: 1px solid var(--mp-stroke-2); color: var(--mp-ink-2); white-space: nowrap; }
.tu-badge.read { background: color-mix(in srgb, var(--a) 20%, transparent); border-color: var(--a); color: var(--mp-ink); }
.tu-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px 24px; align-items: start; }
.tu-col { display: grid; gap: 12px; min-width: 0; }
.tu-col h3 { margin: 0; color: var(--a-ink); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; }
.tu-figbox { padding: 10px; border-radius: 14px; background: var(--mp-well); border: 1px solid var(--mp-stroke); }
.tu-keys { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: .84rem; color: var(--mp-ink-2); }
.tu-keys li { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.tu-keys li b { margin-right: 4px; }
.tu-tasks { list-style: none !important; padding: 0 !important; }
.tu-tasks li::before { content: '○ '; color: var(--mp-gold-ink); }
.tu-models { list-style: none !important; padding: 0 !important; gap: 6px !important; }
.tu-models li { font-size: .86rem; }
.tu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding-top: 4px; border-top: 1px solid var(--mp-stroke); }
.tu-actions .race-btn { min-width: 0; padding: 14px 28px; font-size: 1rem; text-decoration: none; display: inline-block; }
.tu-actions .ghost-btn { cursor: pointer; }
.tu-actions [aria-pressed='true'] { border-color: var(--a); color: var(--mp-ink); background: color-mix(in srgb, var(--a) 18%, transparent); }

/* ---------------- narrower screens ---------------- */
@media (max-width: 899px) {
  .lc-modes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tu-intro { grid-template-columns: minmax(0, 1fr); }
  .tu-intro .card.wide { grid-column: auto; }
  .tu-body { grid-template-columns: minmax(0, 1fr); }
  .tu-top { grid-template-columns: minmax(0, 1fr); }
  .tu-switches { justify-items: start; }
}
@media (max-width: 599px) {
  .lc-modes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .lc-mode { font-size: .62rem; letter-spacing: .04em; padding: 8px 2px; }
  .lc-mode svg { width: 26px; height: 26px; }
  .lc-legend { grid-template-columns: minmax(0, 1fr); }
  .lc-inputs { width: 100%; }
  .lc-inputs button { flex: 1; justify-content: center; padding-inline: 6px; }
  .lc-inputs svg { display: none; }
  .tu-lesson header { grid-template-columns: auto minmax(0, 1fr); }
  .tu-lesson header .tu-badge { grid-column: 1 / -1; justify-self: start; }
  .tu-actions .race-btn { width: 100%; text-align: center; }
}
/* phone sideways: a smaller drawing so it fits the screen height */
@media (max-height: 480px) { .lc-figure { width: min(100%, 560px); } }
@media (prefers-reduced-motion: reduce) {
  .lc-key, .lc-legend li, .lc-mode { transition: none; }
  .lc-key.live, .lc-legend li.live { transform: none; }
}
