/* Atlantic Race Options and Profile pages (2026-10-25), linked after race.css and
   menu-polish.css. Uses only menu-polish's --mp-* tokens, so both pages follow the Dark
   (Storm) and Light (Coast Daylight, html[data-look-theme=sand]) themes.
   - Options: a console-style tab bar (Q/E or LB/RB), preset cards for picture quality,
     controls reference tables, gamepad button chips.
   - Profile: a racer hero with a completion ring, career tiles, a card per race mode with
     its six stage pips, and medals.
   - Accessibility: html[data-motion=reduce] (Options > Accessibility, or the computer's
     setting) stops animations; html[data-text=large] enlarges the type. */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.page-main { width: min(1080px, 100%); }
.card > h2 + .note, .card .note { margin: 12px 0 0; font-size: .86rem; }
.card h3 { margin: 0; }
.st-small { padding: 8px 14px; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.row .label { min-width: 0; }
.row small { line-height: 1.4; margin-top: 2px; }
.segmented button { white-space: nowrap; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.page-actions .ghost-btn { cursor: pointer; }

/* ---------------- Options: the tab bar ---------------- */
.st-tabbar {
  position: sticky; top: 8px; z-index: 5;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 6px; border-radius: 16px; border: 1px solid var(--mp-stroke);
  background: var(--mp-glass-strong); box-shadow: var(--mp-hi), var(--mp-shadow-sm);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
}
.st-shoulder { display: inline-flex; padding: 0 4px; }
.st-shoulder kbd { min-width: 30px; text-align: center; }
.st-shoulder .k-pad, html[data-input='gamepad'] .st-shoulder .k-key { display: none; }
html[data-input='gamepad'] .st-shoulder .k-pad { display: inline-block; }
.st-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; scroll-padding: 0 12px; padding: 2px; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tabs [role='tab'] {
  flex: 1 0 auto; padding: 11px 16px; border: 0; border-radius: 11px; cursor: pointer;
  background: transparent; color: var(--mp-ink-2); font: inherit; font-weight: 800; font-size: .86rem;
  letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.st-tabs [role='tab']:hover { color: var(--mp-ink); background: var(--mp-well); }
.st-tabs [role='tab'][aria-selected='true'] {
  background: var(--accent); color: var(--mp-on-accent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 38%, transparent);
}
.st-tabs [role='tab']:focus-visible { outline-offset: -3px; }

.st-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.st-panel[hidden] { display: none; }
.st-panel > .card:only-child, #panel-graphics > .card:first-child, #panel-controls > .card:first-child, #panel-display > .card { grid-column: 1 / -1; }
#panel-controls > .card:nth-child(2) { grid-column: 1 / -1; }
#panel-controls > .card:last-child { grid-column: 1 / -1; }
#panel-graphics > .card:nth-child(2) { grid-column: 1 / -1; }
#panel-audio > .card { grid-column: auto; }
@media (min-width: 900px) {
  #panel-gameplay > .card, #panel-access > .card { grid-column: 1 / -1; max-width: 860px; }
}

/* the audio tab while muted: the sliders keep their values, faded */
.is-muted .slider { opacity: .45; }

/* ---------------- Options: picture presets ---------------- */
.st-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.st-preset {
  display: grid; align-content: start; gap: 10px; padding: 16px; border-radius: 14px; cursor: pointer; text-align: left; font: inherit;
  background: var(--mp-card); border: 1px solid var(--mp-stroke); color: var(--mp-ink-2); box-shadow: var(--mp-hi);
  transition: transform .18s var(--mp-ease), border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.st-preset:hover { transform: translateY(-2px); border-color: var(--mp-stroke-2); background: var(--mp-card-hover); }
.st-preset[aria-checked='true'] { border-color: var(--accent); color: var(--mp-ink); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px color-mix(in srgb, var(--accent) 22%, transparent); }
.st-preset-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.st-preset b { color: var(--mp-ink); font-size: 1.15rem; letter-spacing: .1em; text-transform: uppercase; }
.st-preset small { font-weight: 500; font-size: .86rem; line-height: 1.45; }
.st-reco { padding: 3px 8px; border-radius: 999px; font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--mp-gold-ink); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.st-reco[hidden] { display: none; }
.st-meter { display: flex; gap: 4px; }
.st-meter i { width: 22px; height: 6px; border-radius: 3px; background: var(--mp-track); }
.st-preset[data-value='fast'] .st-meter i:nth-child(-n+1),
.st-preset[data-value='high'] .st-meter i:nth-child(-n+2),
.st-preset[data-value='ultra'] .st-meter i { background: var(--accent); }
.st-detected { min-height: 1.4em; }

/* ---------------- Options: theme cards ---------------- */
.st-mode-tag { justify-self: start; font-style: normal; font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--mp-gold-ink); }

/* ---------------- Options: controls reference ---------------- */
.st-table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.st-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.st-table th, .st-table td { padding: 10px 10px; text-align: left; vertical-align: middle; border-top: 1px solid var(--mp-stroke); }
.st-table thead th { border-top: 0; padding-top: 0; color: var(--mp-ink-2); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 800; }
.st-table tbody th { color: var(--mp-ink); font-weight: 700; white-space: nowrap; }
.st-table th small, .st-table td small { display: block; color: var(--mp-ink-2); font-weight: 500; font-size: .76rem; white-space: normal; margin-top: 2px; }
.st-table td { color: var(--mp-ink-2); }
.st-table td.none { opacity: .5; }
.st-table kbd { margin: 0 2px; }
.pad, .tap {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; margin: 0 2px; padding: 0 7px;
  border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; line-height: 1; white-space: nowrap;
  background: var(--mp-kbd-bg); border: 1px solid var(--mp-kbd-line); color: var(--mp-ink);
}
.tap { border-radius: 8px; border-style: dashed; }
.pad-a { background: #3aa655; border-color: #3aa655; color: #fff; }
.pad-b { background: #d94141; border-color: #d94141; color: #fff; }
.pad-x { background: #2f7fe0; border-color: #2f7fe0; color: #fff; }
.pad-y { background: #e6b422; border-color: #e6b422; color: #1a1a1a; }
.st-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.st-mode { padding: 14px; border-radius: 14px; background: var(--mp-well); border: 1px solid var(--mp-stroke); border-top: 3px solid var(--a); }
.st-mode h3 { display: flex; align-items: center; gap: 10px; font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mp-ink); }
.st-mode h3 svg { width: 28px; height: 28px; flex: none; color: var(--a); }
html[data-look-theme='sand'] .st-mode h3 svg { color: color-mix(in oklab, var(--a) 55%, #0d1b2a); }
.st-mode ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.st-mode li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; font-size: .86rem; }
.st-mode li.none { opacity: .6; }
.st-act { color: var(--mp-ink); font-weight: 700; }
.st-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--mp-ink-2); }
.st-mode-link { display: inline-block; margin-top: 10px; color: var(--mp-gold-ink); font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; border-radius: 6px; }
.st-mode-link:hover { text-decoration: underline; }
.st-binds { color: var(--mp-ink-2); display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; }

/* ---------------- Profile: hero ---------------- */
.pf-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.pf-who { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.pf-who .player-sub { margin: 0; }
.pf-title { margin: 0; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--mp-gold-ink); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pf-who .ghost-btn { margin-top: 6px; }
.pf-ring { position: relative; width: 132px; height: 132px; flex: none; }
.pf-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pf-ring circle { fill: none; stroke-width: 10; }
.pf-ring-track { stroke: var(--mp-track); }
.pf-ring-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray .8s var(--mp-ease); }
.pf-ring > span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.pf-ring b { color: var(--mp-title); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.pf-ring small { color: var(--mp-ink-2); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; margin-top: 4px; }

/* ---------------- Profile: career tiles ---------------- */
.pf-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pf-tiles .tile b small { font-size: .55em; color: var(--mp-ink-2); font-weight: 700; margin-left: 2px; }

/* ---------------- Profile: race modes ---------------- */
.pf-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pf-mode {
  --a-ink: var(--a);
  display: grid; gap: 12px; padding: 16px; border-radius: 14px; min-width: 0;
  background: var(--mp-card); border: 1px solid var(--mp-stroke); box-shadow: var(--mp-hi); border-top: 3px solid var(--a);
}
html[data-look-theme='sand'] .pf-mode { --a-ink: color-mix(in oklab, var(--a) 55%, #0d1b2a); }
.pf-mode header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.pf-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--a-ink); background: color-mix(in srgb, var(--a) 16%, transparent); border: 1px solid color-mix(in srgb, var(--a) 40%, transparent); }
.pf-icon svg { width: 30px; height: 30px; }
.pf-mode h3 { font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mp-ink); overflow-wrap: anywhere; }
.pf-pct { color: var(--mp-ink); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.pf-bar { height: 8px; border-radius: 4px; background: var(--mp-track); overflow: hidden; }
.pf-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--a, var(--accent)); min-width: 0; transition: width .6s var(--mp-ease); }
.pf-pips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.pf-pip { display: grid; justify-items: center; gap: 4px; padding: 7px 2px 6px; border-radius: 10px; border: 1px solid var(--mp-stroke); background: var(--mp-well); color: var(--mp-ink-2); }
.pf-pip b { font-size: .9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.pf-pip i { display: flex; gap: 3px; }
.pf-pip em { width: 6px; height: 6px; border-radius: 50%; background: var(--mp-track); }
.pf-pip em.on { background: var(--mp-gold-ink); }
.pf-pip.won { background: var(--a); border-color: var(--a); color: #0b1a28; }
.pf-pip.won em { background: rgb(11 26 40 / .25); }
.pf-pip.won em.on { background: #0b1a28; }
.pf-pip.cleared { border: 2px solid var(--a); color: var(--mp-ink); }
.pf-pip.open { color: var(--mp-ink); border-style: solid; }
.pf-pip.locked { opacity: .45; border-style: dashed; }
.pf-sum { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; color: var(--mp-ink-2); font-size: .84rem; }
.pf-sum b { color: var(--mp-ink); font-variant-numeric: tabular-nums; }
.pf-mode details { border-top: 1px solid var(--mp-stroke); padding-top: 8px; }
.pf-mode summary { cursor: pointer; color: var(--a-ink); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; border-radius: 6px; width: max-content; }
.pf-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .84rem; }
.pf-table th, .pf-table td { padding: 6px 6px; text-align: left; border-top: 1px solid var(--mp-stroke); color: var(--mp-ink-2); font-variant-numeric: tabular-nums; }
.pf-table thead th { border-top: 0; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; }
.pf-table tbody th { color: var(--mp-ink); font-weight: 700; }
.pf-table td:last-child, .pf-table th:last-child { text-align: right; }
.pf-table tr.won td:nth-child(2) { color: var(--a-ink); font-weight: 800; }
.pf-table tr.locked { opacity: .55; }
.pf-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 0 0; color: var(--mp-ink-2); font-size: .8rem; }
.pf-key { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--mp-stroke-2); background: var(--mp-well); margin-left: 8px; }
.pf-key:first-child { margin-left: 0; }
.pf-key.won { background: var(--accent); border-color: var(--accent); }
.pf-key.cleared { border: 2px solid var(--accent); }
.pf-key.locked { opacity: .5; border-style: dashed; }

/* ---------------- Profile: medals ---------------- */
.pf-count { margin-left: auto; color: var(--mp-ink-2); letter-spacing: .1em; font-size: .78rem; }
.pf-medals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pf-medal { --m: #c98a4b; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--mp-well); border: 1px solid var(--mp-stroke); }
.pf-medal.silver { --m: #b9c6d2; }
.pf-medal.gold { --m: #ffc93d; }
.pf-badge svg { width: 44px; height: 44px; display: block; }
.pf-badge circle { fill: var(--mp-track); stroke: var(--mp-stroke-2); stroke-width: 1.5; }
.pf-badge .ribbon { fill: var(--mp-track); }
.pf-badge .lock { fill: none; stroke: var(--mp-ink-2); stroke-width: 2; stroke-linejoin: round; }
.pf-medal.got { border-color: color-mix(in srgb, var(--m) 55%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--m) 16%, transparent), var(--mp-well)); }
.pf-medal.got .pf-badge circle { fill: var(--m); stroke: color-mix(in srgb, var(--m) 60%, #000); }
.pf-medal.got .pf-badge .ribbon { fill: var(--accent); }
.pf-badge .tick { fill: none; stroke: #13263a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pf-medal-text { display: grid; gap: 3px; min-width: 0; }
.pf-medal-text b { color: var(--mp-ink); font-size: .92rem; letter-spacing: .04em; }
.pf-medal-text small { color: var(--mp-ink-2); font-weight: 500; font-size: .8rem; line-height: 1.35; }
.pf-medal-text em { font-style: normal; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--mp-ink-2); }
.pf-medal.got .pf-medal-text em { color: var(--mp-gold-ink); }
.pf-medal .pf-bar { height: 5px; margin-top: 2px; --a: var(--mp-ink-2); }
.pf-medal:not(.got) .pf-medal-text b { color: var(--mp-ink-2); }
#edit { scroll-margin-top: 16px; }

/* ---------------- phones ---------------- */
@media (max-width: 899px) {
  .st-panel { grid-template-columns: minmax(0, 1fr); }
  .st-panel > .card { grid-column: 1 / -1; }
  .st-presets { grid-template-columns: minmax(0, 1fr); }
  .pf-hero { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .pf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .st-tabbar { grid-template-columns: minmax(0, 1fr); top: 4px; padding: 4px; }
  .st-shoulder { display: none; }
  .st-tabs [role='tab'] { padding: 10px 12px; font-size: .78rem; }
  .row .segmented { justify-self: start; max-width: 100%; }
  .pf-hero .player-card { grid-template-columns: auto minmax(0, 1fr); gap: 16px; }
  .pf-hero .avatar-big { width: 96px; height: 96px; }
  .pf-ring { width: 112px; height: 112px; }
  .pf-modes, .pf-medals { grid-template-columns: minmax(0, 1fr); }
  .st-table { font-size: .84rem; }
  .st-table th, .st-table td { padding: 8px 6px; }
  .st-table tbody th { white-space: normal; }
  .tile b { font-size: 1.6rem; }
}

/* ---------------- accessibility ---------------- */
html[data-motion='reduce'] *, html[data-motion='reduce'] *::before, html[data-motion='reduce'] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html[data-motion='reduce']::view-transition-old(root), html[data-motion='reduce']::view-transition-new(root) { animation: none !important; }
html[data-text='large'] { font-size: 112.5%; }
html[data-text='large'] body { font-size: 18px; }
html[data-text='large'] .row small, html[data-text='large'] .st-preset small, html[data-text='large'] .pf-medal-text small { font-size: .92rem; }
/* (2026-11-18) a PlayStation-style pad (pad-map.js): ✕ blue, ○ red, □ pink, △ green */
html[data-pad-family="ps"] .pad-a { background: #3a7bd5; border-color: #3a7bd5; color: #fff; }
html[data-pad-family="ps"] .pad-b { background: #e0464e; border-color: #e0464e; color: #fff; }
html[data-pad-family="ps"] .pad-x { background: #d36fb5; border-color: #d36fb5; color: #fff; }
html[data-pad-family="ps"] .pad-y { background: #2fa889; border-color: #2fa889; color: #fff; }
