/* 疯狂单车 · 菜单 v2
 *
 * 尺寸系统：所有尺寸都写成「设计稿像素 × --u」。--u 是 1 个设计像素在当前屏幕上的大小，
 * 取宽、高两个方向缩放比的较小值，所以整页永远完整落在窗口内、比例不变，不会再出现标题压到卡片上。
 *   横屏（宽 ≥ 高）：设计稿 1920 × 1080
 *   竖屏（宽 < 高）：设计稿 430 × 932
 *   手机横屏（高 ≤ 540）：设计稿 900 × 420，布局更紧凑
 * 小字另设像素下限，保证在很小的窗口里仍可读。 */

@property --cb-scene-halo { syntax: "<color>"; inherits: true; initial-value: #efba872f; }
@property --cb-scene-tone { syntax: "<color>"; inherits: true; initial-value: #3e465e; }
.cb-menu {
  --u: min(calc(100vw / 1920), calc(100svh / 1080));
  --cb-cream: #fff4dc;
  --cb-muted: #d4e0e9;
  --cb-stroke: #bdced66e;
  --cb-glass: linear-gradient(143deg, #425467e8 0%, #2c3e50ed 48%, #1e2d3fef 100%);
  --cb-gold: linear-gradient(123deg, #fbe9bd 0%, #ecc989 61%, #dcab73 100%);
  --cb-scene-tone: #3e465e;
  --cb-scene-halo: #efba872f;
  --cb-ease: cubic-bezier(.2, .75, .25, 1);
  --cb-dir: 1;

  --edge: calc(84 * var(--u));
  --top: calc(46 * var(--u));
  --bottom: calc(40 * var(--u));
  --btn-h: calc(58 * var(--u));
  --btn-font: max(13px, calc(21 * var(--u)));
  --title: max(22px, calc(58 * var(--u)));
  --round: calc(20 * var(--u));
  --card-w: calc(880 * var(--u));
  --card-h: calc(600 * var(--u));
  --dock-w: var(--card-w);
  --dock-h: calc(108 * var(--u));
  --race-w: calc(316 * var(--u));
  --race-h: calc(74 * var(--u));
  --race-font: max(16px, calc(31 * var(--u)));

  position: relative;
  block-size: 100svh;
  inline-size: 100%;
  overflow: hidden;
  isolation: isolate;
  background: var(--cb-scene-tone);
  color: var(--cb-cream);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}
.cb-menu:lang(ja) { font-family: "Yu Gothic UI", "Hiragino Sans", "Noto Sans CJK JP", "Microsoft YaHei UI", system-ui, sans-serif; }
.cb-menu:lang(ko) { font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK KR", system-ui, sans-serif; }
.cb-menu {
  transition: background-color 600ms ease, --cb-scene-halo 600ms ease, --cb-scene-tone 600ms ease;
}

.cb-menu *, .cb-menu *::before, .cb-menu *::after { box-sizing: border-box; }
.cb-menu [hidden] { display: none !important; }
.cb-menu button { appearance: none; margin: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cb-menu button:focus-visible, .cb-menu input:focus-visible + span, .cb-menu .cb-field:focus-visible { outline: 2px solid #fff0bb; outline-offset: 3px; }
.cb-menu button:disabled { cursor: default; opacity: .57; }
.cb-visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.cb-view { position: absolute; inset: 0; isolation: isolate; display: flex; flex-direction: column; }

/* ---- Shared surfaces --------------------------------------------------------------------- */
.cb-menu .cb-surface {
  border: 1px solid var(--cb-stroke);
  border-radius: var(--round);
  background: repeating-linear-gradient(134deg, #eeffff02 0 1px, transparent 1px 5px), var(--cb-glass);
  box-shadow: inset 0 1px 2px #effaff33, inset 0 -1px 1px #07141f35, 0 6px 18px #14223330;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.cb-menu .cb-gold {
  display: flex; align-items: center; justify-content: space-between; gap: .6em;
  padding: 0 calc(30 * var(--u)) 1px;
  border: 1px solid #fff2c8;
  border-radius: calc(18 * var(--u));
  background: var(--cb-gold);
  color: #372919;
  box-shadow: inset 0 2px 2px #fffae790, inset 0 -2px 5px #9c6b3342, 0 3px 6px #121c2530;
  font-weight: 900; white-space: nowrap;
  transition: filter 160ms ease, transform 160ms ease;
}
.cb-menu .cb-gold:not(:disabled):active, .cb-menu .cb-surface:is(button):active { transform: scale(.97); }
@media (hover: hover) {
  .cb-menu button:not(:disabled):hover.cb-gold, .cb-menu button:hover.cb-surface, .cb-menu .cb-links button:hover { filter: brightness(1.09); }
}
.cb-caret { display: inline-block; flex: 0 0 auto; inline-size: .58em; block-size: .58em; border-block-start: .1em solid currentColor; border-inline-end: .1em solid currentColor; margin-inline: .12em .22em; transform: rotate(45deg); }
.cb-caret-back { transform: rotate(-135deg); }

.cb-backdrop, .cb-scene-shade, .cb-home-art, .cb-home-shade, .cb-rider-shade { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; z-index: -1; }
.cb-backdrop { overflow: hidden; }
/* Track backdrops (bg-*.webp) are colour-graded and blurred ahead of time: a CSS filter on a full-screen
 * image re-rasterises on every swap and was the main source of stutter when flicking through tracks. */
.cb-backdrop img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; opacity: 0; transform: scale(1.022); transition: opacity 620ms cubic-bezier(.33, 0, .2, 1); will-change: opacity; }
.cb-backdrop img[data-under="true"] { opacity: 1; transition: none; }
.cb-backdrop img[data-current="true"] { opacity: 1; }
.cb-scene-shade { background: radial-gradient(ellipse at 59% 39%, var(--cb-scene-halo), transparent 61%), linear-gradient(180deg, #12243c87, #19283b2e 26%, #162b3b64 63%, #132132e5); }

/* ---- Page header (tracks, riders): in normal flow, three columns ------------------------------ */
.cb-header {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: calc(20 * var(--u));
  padding: max(var(--top), calc(env(safe-area-inset-top, 0px) + 10px)) max(var(--edge), env(safe-area-inset-right, 0px)) 0 max(var(--edge), env(safe-area-inset-left, 0px));
}
.cb-header h1 { grid-column: 2; margin: 0; outline: none; color: #fff8eb; text-align: center; text-shadow: 0 4px 14px #14213380; font-size: var(--title); font-weight: 900; line-height: 1.12; letter-spacing: .035em; white-space: nowrap; }
.cb-header > :first-child { justify-self: start; }
.cb-header > :last-child { justify-self: end; }
.cb-menu .cb-back-button, .cb-menu .cb-rider-chip, .cb-summary { display: inline-flex; align-items: center; block-size: var(--btn-h); font-size: var(--btn-font); font-weight: 820; text-align: start; }
.cb-menu .cb-back-button { gap: .7em; padding-inline: .9em 1.1em; }
.cb-menu .cb-rider-chip { gap: .6em; max-inline-size: 100%; block-size: auto; min-block-size: var(--btn-h); padding: .08em .9em .08em calc(var(--btn-h) * .12); }
.cb-rider-chip img { block-size: calc(var(--btn-h) * .78); inline-size: auto; }
.cb-rider-chip img { aspect-ratio: 1; border-radius: 24%; background: #f5f3e9; object-fit: cover; }
.cb-rider-chip strong, .cb-rider-chip small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-rider-chip strong { font-size: 1em; font-weight: 850; line-height: 1.12; }
.cb-rider-chip small { margin-block-start: .15em; color: var(--cb-muted); font-size: max(11px, .76em); line-height: 1.08; font-weight: 700; }
.cb-rider-chip .cb-caret { margin-inline-start: .2em; color: #e7ecef; }
.cb-summary { margin: 0; padding-inline: 1em; color: var(--cb-muted); font-weight: 760; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-inline-size: 100%; }

/* ---- Home -------------------------------------------------------------------------------- */
.cb-home { background: #1c324d; }
.cb-home-art { object-fit: cover; object-position: center; }
.cb-icon { inline-size: 1.2em; block-size: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cb-caret-down { transform: rotate(135deg); inline-size: .45em; block-size: .45em; margin: -.25em .1em 0 .15em; opacity: .8; }
.cb-lang[aria-expanded="true"] .cb-caret-down { transform: rotate(-45deg); margin-block: .25em 0; }

/* ---- Home: logo top-left, tool pill top-right, one glass dock centred at the bottom ------------ */
.cb-home-art { overflow: hidden; }
.cb-home-art img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; object-position: 62% 50%; opacity: 0; transition: opacity 1.8s ease-in-out; will-change: opacity, scale; backface-visibility: hidden; }
.cb-home-art img[data-current] { opacity: 1; z-index: 1; }
.cb-home-art img:is([data-current], [data-leaving]) { animation: cb-drift 10s linear both; }
@keyframes cb-drift { from { scale: 1.06; } to { scale: 1; } }
.cb-home-shade { background: linear-gradient(0deg, #0c1727e6 0%, #0c1727c4 9%, #0c172788 17%, #0c172740 25%, #0c172714 32%, transparent 38%), radial-gradient(40% 34% at 16% 14%, #0c172770, transparent 70%); }
.cb-logo { position: absolute; margin: 0; inset-inline-start: max(calc(56 * var(--u)), env(safe-area-inset-left, 0px)); inset-block-start: max(calc(30 * var(--u)), env(safe-area-inset-top, 0px)); inline-size: calc(520 * var(--u)); }
.cb-logo img { display: block; inline-size: 100%; block-size: auto; filter: drop-shadow(0 calc(10 * var(--u)) calc(16 * var(--u)) #06101f90); }
.cb-home-tools { position: absolute; z-index: 3; inset-block-start: max(var(--top), calc(env(safe-area-inset-top, 0px) + 10px)); inset-inline-end: max(var(--edge), env(safe-area-inset-right, 0px)); display: flex; align-items: center; padding: calc(4 * var(--u)); border: 1px solid #ffffff24; border-radius: 99px; background: #0c172766; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cb-menu .cb-tool { display: flex; align-items: center; gap: .45em; block-size: max(34px, calc(50 * var(--u))); padding-inline: 1em; border-radius: 0; color: #eef3f7; font-size: max(13px, calc(20 * var(--u))); font-weight: 820; white-space: nowrap; }
.cb-home-tools > * + * { border-inline-start: 1px solid #ffffff24; }
.cb-home-tools > :first-child, .cb-home-tools > :first-child .cb-tool { border-radius: 99px 0 0 99px; }
.cb-home-tools > :last-child { border-radius: 0 99px 99px 0; }
.cb-music[aria-pressed="false"] { opacity: .55; }
.cb-music[aria-pressed="false"] span { text-decoration: line-through; }
@media (hover: hover) { .cb-menu .cb-tool:hover { background: #ffffff14; } }
.cb-icon { inline-size: 1.2em; block-size: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cb-home-dock { position: absolute; inset-inline-start: 50%; inset-block-end: max(calc(48 * var(--u)), calc(env(safe-area-inset-bottom, 0px) + 30px)); translate: -50% 0; display: flex; align-items: center; gap: calc(10 * var(--u)); padding: calc(12 * var(--u)); border-radius: calc(30 * var(--u)); }
.cb-home-tiles { display: flex; gap: calc(10 * var(--u)); }
.cb-home-tiles > *, .cb-home-start, .cb-home-sep { flex-shrink: 0; }
.cb-menu .cb-home-tile { white-space: nowrap; }
.cb-menu .cb-home-tile { position: relative; display: grid; justify-items: center; align-content: center; gap: calc(8 * var(--u)); inline-size: auto; min-inline-size: calc(96 * var(--u)); padding-inline: .5em; block-size: calc(96 * var(--u)); border: 1px solid #ffffff14; border-radius: calc(20 * var(--u)); background: #ffffff0d; color: #eef3f7; font-size: max(12px, calc(19 * var(--u))); font-weight: 840; transition: background-color 160ms ease, transform 160ms var(--cb-ease); }
.cb-home-tile .cb-icon { inline-size: calc(36 * var(--u)); block-size: calc(36 * var(--u)); color: #ffdda0; stroke-width: 1.6; }
.cb-home-tile small { position: absolute; inset-block-start: calc(-10 * var(--u)); inset-inline-end: calc(-10 * var(--u)); padding: .1em .55em; border-radius: 99px; background: var(--cb-gold); color: #3c2e1e; font-size: max(10px, calc(15 * var(--u))); font-weight: 900; box-shadow: 0 3px 8px #0a142566; }
.cb-home-tile small:empty { display: none; }
@media (hover: hover) { .cb-menu .cb-home-tile:hover { background: #ffffff1f; transform: translateY(calc(-3 * var(--u))); } }
.cb-home-sep { inline-size: 1px; block-size: calc(70 * var(--u)); margin-inline: calc(8 * var(--u)); background: #d3e0ec33; }
.cb-menu .cb-home-start { position: relative; overflow: hidden; inline-size: auto; min-inline-size: calc(330 * var(--u)); white-space: nowrap; block-size: calc(96 * var(--u)); padding-inline: calc(34 * var(--u)) calc(26 * var(--u)); border-radius: calc(20 * var(--u)); font-size: max(17px, calc(32 * var(--u))); box-shadow: inset 0 2px 2px #fffae790, inset 0 -3px 6px #9c6b3342, 0 6px 14px #0a142566; }
.cb-home-start::after { content: ""; position: absolute; inset: -20% auto -20% -40%; inline-size: 26%; background: linear-gradient(100deg, transparent, #fffdf3c4, transparent); transform: skewX(-20deg); animation: cb-sweep 3.6s ease-in-out infinite; pointer-events: none; }
@keyframes cb-sweep { 0%, 55% { translate: 0 0; } 100% { translate: 620% 0; } }
.cb-home-start .cb-caret { animation: cb-nudge 1.8s ease-in-out infinite; }
@keyframes cb-nudge { 50% { translate: calc(5 * var(--u)) 0; } }
.cb-home-version { position: absolute; margin: 0; inset-inline-end: max(var(--edge), env(safe-area-inset-right, 0px)); inset-block-end: calc(10 * var(--u)); color: #ffffff80; font-size: max(10px, calc(13 * var(--u))); font-weight: 700; letter-spacing: .08em; }

/* Age rating badge (bottom-left) and the health notice (one quiet line under the dock) */
.cb-age { position: absolute; inset-inline-start: max(var(--edge), env(safe-area-inset-left, 0px)); border-color: #fff2c880 !important; inset-block-end: max(calc(60 * var(--u)), calc(env(safe-area-inset-bottom, 0px) + 30px)); display: flex; align-items: stretch; overflow: hidden; border: 1px solid #ffffff40; border-radius: calc(10 * var(--u)); background: #0c172799; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); line-height: 1; pointer-events: none; }
.cb-age b { display: grid; place-items: center; padding: calc(8 * var(--u)) calc(12 * var(--u)); background: var(--cb-gold); color: #3c2e1e; box-shadow: inset 0 1px 1px #fffae7a0; font-size: max(13px, calc(24 * var(--u))); font-weight: 950; }
.cb-age small { display: grid; place-items: center; padding-inline: calc(12 * var(--u)); color: #eef3f7; font-size: max(10px, calc(15 * var(--u))); font-weight: 800; }
.cb-health { position: absolute; inset-inline: 0; inset-block-end: max(calc(10 * var(--u)), env(safe-area-inset-bottom, 0px)); margin: 0; text-align: center; color: #ffffffa8; font-size: max(10px, calc(13 * var(--u))); font-weight: 650; letter-spacing: .04em; text-shadow: 0 1px 3px #000c; pointer-events: none; }
.cb-health-line { display: inline-block; margin-inline: .5em; }
.cb-health-line > span { white-space: nowrap; }
.cb-menu:not(:lang(zh-CN), :lang(ja)) .cb-health-line > span + span { margin-inline-start: .35em; }
.cb-home-legal { display: contents; }
.cb-age-inline { display: none !important; }
/* Bottom group: the dock with the health notice under it, the notice never wider than the dock. */
.cb-home-bottom { position: absolute; inset-inline-start: 50%; translate: -50% 0; inset-block-end: max(calc(14 * var(--u)), calc(env(safe-area-inset-bottom, 0px) + 6px)); display: flex; flex-direction: column; gap: calc(12 * var(--u)); inline-size: max-content; max-inline-size: calc(100% - 2 * var(--edge)); }
.cb-home-bottom .cb-home-dock { position: static; translate: none; }
.cb-home-bottom .cb-health { position: static; inline-size: 0; min-inline-size: 100%; white-space: nowrap; overflow: hidden; letter-spacing: 0; }
.cb-home-bottom .cb-health-line { margin: 0; }
.cb-menu:not(:lang(zh-CN), :lang(ja), :lang(ko)) .cb-home-bottom .cb-health-line + .cb-health-line { margin-inline-start: .6em; }
/* Language drop-down */
.cb-picker { position: relative; }
.cb-lang-menu { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; z-index: 5; min-inline-size: max(180px, calc(230 * var(--u))); max-block-size: min(70svh, 420px); overflow-y: auto; margin: 0; padding: 6px; list-style: none; border-radius: max(12px, calc(18 * var(--u))); outline: none; animation: cb-pop 180ms var(--cb-ease); }
.cb-lang-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; color: var(--cb-muted); font-size: max(14px, calc(18 * var(--u))); font-weight: 780; cursor: pointer; }
.cb-lang-option[aria-selected="true"] { color: #ffdda0; }
.cb-lang-option[aria-selected="true"]::after { content: "✓"; }
.cb-lang-option[data-active], .cb-lang-option:hover { background: #ffffff14; color: var(--cb-cream); }
.cb-lang-menu:focus-visible .cb-lang-option[data-active] { outline: 2px solid #fff0bb; outline-offset: -2px; }


/* ---- Tracks -------------------------------------------------------------------------------- */
.cb-carousel { position: relative; flex: none; block-size: var(--card-h); margin-block-start: auto; isolation: isolate; touch-action: pan-y; user-select: none; -webkit-user-select: none; --cb-drag-x: 0px; }
.cb-menu .cb-card {
  --cb-x: 0; --cb-y: 0px; --cb-scale: 1; --cb-angle: 0deg;
  position: absolute; inset: 50% auto auto 50%; z-index: 4;
  inline-size: var(--card-w); block-size: 100%;
  container-type: inline-size;
  padding: calc(6 * var(--u));
  border: 1px solid #c0d2d899;
  border-radius: calc(36 * var(--u));
  background-color: #475b6e;
  background-image: linear-gradient(145deg, #a8b9c3, #587085 62%, #8397a9);
  color: var(--cb-cream); text-align: start;
  box-shadow: inset 0 1px 2px #f4fbff77, 0 15px 30px #111b2c4d;
  transform: translate3d(calc(-50% + var(--card-w) * var(--cb-x) + var(--cb-drag-x)), calc(-50% + var(--cb-y)), 0) perspective(1500px) rotateY(var(--cb-angle)) scale(var(--cb-scale));
  transition: transform 320ms cubic-bezier(.22, .8, .3, 1), opacity 260ms ease;
  will-change: transform;
  backface-visibility: hidden;
}
.cb-menu .cb-card[aria-current="true"] { cursor: default; background-image: var(--cb-card-rim); border-color: #edf2daaf; box-shadow: inset 0 0 0 2px #fff8e056, 0 19px 42px #0c172c84, 0 4px 26px var(--cb-card-halo); }
/* Flowing light around the selected card's rim. A large conic gradient spins (transform only, so the
 * compositor runs it without repainting) inside a frame masked down to the card's border. */
.cb-rim { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; padding: calc(6 * var(--u)); pointer-events: none; opacity: 0; transition: opacity 300ms ease;
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.cb-rim::before { content: ""; position: absolute; inset-block-start: 50%; inset-inline-start: 50%; inline-size: 150%; aspect-ratio: 1; translate: -50% -50%;
  background: conic-gradient(transparent 0deg, #fff6d6 28deg, #ffd28a 52deg, transparent 96deg, transparent 180deg, #bfefff 212deg, #fff6d6 232deg, transparent 276deg);
  animation: cb-spin 5.5s linear infinite; will-change: transform; }
.cb-card[aria-current="true"] .cb-rim { opacity: 1; }
.cb-carousel[data-dragging="true"] .cb-rim::before { animation-play-state: paused; }
@keyframes cb-spin { to { rotate: 360deg; } }
.cb-card[data-slot="-1"], .cb-card[data-slot="1"] { --cb-y: calc(var(--card-h) * .031); --cb-scale: .855; z-index: 3; opacity: .93; }
/* Side cards are dimmed with an overlay (opacity animates on the compositor) rather than a filter. */
.cb-menu .cb-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: #0b1626; opacity: .14; pointer-events: none; transition: opacity 300ms ease; }
.cb-menu .cb-card[aria-current="true"]::after { opacity: 0; }
.cb-card[data-slot="-1"] { --cb-x: -.536; --cb-angle: 19deg; }
.cb-card[data-slot="1"] { --cb-x: .536; --cb-angle: -19deg; }
.cb-card[data-slot="-2"], .cb-card[data-slot="2"], .cb-card[data-slot="out-left"], .cb-card[data-slot="out-right"] { --cb-y: calc(var(--card-h) * .052); --cb-scale: .693; z-index: 1; opacity: .46; }
.cb-card[data-slot="-2"], .cb-card[data-slot="out-left"] { --cb-x: -.941; --cb-angle: 25deg; }
.cb-card[data-slot="2"], .cb-card[data-slot="out-right"] { --cb-x: .941; --cb-angle: -25deg; }
.cb-card[aria-hidden="true"] { visibility: hidden; opacity: 0; pointer-events: none; }
.cb-carousel[data-dragging="true"] .cb-card { transition: none; cursor: grabbing; }
.cb-card-content { display: grid; grid-template-rows: minmax(0, 2.16fr) minmax(0, 1fr); block-size: 100%; overflow: hidden; border: 1px solid #243443a6; border-radius: calc(30 * var(--u)); background: linear-gradient(146deg, #3a4d5f, #283b4d 60%, #233546); box-shadow: inset 0 0 0 1px #223043; }
.cb-cover { position: relative; display: block; overflow: hidden; border-block-end: 1px solid #eff5f16e; }
.cb-cover img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; pointer-events: none; }
.cb-chapter { position: absolute; inset: 2.6cqw auto auto 2.6cqw; padding: .51em .84em; border: 1px solid #e5eef362; border-radius: .7em; background: linear-gradient(139deg, #557087e6, #313f55e8); box-shadow: inset 0 1px 1px #fff5, 0 4px 13px #17202b3e; font-size: max(10px, 1.85cqw); color: #f8f1e5; font-weight: 850; line-height: 1.1; white-space: nowrap; }
.cb-card[aria-current="true"] .cb-chapter { border-color: #fff3c5; background: var(--cb-gold); color: #594224; }
.cb-info { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3.6cqw; padding: 3.1cqw 3.4cqw; color: var(--cb-muted); background: radial-gradient(ellipse at 5% 0%, #5b72812c, transparent 64%); min-block-size: 0; }
.cb-description { display: block; min-inline-size: 0; }
.cb-card-name { display: block; color: var(--cb-cream); text-shadow: 0 2px 4px #14203556; font-size: max(17px, 5.2cqw); line-height: 1.09; font-weight: 950; white-space: nowrap; }
.cb-card-copy { display: block; margin-block-start: .42em; font-size: max(11px, 2.1cqw); line-height: 1.42; font-weight: 720; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-tags { display: flex; flex-wrap: wrap; gap: .8cqw; margin-block-start: 1.5cqw; }
.cb-tags > span { display: inline-flex; align-items: center; gap: .46em; padding: .31em .65em; border: 1px solid #bfccda57; border-radius: .66em; background: #192c3f45; color: #f4ebd8; font-size: max(10px, 1.6cqw); font-weight: 770; white-space: nowrap; }
.cb-tags > span::before { content: ""; inline-size: .36em; block-size: .36em; border-radius: 50%; background: #efd192; }
.cb-statistics { display: flex; align-items: stretch; }
.cb-stat { display: flex; flex-direction: column; gap: .38em; border-inline-start: 1px solid #afc0ce53; padding-inline: 2.4cqw; }
.cb-stat:last-child { padding-inline-end: .2em; }
.cb-stat strong { color: var(--cb-cream); font-size: max(15px, 3.8cqw); font-weight: 950; line-height: 1.04; font-variant-numeric: tabular-nums; }
.cb-stat span { font-size: max(10px, 1.7cqw); line-height: 1.18; font-weight: 730; white-space: nowrap; }
.cb-neighbor-distance { display: none; margin-block-start: .45em; font-size: max(10px, 1.9cqw); font-weight: 720; }
.cb-card:not([aria-current="true"]) .cb-neighbor-distance { display: block; }
.cb-card:not([aria-current="true"]) .cb-info { display: block; }
.cb-card:not([aria-current="true"]) .cb-card-name { font-size: max(15px, 4.7cqw); }
.cb-card:not([aria-current="true"]) :is(.cb-card-copy, .cb-tags, .cb-statistics) { display: none; }
.cb-card[data-slot="1"] .cb-info, .cb-card[data-slot="2"] .cb-info { text-align: end; }

.cb-pager { flex: none; display: flex; justify-content: center; align-items: center; gap: calc(6 * var(--u)); block-size: calc(64 * var(--u)); min-block-size: 32px; }
.cb-menu .cb-dot { display: grid; place-items: center; inline-size: max(24px, calc(40 * var(--u))); block-size: 100%; border-radius: 14px; }
.cb-dot::after { content: ""; inline-size: max(6px, calc(10 * var(--u))); block-size: max(6px, calc(10 * var(--u))); border-radius: 20px; background: #b8c9d9; box-shadow: 0 1px 2px #06152356; transition: inline-size 180ms ease, background-color 180ms ease, box-shadow 180ms ease; }
.cb-dot[aria-current="true"]::after { inline-size: max(16px, calc(28 * var(--u))); background: #ffdda0; box-shadow: 0 0 11px #ffd89065; }
.cb-dock { flex: none; align-self: center; inline-size: var(--dock-w); min-block-size: var(--dock-h); margin-block-end: auto; padding: calc(14 * var(--u)) calc(18 * var(--u)); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cb-tracks .cb-dock { margin-block-end: max(var(--bottom), calc(env(safe-area-inset-bottom, 0px) + 10px)); }
/* Spare height (windows taller than the design) is split above and below the cards. */
.cb-tracks > .cb-header { order: 0; }
.cb-tracks::before, .cb-tracks::after { content: ""; flex: 1 1 0; min-block-size: calc(12 * var(--u)); }
.cb-tracks::before { order: 1; }
.cb-tracks > .cb-carousel { order: 2; margin-block-start: 0; }
.cb-tracks > .cb-pager { order: 3; }
.cb-tracks > .cb-dock { order: 4; }
.cb-tracks::after { order: 5; }
.cb-mode-settings { display: flex; flex-direction: column; align-items: start; gap: calc(8 * var(--u)); min-inline-size: 0; }
.cb-mode-toggle { display: flex; gap: 3px; margin: 0; padding: 3px; min-inline-size: 0; border: 1px solid #c0d3df61; border-radius: calc(14 * var(--u)); background: #1e2d3f77; box-shadow: inset 0 2px 5px #0a192861; }
.cb-mode-option { position: relative; display: flex; flex: 0 0 auto; }
.cb-mode-option input { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cb-mode-option span { display: grid; align-content: center; min-block-size: max(28px, calc(42 * var(--u))); padding: 0 calc(18 * var(--u)); border: 1px solid transparent; border-radius: calc(10 * var(--u)); color: var(--cb-muted); font-size: max(12px, calc(19 * var(--u))); line-height: 1; font-weight: 870; pointer-events: none; white-space: nowrap; transition: background-color 200ms ease, color 200ms ease; }
.cb-mode-option input:checked + span { border-color: #fff3c8bc; background: var(--cb-gold); color: #3c2e1e; box-shadow: inset 0 1px 1px #ffffe494; }
.cb-mode-rule { margin: 0; color: #dbe4ed; font-size: max(11px, calc(16 * var(--u))); font-weight: 720; white-space: nowrap; }
.cb-dock .cb-race { inline-size: min(38%, var(--race-w)); block-size: var(--race-h); font-size: var(--race-font); }

/* ---- Riders ---------------------------------------------------------------------------------- */
.cb-riders { --cb-rider-color: #3f5fd8; background: #16243a; }
.cb-rider-backdrop img { opacity: .5; filter: saturate(.6) brightness(.55) blur(14px); transform: scale(1.08); }
/* Rider scene illustrations: the rider stands on the right, the left is kept dark for the details. */
.cb-rider-backdrop img.cb-rider-scene { opacity: 0; filter: none; transform: none; object-fit: cover; object-position: 60% 50%; inset-inline-start: 22%; inline-size: 78%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%); mask-image: linear-gradient(90deg, transparent 0%, #000 22%); }
.cb-rider-backdrop img.cb-rider-scene[data-current="true"], .cb-rider-backdrop img.cb-rider-scene[data-under="true"] { opacity: 1; }
.cb-riders[data-scene] .cb-rider-backdrop img[data-cb="rider-scene"] { opacity: 0; }
.cb-riders[data-scene] :is(.cb-hero, .cb-turntable) { display: none; }
.cb-riders[data-scene] .cb-rider-shade { background:
  radial-gradient(60% 46% at 30% 42%, #0d1828b0, transparent 100%),
  linear-gradient(90deg, #0d1828f0 0%, #0d1828d0 26%, #0d182880 44%, transparent 60%),
  linear-gradient(180deg, #0d182866 0%, transparent 18%, transparent 70%, #0d1828cc 100%); }
.cb-rider-shade { background:
  radial-gradient(ellipse 42% 58% at 64% 52%, color-mix(in srgb, var(--cb-rider-color) 34%, transparent), transparent 70%),
  linear-gradient(90deg, #121e33f2 0%, #172740c4 34%, #1a2a4260 62%, #15233a9a 100%),
  linear-gradient(180deg, transparent 60%, #0f1a2ccc 100%);
  transition: background 420ms ease; }
/* Header follows the reference: a plain back link, the page title under it on the left. */
.cb-rider-header { grid-template-columns: minmax(0, 1fr) auto; row-gap: calc(18 * var(--u)); }
.cb-rider-header > .cb-back-link { grid-column: 1; grid-row: 1; justify-self: start; }
.cb-summary[hidden] { display: none; }
.cb-rider-header > .cb-summary { grid-column: 2; grid-row: 1; justify-self: end; }
.cb-rider-header h1 { grid-column: 1 / -1; grid-row: 2; justify-self: start; text-align: start; font-size: max(24px, calc(64 * var(--u))); }
.cb-menu .cb-back-link { display: inline-flex; align-items: center; gap: .55em; block-size: var(--btn-h); padding-inline: .15em .4em; border-block-end: 1px solid #e8eef466; color: #f2f5f8; font-size: var(--btn-font); font-weight: 820; }
.cb-menu .cb-back-link .cb-caret { inline-size: .5em; block-size: .5em; }
@media (hover: hover) { .cb-menu .cb-back-link:hover { color: #ffdda0; border-color: #ffdda0aa; } }

.cb-rider-stage { position: relative; flex: 1 1 auto; min-block-size: 0; display: grid; grid-template-columns: calc(720 * var(--u)) minmax(0, 1fr); gap: calc(20 * var(--u)); align-items: center; padding: calc(8 * var(--u)) max(var(--edge), env(safe-area-inset-right, 0px)) calc(16 * var(--u)) max(var(--edge), env(safe-area-inset-left, 0px)); }
/* Rider details sit straight on the scene (no card): name and title, the radar with the story beside
 * them, the prop with its picture underneath. */
.cb-rider-info { grid-column: 1; grid-row: 1; align-self: start; margin-block-start: calc(28 * var(--u)); min-inline-size: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: calc(24 * var(--u)); row-gap: calc(20 * var(--u)); align-items: start; color: var(--cb-muted); text-shadow: 0 2px 10px #0b152699; }
.cb-rider-id { grid-column: 1; grid-row: 1; min-inline-size: 0; }
/* Radar and story share one frosted panel under the name, so the text never sits on the artwork. */
.cb-rider-detail { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: calc(250 * var(--u)) minmax(0, 1fr); align-items: center; gap: calc(28 * var(--u)); padding: calc(22 * var(--u)) calc(28 * var(--u)) calc(22 * var(--u)) calc(34 * var(--u)); border: 1px solid #d6e4f040; border-radius: calc(24 * var(--u)); background: linear-gradient(150deg, #22344cd9, #142236e6); box-shadow: inset 0 1px 1px #effaff24, 0 14px 30px #08122266; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); text-shadow: none; }
.cb-profile-prop { grid-column: 2; grid-row: 1; align-self: end; display: grid; grid-template-columns: auto auto; align-items: center; gap: calc(16 * var(--u)); text-align: end; }
.cb-profile-no { margin: 0; color: #c7d5e2; font-size: max(11px, calc(18 * var(--u))); font-weight: 760; letter-spacing: .04em; }
.cb-profile-no::before { content: ""; display: block; inline-size: calc(70 * var(--u)); block-size: max(3px, calc(6 * var(--u))); margin-block-end: calc(16 * var(--u)); border-radius: 3px; background: var(--cb-gold); }
.cb-profile-name { margin: calc(4 * var(--u)) 0 0; color: var(--cb-cream); font-size: max(30px, calc(112 * var(--u))); font-weight: 950; line-height: 1.05; letter-spacing: .04em; text-shadow: 0 5px 20px #0c162a99; overflow-wrap: anywhere; }
.cb-story-col { display: grid; gap: calc(10 * var(--u)); align-content: center; min-inline-size: 0; }
.cb-profile-title { margin: 0; color: #ffdda0; font-size: max(14px, calc(26 * var(--u))); font-weight: 900; }
.cb-prop-text { display: grid; gap: .25em; margin: 0; align-self: center; }
.cb-prop-text span { color: #aebfce; font-size: max(11px, calc(16 * var(--u))); font-weight: 720; }
.cb-prop-text strong { color: var(--cb-cream); font-size: max(14px, calc(25 * var(--u))); font-weight: 880; }
.cb-prop-img { inline-size: calc(150 * var(--u)); aspect-ratio: 1; object-fit: contain; padding: calc(12 * var(--u)); border: 1px solid #c0d3df45; border-radius: calc(20 * var(--u)); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--cb-rider-color) 30%, #2b3f56), #18283c 75%); box-shadow: inset 0 1px 2px #effaff2a, 0 8px 20px #0a142566; filter: drop-shadow(0 4px 6px #0a142540); }
.cb-story { margin: 0; color: #dbe5ee; font-size: max(12px, calc(18 * var(--u))); line-height: 1.68; font-weight: 640; }

/* Six-point radar. Labels are HTML so they keep a readable minimum size. */
.cb-radar { position: relative; margin: 0; inline-size: 100%; aspect-ratio: 1; }
.cb-radar svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; }
.cb-radar-grid polygon { fill: none; stroke: #d6e4f02b; stroke-width: 1; vector-effect: non-scaling-stroke; }
.cb-radar-grid polygon.cb-radar-edge { fill: #0d192a59; stroke: #d6e4f066; }
.cb-radar-grid line { stroke: #d6e4f024; stroke-width: 1; vector-effect: non-scaling-stroke; }
.cb-radar-shape { stroke: #ffdda0; stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px #ffd99088); }
.cb-radar-dots circle { fill: #fff4dc; stroke: #dcab73; stroke-width: 2; vector-effect: non-scaling-stroke; }
.cb-radar-label { position: absolute; translate: -50% -50%; display: grid; justify-items: center; line-height: 1.1; white-space: nowrap; text-shadow: 0 1px 4px #0b1526; }
.cb-radar-label small { color: #b9c9d8; font-size: max(10px, calc(14 * var(--u))); font-weight: 780; }
.cb-radar-label b { color: var(--cb-cream); font-size: max(11px, calc(19 * var(--u))); font-weight: 900; font-variant-numeric: tabular-nums; }

.cb-rider-figure { grid-column: 2; grid-row: 1; position: relative; justify-self: center; align-self: stretch; inline-size: 100%; max-inline-size: calc(900 * var(--u)); min-block-size: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; --cb-drag-x: 0px; }
.cb-turntable { position: absolute; inset: auto 18% 2% 18%; block-size: 11%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--cb-rider-color) 60%, #ffe3a8 40%), transparent); opacity: .55; filter: blur(calc(6 * var(--u))); transition: background 420ms ease; }
.cb-hero { position: absolute; inset: 0; margin: auto; block-size: 100%; inline-size: 100%; object-fit: contain; object-position: 50% 100%; opacity: 0; translate: var(--cb-drag-x) 0; filter: drop-shadow(0 calc(18 * var(--u)) calc(24 * var(--u)) #050c1a90); pointer-events: none; }
.cb-hero[data-current="true"] { opacity: 1; animation: cb-idle 3.6s ease-in-out infinite; }
.cb-rider-figure[data-dragging="true"] .cb-hero { animation-play-state: paused; }
@keyframes cb-idle { 50% { transform: translateY(calc(-6 * var(--u))); } }

.cb-roster-dock { flex: none; display: flex; align-items: center; gap: calc(20 * var(--u)); margin: 0 max(var(--edge), env(safe-area-inset-right, 0px)) max(var(--bottom), calc(env(safe-area-inset-bottom, 0px) + 10px)) max(var(--edge), env(safe-area-inset-left, 0px)); padding: calc(14 * var(--u)) calc(18 * var(--u)) calc(14 * var(--u)) calc(14 * var(--u)); border-radius: calc(24 * var(--u)); }
.cb-roster { flex: 1 1 auto; min-inline-size: 0; display: flex; gap: calc(6 * var(--u)); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: calc(4 * var(--u)); }
.cb-roster::-webkit-scrollbar { display: none; }
.cb-menu .cb-roster-tile { flex: 0 0 auto; display: grid; justify-items: center; gap: calc(6 * var(--u)); inline-size: max(50px, calc(86 * var(--u))); scroll-snap-align: center; color: #c9d6e2; font-size: max(12px, calc(19 * var(--u))); font-weight: 820; white-space: nowrap; }
.cb-roster-tile img { inline-size: 100%; aspect-ratio: 1; border-radius: calc(16 * var(--u)); border: max(1px, calc(2 * var(--u))) solid #c5d2e350; background: linear-gradient(160deg, #f8f2e4, #d9cfbd); object-fit: cover; transition: transform 200ms var(--cb-ease), border-color 200ms ease, box-shadow 200ms ease; }
.cb-roster-tile[aria-selected="true"] { color: #ffdda0; }
.cb-menu:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru)) .cb-roster-tile > span { max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; }
.cb-roster { align-items: start; }
/* Latin names are longer: allow two lines under the portrait and shrink the big name. */
.cb-menu:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru)) .cb-roster-tile { white-space: normal; text-align: center; line-height: 1.1; font-size: max(10px, calc(14 * var(--u))); inline-size: max(52px, calc(84 * var(--u))); }
.cb-menu:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru)) .cb-roster-tile > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: normal; }
.cb-menu:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru)) .cb-profile-name { font-size: max(26px, calc(80 * var(--u))); letter-spacing: 0; line-height: 1; overflow-wrap: normal; }
.cb-roster-tile[aria-selected="true"] img { border-color: #ffe4af; box-shadow: 0 0 0 max(2px, calc(3 * var(--u))) #ffdda066, 0 6px 14px #0a142580; transform: translateY(calc(-4 * var(--u))); }
.cb-roster-tile[data-confirmed="true"] span::after { content: " ✓"; color: #ffdda0; }
.cb-roster-dock .cb-confirm { flex: none; inline-size: min(var(--race-w), calc(290 * var(--u))); block-size: var(--race-h); font-size: var(--race-font); }

/* ---- About & feedback pages ------------------------------------------------------------------- */
.cb-page { background: #17283f; }
.cb-page-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.cb-page-bg img { inline-size: 100%; block-size: 100%; object-fit: cover; filter: saturate(.7) brightness(.5) blur(10px); transform: scale(1.06); }
.cb-page-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, #101c30ee 0%, #15253bc4 45%, #172a4194 100%), linear-gradient(180deg, transparent 55%, #0e1a2bcc); }
.cb-page-header { grid-template-columns: minmax(0, 1fr) auto; row-gap: calc(18 * var(--u)); }
.cb-page-header > .cb-back-link { grid-column: 1; grid-row: 1; justify-self: start; }
.cb-page-header > .cb-summary { grid-column: 2; grid-row: 1; justify-self: end; }
.cb-page-header > h1.cb-a { grid-column: 1 / -1; grid-row: 2; justify-self: start; text-align: start; font-size: max(24px, calc(64 * var(--u))); }
.cb-page-body { flex: 1 1 auto; min-block-size: 0; display: grid; gap: calc(56 * var(--u)); padding: calc(28 * var(--u)) max(var(--edge), env(safe-area-inset-right, 0px)) max(var(--bottom), calc(env(safe-area-inset-bottom, 0px) + 12px)) max(var(--edge), env(safe-area-inset-left, 0px)); }
.cb-page h3 { margin: 0 0 calc(14 * var(--u)); color: #ffdda0; font-size: max(14px, calc(22 * var(--u))); font-weight: 900; letter-spacing: .06em; }

.cb-about-body { grid-template-columns: calc(620 * var(--u)) minmax(0, 1fr); }
.cb-about-intro { align-self: start; color: #dbe5ee; text-shadow: 0 2px 10px #0b152699; }
.cb-eyebrow { margin: 0; color: #b9c9d8; font-size: max(11px, calc(17 * var(--u))); font-weight: 780; letter-spacing: .08em; }
.cb-eyebrow::before { content: ""; display: block; inline-size: calc(70 * var(--u)); block-size: max(3px, calc(6 * var(--u))); margin-block-end: calc(16 * var(--u)); border-radius: 3px; background: var(--cb-gold); }
.cb-about-intro h2 { margin: calc(6 * var(--u)) 0 0; color: var(--cb-cream); font-size: max(30px, calc(104 * var(--u))); font-weight: 950; line-height: 1.05; letter-spacing: .04em; }
.cb-about-lead { margin: calc(6 * var(--u)) 0 0; color: #ffdda0; font-size: max(15px, calc(30 * var(--u))); font-weight: 880; }
.cb-about-text { margin: calc(22 * var(--u)) 0 0; font-size: max(13px, calc(20 * var(--u))); line-height: 1.75; font-weight: 650; }
.cb-about-facts { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: calc(34 * var(--u)); margin: calc(30 * var(--u)) 0 0; padding-block: calc(18 * var(--u)); border-block: 1px solid #d3e0ec38; }
.cb-about-facts dt { color: var(--cb-cream); font-size: max(18px, calc(40 * var(--u))); font-weight: 950; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cb-about-facts dd { margin: calc(4 * var(--u)) 0 0; color: #b9c9d8; font-size: max(11px, calc(15 * var(--u))); font-weight: 760; }
.cb-about-version { margin: calc(18 * var(--u)) 0 0; color: #9fb1c2; font-size: max(11px, calc(15 * var(--u))); font-weight: 700; }
.cb-about-panel { min-block-size: 0; border-radius: calc(26 * var(--u)); }
.cb-rules { display: grid; gap: calc(10 * var(--u)); margin: 0; padding: 0; list-style: none; }
.cb-rules li { position: relative; padding-inline-start: 1.3em; color: #dbe5ee; font-size: max(13px, calc(19 * var(--u))); line-height: 1.6; font-weight: 650; }
.cb-rules li::before { content: ""; position: absolute; inset: .62em auto auto .2em; inline-size: .42em; block-size: .42em; border-radius: 50%; background: #efd192; }
.cb-mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: calc(14 * var(--u)); }
.cb-mode-card { display: grid; gap: .3em; padding: calc(16 * var(--u)) calc(18 * var(--u)); border: 1px solid #c0d3df40; border-radius: calc(16 * var(--u)); background: #12213466; }
.cb-mode-card strong { color: var(--cb-cream); font-size: max(14px, calc(21 * var(--u))); font-weight: 900; }
.cb-mode-card span { color: #c9d6e2; font-size: max(12px, calc(17 * var(--u))); line-height: 1.5; font-weight: 650; }
.cb-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(150px, calc(260 * var(--u))), 1fr)); gap: calc(16 * var(--u)); }
.cb-map-tile { margin: 0; overflow: hidden; border: 1px solid #c0d3df45; border-radius: calc(16 * var(--u)); background: #12213480; }
.cb-map-tile img { display: block; inline-size: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cb-map-tile figcaption { display: grid; gap: .25em; padding: calc(12 * var(--u)) calc(14 * var(--u)) calc(14 * var(--u)); }
.cb-map-tile small { color: #ffdda0; font-size: max(10px, calc(13 * var(--u))); font-weight: 820; }
.cb-map-tile strong { color: var(--cb-cream); font-size: max(14px, calc(21 * var(--u))); font-weight: 920; }
.cb-map-tile span { color: #c9d6e2; font-size: max(11px, calc(15 * var(--u))); line-height: 1.45; font-weight: 640; }
.cb-map-tile em { color: #9fb1c2; font-style: normal; font-size: max(10px, calc(13 * var(--u))); font-weight: 700; }
.cb-credit { margin: 0; color: #dbe5ee; font-size: max(13px, calc(18 * var(--u))); line-height: 1.7; font-weight: 650; }
.cb-menu .cb-inline-link { color: #ffdda0; font-weight: 880; text-decoration: underline; text-underline-offset: .2em; }

.cb-feedback-body { grid-template-columns: calc(520 * var(--u)) minmax(0, 1fr); gap: calc(40 * var(--u)); }
/* The note composer runs the full height of the wall beside it; the text box takes the spare room. */
.cb-composer { align-self: stretch; min-block-size: 0; display: flex; flex-direction: column; gap: calc(16 * var(--u)); padding: calc(26 * var(--u)) calc(30 * var(--u)); border-radius: calc(26 * var(--u)); }
.cb-composer textarea { flex: 1 1 auto; }
.cb-composer-note { margin-block-start: calc(-4 * var(--u)); }
.cb-composer h2 { margin: 0; color: var(--cb-cream); font-size: max(17px, calc(30 * var(--u))); font-weight: 920; }
.cb-composer .cb-field { font-size: max(14px, calc(18 * var(--u))); line-height: 1.6; }
.cb-composer textarea { resize: none; min-block-size: calc(150 * var(--u)); }
.cb-composer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: calc(12 * var(--u)); }
.cb-composer-row .cb-gold { block-size: auto; min-block-size: max(42px, calc(56 * var(--u))); font-size: max(15px, calc(21 * var(--u))); }
.cb-composer-note { margin: 0; color: #9fb1c2; font-size: max(11px, calc(14 * var(--u))); font-weight: 680; }
.cb-chips { display: flex; flex-wrap: wrap; gap: calc(8 * var(--u)); }
.cb-chip { position: relative; display: flex; }
.cb-chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.cb-chip span { display: grid; place-items: center; min-block-size: max(30px, calc(38 * var(--u))); padding-inline: calc(16 * var(--u)); border: 1px solid #c0d3df52; border-radius: 99px; background: #1e2d3f80; color: var(--cb-muted); font-size: max(12px, calc(16 * var(--u))); font-weight: 820; white-space: nowrap; pointer-events: none; transition: background-color 160ms ease, color 160ms ease; }
.cb-chip input:checked + span { border-color: #fff3c8bc; background: var(--cb-gold); color: #3c2e1e; }
.cb-chip input:focus-visible + span { outline: 2px solid #fff0bb; outline-offset: 2px; }
.cb-wall-area { min-block-size: 0; display: flex; flex-direction: column; gap: calc(16 * var(--u)); padding-block-start: calc(4 * var(--u)); }
.cb-wall-tools { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cb-sort { display: flex; padding: 3px; border: 1px solid #c0d3df52; border-radius: 99px; background: #1e2d3f80; }
.cb-sort .cb-chip span { border-color: transparent; background: transparent; }
.cb-wall { flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; columns: 3 calc(280 * var(--u)); column-gap: calc(18 * var(--u)); padding: calc(10 * var(--u)) calc(6 * var(--u)) calc(20 * var(--u)); scrollbar-width: thin; scrollbar-color: #c9d6e255 transparent; }
.cb-note { --note: #efd192; break-inside: avoid; margin: 0 0 calc(18 * var(--u)); padding: calc(16 * var(--u)) calc(18 * var(--u)) calc(12 * var(--u)); border: 1px solid #c0d3df45; border-block-start: max(3px, calc(5 * var(--u))) solid var(--note); border-radius: calc(16 * var(--u)); background: linear-gradient(160deg, #3b4e62f0, #26384bf2); box-shadow: 0 10px 22px #0a142566; rotate: var(--tilt, 0deg); transition: rotate 200ms ease, translate 200ms ease; }
@media (hover: hover) { .cb-note:hover { rotate: 0deg; translate: 0 calc(-3 * var(--u)); } }
.cb-note[data-tag="bug"] { --note: #f08a7a; }
.cb-note[data-tag="track"] { --note: #84d9e5; }
.cb-note[data-tag="rider"] { --note: #b79bf0; }
.cb-note[data-tag="love"] { --note: #f5a3c7; }
.cb-note header { display: flex; align-items: center; gap: .5em; font-size: max(11px, calc(14 * var(--u))); font-weight: 800; }
.cb-note-tag { color: var(--note); }
.cb-note-badge { padding: .05em .5em; border: 1px solid #c0d3df52; border-radius: 99px; color: #aebfce; font-size: max(10px, .9em); }
.cb-note-mine { border-color: #ffdda0aa; color: #ffdda0; }
.cb-note time { margin-inline-start: auto; color: #9fb1c2; font-weight: 700; }
.cb-note p { margin: calc(10 * var(--u)) 0 calc(12 * var(--u)); color: #eef3f7; font-size: max(13px, calc(18 * var(--u))); line-height: 1.6; font-weight: 650; overflow-wrap: anywhere; }
.cb-note footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #aebfce; font-size: max(11px, calc(14 * var(--u))); font-weight: 760; }
.cb-menu .cb-like { display: inline-flex; align-items: center; gap: .35em; min-block-size: 32px; padding: 0 .7em; border-radius: 99px; color: #c9d6e2; font-weight: 820; }
.cb-like i { font-style: normal; transition: transform 200ms var(--cb-ease); }
.cb-like[aria-pressed="true"] { color: #ff9fbf; }
.cb-like[aria-pressed="true"] i { transform: scale(1.25); }
.cb-note-fresh { animation: cb-note-in 620ms var(--cb-ease) both; }
@keyframes cb-note-in { from { opacity: 0; translate: 0 calc(-30 * var(--u)); scale: .8; rotate: -6deg; } }
.cb-wall-empty { margin: calc(40 * var(--u)) 0; color: #aebfce; font-size: max(13px, calc(18 * var(--u))); text-align: center; column-span: all; }


/* About: tabbed pages that turn sideways. */
.cb-about-panel { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.cb-tabs { flex: none; display: flex; align-items: center; gap: calc(6 * var(--u)); padding: calc(14 * var(--u)) calc(20 * var(--u)) 0; border-block-end: 1px solid #d3e0ec2e; }
.cb-menu .cb-tabs [role="tab"] { position: relative; padding: calc(10 * var(--u)) calc(18 * var(--u)) calc(14 * var(--u)); color: #aebfce; font-size: max(13px, calc(20 * var(--u))); font-weight: 860; }
.cb-tabs [role="tab"][aria-selected="true"] { color: var(--cb-cream); }
.cb-tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; inset: auto calc(14 * var(--u)) -1px; block-size: 3px; border-radius: 3px; background: var(--cb-gold); }
.cb-page-count { margin-inline-start: auto; color: #9fb1c2; font-size: max(11px, calc(15 * var(--u))); font-weight: 760; font-variant-numeric: tabular-nums; }
.cb-pages { position: relative; flex: 1 1 auto; min-block-size: 0; overflow: hidden; perspective: 1400px; }
.cb-page-sheet { position: relative; inset: 0; block-size: 100%; inline-size: 100%; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: calc(30 * var(--u)); padding: calc(26 * var(--u)) calc(38 * var(--u)); scrollbar-width: thin; scrollbar-color: #c9d6e255 transparent; }
.cb-page-sheet[style*="absolute"] { inset-block-start: 0; }
.cb-page-turn { flex: none; display: flex; justify-content: space-between; gap: 12px; padding: calc(12 * var(--u)) calc(20 * var(--u)); border-block-start: 1px solid #d3e0ec2e; }
.cb-menu .cb-page-turn button { display: inline-flex; align-items: center; gap: .5em; min-block-size: max(36px, calc(48 * var(--u))); padding-inline: 1.1em; font-size: max(13px, calc(17 * var(--u))); }
.cb-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(230px, calc(380 * var(--u))), 1fr)); gap: calc(10 * var(--u)) calc(24 * var(--u)); margin: 0; }
.cb-keys > div { display: grid; grid-template-columns: calc(210 * var(--u)) minmax(0, 1fr); align-items: center; gap: calc(14 * var(--u)); min-block-size: max(34px, calc(48 * var(--u))); padding-block: calc(4 * var(--u)); border-block-end: 1px dashed #d3e0ec22; }
.cb-keys dt { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.cb-keys dd { margin: 0; color: #dbe5ee; font-size: max(12px, calc(17 * var(--u))); font-weight: 650; line-height: 1.45; }
.cb-keys kbd { display: inline-grid; place-items: center; min-inline-size: max(26px, calc(38 * var(--u))); block-size: max(26px, calc(38 * var(--u))); padding-inline: .5em; border: 1px solid #d6e2ec6b; border-block-end-width: 3px; border-radius: 8px; background: linear-gradient(#3d5165, #2a3c4f); color: var(--cb-cream); font: 800 max(11px, calc(15 * var(--u)))/1 inherit; font-family: inherit; white-space: nowrap; }
.cb-keys .cb-touch-cap { border-radius: 99px; background: var(--cb-gold); color: #3c2e1e; border-color: #fff3c8; }
.cb-or { color: #9fb1c2; margin-inline: 2px; }
.cb-controls-tip { margin: 0; padding: calc(12 * var(--u)) calc(16 * var(--u)); border-radius: calc(12 * var(--u)); background: #ffdda014; color: #ffdda0; font-size: max(12px, calc(16 * var(--u))); font-weight: 720; }

/* Settings */
.cb-settings-body { grid-template-columns: minmax(0, calc(1500 * var(--u))); justify-content: center; align-items: start; }
.cb-settings-panel { max-block-size: 100%; min-block-size: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: calc(28 * var(--u)) calc(56 * var(--u)); padding: calc(26 * var(--u)) calc(36 * var(--u)); border-radius: calc(26 * var(--u)); scrollbar-width: thin; }
.cb-settings-panel section { display: grid; gap: calc(4 * var(--u)); align-content: start; }
.cb-setting { display: flex; align-items: center; justify-content: space-between; gap: calc(24 * var(--u)); min-block-size: max(48px, calc(72 * var(--u))); padding-block: calc(8 * var(--u)); border-block-end: 1px solid #d3e0ec22; }
.cb-setting > div:first-child { flex: 1 1 auto; display: grid; gap: .25em; min-inline-size: 0; }
.cb-setting .cb-seg { flex: none; flex-wrap: nowrap; }
.cb-settings-foot { grid-column: 1 / -1; }
.cb-setting strong { color: var(--cb-cream); font-size: max(14px, calc(20 * var(--u))); font-weight: 860; }
.cb-setting small { color: #9fb1c2; font-size: max(11px, calc(15 * var(--u))); font-weight: 650; line-height: 1.45; }
.cb-seg { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid #c0d3df52; border-radius: 99px; background: #1e2d3f80; }
.cb-seg .cb-chip span { border-color: transparent; background: transparent; }
.cb-seg .cb-chip input:checked + span { background: var(--cb-gold); }
.cb-menu .cb-switch { position: relative; flex: none; inline-size: max(48px, calc(68 * var(--u))); block-size: max(28px, calc(38 * var(--u))); border-radius: 99px; background: #0f1d2fb0; border: 1px solid #c0d3df52; transition: background-color 200ms ease; }
.cb-switch i { position: absolute; inset-block: 3px; inset-inline-start: 3px; aspect-ratio: 1; border-radius: 50%; background: #c9d6e2; box-shadow: 0 2px 5px #0006; transition: translate 220ms var(--cb-ease), background-color 200ms ease; }
.cb-switch[aria-checked="true"] { background: #d8ad6f; border-color: #fff3c8; }
.cb-switch[aria-checked="true"] i { translate: calc(max(48px, calc(68 * var(--u))) - 100% - 8px) 0; background: #fff8e8; }
.cb-range { display: flex; align-items: center; gap: calc(14 * var(--u)); flex: 0 1 calc(420 * var(--u)); min-inline-size: 140px; }
.cb-range input { flex: 1; min-inline-size: 0; appearance: none; -webkit-appearance: none; block-size: max(6px, calc(8 * var(--u))); border-radius: 99px; background: linear-gradient(90deg, #dcab73, #fbe9bd) 0 / var(--fill, 50%) 100% no-repeat, #0f1d2fb0; cursor: pointer; }
.cb-range input::-webkit-slider-thumb { -webkit-appearance: none; inline-size: max(20px, calc(28 * var(--u))); aspect-ratio: 1; border-radius: 50%; background: #fff8e8; border: 2px solid #dcab73; box-shadow: 0 2px 6px #0007; }
.cb-range input::-moz-range-thumb { inline-size: max(20px, calc(28 * var(--u))); block-size: max(20px, calc(28 * var(--u))); border-radius: 50%; background: #fff8e8; border: 2px solid #dcab73; }
.cb-range output { min-inline-size: 2.2em; color: var(--cb-cream); font-size: max(13px, calc(18 * var(--u))); font-weight: 860; text-align: end; font-variant-numeric: tabular-nums; }
.cb-select { position: relative; display: flex; align-items: center; gap: .5em; padding-inline: .9em; min-block-size: max(38px, calc(52 * var(--u))); border: 1px solid #c0d3df52; border-radius: 99px; background: #1e2d3f80; color: var(--cb-cream); font-size: max(13px, calc(18 * var(--u))); }
.cb-select select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 820; padding-inline-end: 1.2em; cursor: pointer; }
.cb-select select option { color: #182638; }
.cb-select .cb-caret-down { position: absolute; inset-inline-end: .9em; pointer-events: none; }
.cb-settings-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cb-menu .cb-layout-btn { flex: none; display: inline-flex; align-items: center; gap: .5em; min-block-size: max(38px, calc(50 * var(--u))); padding-inline: 1.2em; border-radius: 999px; font-size: max(13px, calc(17 * var(--u))); font-weight: 860; color: var(--cb-cream); }
.cb-menu .cb-layout-btn .cb-icon { inline-size: 1.15em; block-size: 1.15em; }
.cb-settings-foot p { flex: 1; margin: 0; color: #ffdda0; font-size: max(11px, calc(15 * var(--u))); font-weight: 760; text-align: end; }
.cb-settings-foot p[data-saved] { color: #9fe0b5; }
.cb-menu .cb-settings-save { min-inline-size: calc(220 * var(--u)); min-block-size: max(40px, calc(56 * var(--u))); justify-content: center; font-size: max(15px, calc(21 * var(--u))); border-radius: calc(16 * var(--u)); }
.cb-menu .cb-settings-foot button { min-block-size: max(38px, calc(50 * var(--u))); padding-inline: 1.3em; font-size: max(13px, calc(17 * var(--u))); }

/* Records: the world map with a pin per track, and the results list beside it. */
.cb-records-body { grid-template-columns: minmax(0, 1fr) calc(600 * var(--u)); gap: calc(32 * var(--u)); }
.cb-records-main { --detail-h: calc(236 * var(--u)); min-block-size: 0; container-type: size; --world-w: min(100cqw, calc((100cqh - var(--detail-h) - 16 * var(--u)) * 1672 / 941)); display: flex; flex-direction: column; gap: calc(16 * var(--u)); }
.cb-world { position: relative; flex: none; align-self: center; inline-size: var(--world-w); aspect-ratio: 1672 / 941; border-radius: calc(26 * var(--u)); overflow: hidden; border: 1px solid #d6e4f066; box-shadow: 0 18px 40px #0a142580, inset 0 0 0 1px #fff2; }
.cb-world img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; user-select: none; }
.cb-menu .cb-pin { position: absolute; translate: -50% -50%; display: grid; justify-items: center; gap: 4px; }
.cb-pin-dot { display: grid; place-items: center; inline-size: max(26px, calc(44 * var(--u))); aspect-ratio: 1; border-radius: 50%; background: var(--cb-gold); border: 2px solid #fff8e8; color: #3c2e1e; font-size: max(12px, calc(18 * var(--u))); font-weight: 950; box-shadow: 0 4px 12px #0a1425a0; transition: transform 180ms var(--cb-ease); }
.cb-pin-dot .cb-icon { inline-size: 60%; block-size: 60%; }
.cb-pin-label { padding: .2em .7em; border-radius: 99px; background: #fff8eef0; color: #2e3a48; font-size: max(10px, calc(15 * var(--u))); font-weight: 880; white-space: nowrap; box-shadow: 0 3px 8px #0a142566; }
.cb-pin[data-medal="1"] .cb-pin-dot { background: linear-gradient(135deg, #fff1a8, #e6b437); }
.cb-pin[data-medal="2"] .cb-pin-dot { background: linear-gradient(135deg, #ffffff, #b8c6d3); }
.cb-pin[data-medal="3"] .cb-pin-dot { background: linear-gradient(135deg, #ffd2b0, #c97c4a); }
.cb-pin[data-done="false"] .cb-pin-dot { background: #e9eef3; color: #4a5a6c; }
.cb-pin[data-locked="true"] .cb-pin-dot { background: #4a5a6c; color: #d7e1ea; border-color: #c9d6e2; }
.cb-pin[data-locked="true"] .cb-pin-label { background: #2a3a4ce8; color: #c9d6e2; }
.cb-pin[aria-pressed="true"] .cb-pin-dot { transform: scale(1.22); box-shadow: 0 0 0 max(4px, calc(6 * var(--u))) #ffdda055, 0 4px 14px #0a1425; }
.cb-records-side { min-block-size: 0; display: flex; flex-direction: column; gap: calc(14 * var(--u)); }
.cb-record-summary { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: calc(16 * var(--u)) calc(20 * var(--u)); border-radius: calc(20 * var(--u)); }
.cb-record-summary div + div { border-inline-start: 1px solid #d3e0ec2e; padding-inline-start: calc(16 * var(--u)); }
.cb-record-summary dt { color: var(--cb-cream); font-size: max(17px, calc(32 * var(--u))); font-weight: 950; font-variant-numeric: tabular-nums; }
.cb-record-summary dd { margin: 2px 0 0; color: #aebfce; font-size: max(11px, calc(14 * var(--u))); font-weight: 760; }
.cb-record-modes { flex: none; align-self: start; }
.cb-record-list { flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: calc(8 * var(--u)); list-style: none; border-radius: calc(20 * var(--u)); display: grid; align-content: start; gap: calc(6 * var(--u)); scrollbar-width: thin; }
.cb-menu .cb-record button { display: grid; grid-template-columns: calc(110 * var(--u)) minmax(0, 1fr) auto; align-items: center; gap: calc(14 * var(--u)); inline-size: 100%; padding: calc(8 * var(--u)); border-radius: calc(14 * var(--u)); text-align: start; }
.cb-record[data-focus] button { background: #ffdda01c; box-shadow: inset 0 0 0 1px #ffdda088; }
.cb-record img { inline-size: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: calc(10 * var(--u)); }
.cb-record[data-locked="true"] img { filter: grayscale(.9) brightness(.6); }
.cb-record-name { display: grid; gap: .15em; min-inline-size: 0; }
.cb-record-name small { color: #ffdda0; font-size: max(10px, calc(13 * var(--u))); font-weight: 820; }
.cb-record-name strong { color: var(--cb-cream); font-size: max(13px, calc(20 * var(--u))); font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.cb-record-stats { display: flex; gap: calc(18 * var(--u)); text-align: end; }
.cb-record-stats > span { display: grid; gap: .1em; }
.cb-record-stats b { color: var(--cb-cream); font-size: max(13px, calc(20 * var(--u))); font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-record-stats small { color: #9fb1c2; font-size: max(10px, calc(12 * var(--u))); font-weight: 700; white-space: nowrap; }
.cb-record-rank[data-medal="1"] b { color: #ffd76a; } .cb-record-rank[data-medal="2"] b { color: #e3edf5; } .cb-record-rank[data-medal="3"] b { color: #f0b48a; }
.cb-record-empty, .cb-record-locked { color: #9fb1c2; font-size: max(11px, calc(14 * var(--u))); font-weight: 700; max-inline-size: calc(170 * var(--u)); text-align: end; }
.cb-record-locked { color: #c9d6e2; }

.cb-record-detail { flex: 0 1 auto; align-self: center; inline-size: var(--world-w); min-block-size: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto auto; column-gap: calc(28 * var(--u)); row-gap: calc(8 * var(--u)); padding: calc(18 * var(--u)) calc(24 * var(--u)); border-radius: calc(22 * var(--u)); color: var(--cb-muted); }
.cb-detail-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cb-detail-head > div { display: grid; gap: .15em; min-inline-size: 0; }
.cb-detail-head small { color: #ffdda0; font-size: max(11px, calc(14 * var(--u))); font-weight: 820; }
.cb-detail-head strong { color: var(--cb-cream); font-size: max(17px, calc(30 * var(--u))); font-weight: 950; line-height: 1.1; }
.cb-menu .cb-detail-go { flex: none; block-size: max(36px, calc(50 * var(--u))); padding-inline: 1.1em; font-size: max(14px, calc(19 * var(--u))); border-radius: calc(14 * var(--u)); }
.cb-detail-lock { color: #c9d6e2; font-size: max(12px, calc(15 * var(--u))); font-weight: 760; }
.cb-detail-text { grid-column: 1; margin: 0; color: #dbe5ee; font-size: max(12px, calc(17 * var(--u))); line-height: 1.55; font-weight: 650; }
.cb-detail-tags { grid-column: 1; margin: 0; font-size: max(11px, calc(15 * var(--u))); align-self: start; }
.cb-detail-tags > span { font-size: 1em; }
.cb-detail-bests { grid-column: 2; grid-row: 2 / span 3; align-self: start; display: grid; gap: calc(8 * var(--u)); margin: 0; padding-inline-start: calc(24 * var(--u)); border-inline-start: 1px solid #d3e0ec2e; }
.cb-detail-bests div { display: grid; gap: .1em; }
.cb-detail-bests dt { color: #aebfce; font-size: max(11px, calc(14 * var(--u))); font-weight: 760; }
.cb-detail-bests dd { margin: 0; color: var(--cb-cream); font-size: max(13px, calc(20 * var(--u))); font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-detail-hint { grid-column: 1; margin: 0; padding-block-start: calc(8 * var(--u)); border-block-start: 1px dashed #d3e0ec2e; color: #9fb1c2; font-size: max(11px, calc(14 * var(--u))); line-height: 1.5; font-weight: 650; }

/* ---- Dialogs ------------------------------------------------------------------------------------ */
.cb-menu .cb-modal { inline-size: min(calc(100vw - 32px), calc(640 * var(--u)), 640px); min-inline-size: min(calc(100vw - 32px), 320px); max-block-size: calc(100svh - 32px); padding: 0; color: var(--cb-cream); border-radius: max(16px, calc(28 * var(--u))); overflow: auto; }
.cb-modal::backdrop { background: #0e1a2cb8; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.cb-modal[open] { animation: cb-pop 260ms var(--cb-ease); }
.cb-modal[open]::backdrop { animation: cb-fade 260ms ease; }
@keyframes cb-pop { from { opacity: 0; scale: .92; translate: 0 12px; } }
@keyframes cb-fade { from { opacity: 0; } }
.cb-modal-body { display: grid; gap: 14px; padding: max(22px, calc(36 * var(--u))); font-size: max(14px, calc(19 * var(--u))); line-height: 1.65; color: #dbe5ee; }
.cb-modal-body h2 { margin: 0; color: var(--cb-cream); font-size: max(22px, calc(34 * var(--u))); font-weight: 950; line-height: 1.2; }
.cb-modal-body p { margin: 0; }
.cb-modal-lead { color: #ffdda0; font-weight: 850; }
.cb-modal-meta { color: #aebfce; font-size: .85em; }
.cb-field { inline-size: 100%; resize: vertical; padding: .8em 1em; border: 1px solid #c0d3df61; border-radius: 12px; background: #0f1d2fa8; color: var(--cb-cream); font: inherit; }
.cb-field::placeholder { color: #9fb1c2; }
.cb-modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-block-start: 6px; }
.cb-modal-actions button { min-block-size: 46px; padding-inline: 1.4em; font-size: 1em; }
.cb-menu .cb-ghost { border-radius: 14px; font-weight: 820; }
.cb-modal-actions .cb-gold { border-radius: 14px; }

/* ---- Page transitions ------------------------------------------------------------------------------
 * Each moving part is marked .cb-a and carries how far it travels (--dx, --dy, --ds, --db).
 * The page coming in plays cb-in forwards; the page going out plays it in reverse.
 * --sx flips the horizontal direction so "forward" and "back" mirror each other. */
@keyframes cb-in { from { opacity: 0; translate: calc(var(--sx, 1) * var(--dx, 0px)) var(--dy, 0px); scale: var(--ds, 1); filter: blur(var(--db, 0px)); } }
.cb-entering { --sx: var(--cb-dir); z-index: 2; }
.cb-leaving { --sx: calc(var(--cb-dir) * -1); z-index: 1; pointer-events: none; }
.cb-entering .cb-a { animation: cb-in 640ms var(--cb-ease) calc(var(--i, 0) * 65ms) both; }
.cb-leaving .cb-a { animation: cb-in 420ms cubic-bezier(.55, 0, .8, .45) both reverse; }
.cb-leaving { animation: cb-hide 160ms linear 400ms both; }
/* The incoming page's own background fades in with its art, so nothing flashes dark in between. */
.cb-view.cb-entering { animation: cb-fade 380ms ease both; }
.cb-entering :is(.cb-scene-shade, .cb-rider-shade, .cb-home-shade) { animation: cb-fade 380ms ease both; }
[data-nav="slide"] .cb-leaving .cb-backdrop { animation: none; }
@keyframes cb-hide { to { opacity: 0; } }

/* Home ⇄ tracks: a push in depth. */
[data-nav="push"] .cb-home-art { --ds: 1.16; --db: 10px; }
[data-nav="push"] .cb-tracks .cb-backdrop { --ds: 1.12; --db: 8px; }
[data-nav="push"] .cb-header .cb-a { --dy: calc(-70 * var(--u)); }
[data-nav="push"] .cb-header h1 { --i: 1; }
[data-nav="push"] .cb-header > :last-child { --i: 2; }
[data-nav="push"] .cb-pager { --dy: calc(60 * var(--u)); --i: 4; }
[data-nav="push"] .cb-dock { --dy: calc(110 * var(--u)); --i: 5; }
[data-nav="push"] .cb-tracks.cb-entering .cb-card { animation: cb-in 720ms var(--cb-ease) 90ms both; --sx: 1; --dy: calc(170 * var(--u)); --ds: .86; }
[data-nav="push"] .cb-tracks.cb-entering .cb-card:is([data-slot="-1"], [data-slot="-2"]) { --dx: calc(-320 * var(--u)); --dy: calc(40 * var(--u)); animation-delay: 200ms; }
[data-nav="push"] .cb-tracks.cb-entering .cb-card:is([data-slot="1"], [data-slot="2"]) { --dx: calc(320 * var(--u)); --dy: calc(40 * var(--u)); animation-delay: 200ms; }
[data-nav="push"] .cb-tracks.cb-leaving .cb-card { animation: cb-in 420ms cubic-bezier(.55, 0, .8, .45) both reverse; --sx: 1; --dy: calc(170 * var(--u)); --ds: .9; }

/* Home ⇄ tracks: racing stripes sweep across and pull the track page in behind them. */
.cb-wipe { position: absolute; inset: 0; z-index: 6; pointer-events: none; display: none; }
.cb-wipe i { position: absolute; inset: 0; }
.cb-wipe i:nth-child(1) { background: #1b2b42; background-image: conic-gradient(#ffffff26 25%, transparent 0 50%, #ffffff26 0 75%, transparent 0); background-size: calc(44 * var(--u)) calc(44 * var(--u)); }
.cb-wipe i:nth-child(2) { background: var(--cb-gold); }
.cb-wipe i:nth-child(3) { background: #fff4dc; }
[data-nav="wipe"] .cb-wipe { display: block; }
[data-nav="wipe"][data-dir="back"] .cb-wipe { scale: -1 1; }
[data-nav="wipe"] .cb-wipe i { animation: cb-stripe 900ms cubic-bezier(.62, 0, .28, 1) both; }
/* Each stripe rides a fixed distance (--o) ahead of the reveal edge; the checker band trails just behind it. */
[data-nav="wipe"] .cb-wipe i:nth-child(1) { --o: 0%; --w: 12%; }
[data-nav="wipe"] .cb-wipe i:nth-child(2) { --o: 3.2%; --w: 2.6%; }
[data-nav="wipe"] .cb-wipe i:nth-child(3) { --o: 6.4%; --w: 1.4%; }
@keyframes cb-stripe {
  from { clip-path: polygon(calc(-24% + var(--o) - var(--w)) 0, calc(-24% + var(--o)) 0, calc(-38% + var(--o)) 100%, calc(-38% + var(--o) - var(--w)) 100%); }
  to { clip-path: polygon(calc(150% + var(--o) - var(--w)) 0, calc(150% + var(--o)) 0, calc(136% + var(--o)) 100%, calc(136% + var(--o) - var(--w)) 100%); }
}
[data-nav="wipe"] .cb-view.cb-entering { animation: cb-reveal 900ms cubic-bezier(.62, 0, .28, 1) both; }
[data-nav="wipe"][data-dir="back"] .cb-view.cb-entering { animation-name: cb-reveal-back; }
@keyframes cb-reveal { from { clip-path: polygon(-40% 0, -24% 0, -38% 100%, -40% 100%); } to { clip-path: polygon(-40% 0, 150% 0, 136% 100%, -40% 100%); } }
@keyframes cb-reveal-back { from { clip-path: polygon(140% 0, 124% 0, 138% 100%, 140% 100%); } to { clip-path: polygon(140% 0, -50% 0, -36% 100%, 140% 100%); } }
[data-nav="wipe"] .cb-leaving { animation: cb-hide 60ms linear 900ms both; }
[data-nav="wipe"] .cb-leaving .cb-a { animation: cb-in 900ms cubic-bezier(.5, 0, .75, .4) both reverse; --dx: calc(-160 * var(--u)); --sx: var(--cb-dir); --ds: 1.04; }
[data-nav="wipe"] .cb-entering .cb-a { animation-delay: calc(300ms + var(--i, 0) * 70ms); }
[data-nav="wipe"] .cb-entering .cb-backdrop { --dx: calc(40 * var(--u)); --ds: 1.08; animation-delay: 120ms; animation-duration: 1000ms; }
[data-nav="wipe"] .cb-header .cb-a { --dy: calc(-50 * var(--u)); }
[data-nav="wipe"] .cb-header h1 { --i: 1; }
[data-nav="wipe"] .cb-header > :last-child { --i: 2; }
[data-nav="wipe"] .cb-tracks.cb-entering .cb-card { animation: cb-in 760ms var(--cb-ease) both; --sx: var(--cb-dir); --dx: calc(520 * var(--u)); --ds: .9; animation-delay: 420ms; }
[data-nav="wipe"] .cb-tracks.cb-entering .cb-card[data-slot="1"] { animation-delay: 490ms; }
[data-nav="wipe"] .cb-tracks.cb-entering .cb-card[data-slot="2"] { animation-delay: 550ms; }
[data-nav="wipe"] .cb-pager { --dy: calc(40 * var(--u)); --i: 3; }
[data-nav="wipe"] .cb-dock { --dy: calc(80 * var(--u)); --i: 4; }
[data-nav="wipe"] .cb-home-art { --dx: calc(-30 * var(--u)); --ds: 1.08; }
/* Full-screen art only drifts a little and is scaled up enough that its edges never come into view. */
[data-nav="wipe"] .cb-leaving :is(.cb-home-art, .cb-backdrop, .cb-page-bg) { --dx: 0px; --dy: 0px; --ds: 1.05; }

/* Home ⇄ about / feedback: the page rises over the home scene. */
[data-nav="rise"] .cb-a { --dy: calc(140 * var(--u)); }
[data-nav="rise"] .cb-page-bg, [data-nav="rise"] .cb-home-art { --dy: 0px; --ds: 1.1; --db: 8px; }
[data-nav="rise"] .cb-header .cb-a { --dy: calc(-40 * var(--u)); }
[data-nav="rise"] .cb-header h1 { --i: 1; }
[data-nav="rise"] .cb-page-body > :nth-child(1) { --i: 2; }
[data-nav="rise"] .cb-page-body > :nth-child(2) { --i: 3; --dy: calc(220 * var(--u)); }

/* Tracks ⇄ riders: a sideways slide with parallax; the rider rides in furthest. */
[data-nav="slide"] .cb-a { --dx: calc(240 * var(--u)); --i: 0; }
[data-nav="slide"] .cb-backdrop { --dx: 0px; }
[data-nav="slide"] .cb-carousel { --dx: calc(760 * var(--u)); --i: 1; }
[data-nav="slide"] .cb-carousel.cb-a { animation-duration: 600ms; }
[data-nav="slide"] .cb-dock, [data-nav="slide"] .cb-pager { --dx: calc(420 * var(--u)); --i: 2; }
[data-nav="slide"] .cb-rider-info { --dx: calc(380 * var(--u)); --i: 1; }
[data-nav="slide"] .cb-rider-figure { --dx: calc(900 * var(--u)); --ds: .92; --i: 0; }
[data-nav="slide"] .cb-roster-dock { --dx: calc(300 * var(--u)); --dy: calc(40 * var(--u)); --i: 2; }

@media (prefers-reduced-motion: reduce) {
  .cb-menu *, .cb-menu *::before, .cb-menu *::after { transition: none !important; }
  .cb-entering .cb-a, .cb-leaving .cb-a, [data-nav] .cb-card { animation: cb-fade 200ms ease both !important; }
  .cb-leaving .cb-a, .cb-leaving { animation-direction: reverse !important; }
  .cb-hero[data-current="true"] { animation: none; }
  .cb-rim::before { animation: none; }
  .cb-home-start::after, .cb-home-start .cb-caret { animation: none; }
  .cb-home-art img:is([data-current], [data-leaving]) { animation: none; }
  .cb-wipe { display: none !important; }
  [data-nav] .cb-view.cb-entering { clip-path: none !important; }
}

/* ==== Portrait: design canvas 430 × 932 ======================================================== */
@media (max-aspect-ratio: 1/1) {
  .cb-menu {
    --u: min(calc(100vw / 430), calc(100svh / 932));
    --edge: max(calc(18 * var(--u)), 12px);
    --top: calc(16 * var(--u));
    --bottom: calc(26 * var(--u));
    --btn-h: max(36px, calc(42 * var(--u)));
    --btn-font: max(13px, calc(15 * var(--u)));
    --title: max(22px, calc(31 * var(--u)));
    --round: calc(14 * var(--u));
    --card-w: calc(344 * var(--u));
    --card-h: calc(486 * var(--u));
    --dock-w: min(calc(100vw - var(--edge) * 2), calc(394 * var(--u)));
    --dock-h: calc(118 * var(--u));
    --race-w: 100%;
    --race-h: max(44px, calc(54 * var(--u)));
    --race-font: max(17px, calc(21 * var(--u)));
  }
  /* Header: buttons on the first row, the title centred below them. */
  .cb-header { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; row-gap: calc(10 * var(--u)); }
  .cb-header h1 { grid-row: 2; grid-column: 1 / -1; }
  .cb-header > :last-child { grid-column: 3; grid-row: 1; }
  .cb-header > :first-child { grid-row: 1; }
  .cb-menu .cb-card { border-radius: calc(26 * var(--u)); padding: calc(5 * var(--u)); }
  .cb-rim { padding: calc(5 * var(--u)); }
  .cb-card-content { grid-template-rows: minmax(0, 1fr) auto; border-radius: calc(21 * var(--u)); }
  .cb-card:not([aria-current="true"]) .cb-card-content { grid-template-rows: minmax(0, 2.16fr) minmax(0, 1fr); }
  .cb-card[data-slot="-1"], .cb-card[data-slot="1"] { --cb-y: calc(var(--card-h) * .012); }
  .cb-card[data-slot="-1"] { --cb-x: -.566; --cb-angle: 15deg; }
  .cb-card[data-slot="1"] { --cb-x: .566; --cb-angle: -15deg; }
  .cb-card[data-slot="-2"], .cb-card[data-slot="2"] { opacity: 0; pointer-events: none; visibility: hidden; }
  .cb-info { display: flex; flex-direction: column; align-items: stretch; gap: 2.2cqw; padding: 4cqw; }
  .cb-card-name { font-size: max(19px, 8.4cqw); }
  .cb-card-copy { font-size: max(11px, 3.6cqw); white-space: normal; }
  .cb-tags { gap: 1.4cqw; margin-block-start: 2.2cqw; }
  .cb-tags > span { font-size: max(10px, 2.9cqw); }
  .cb-chapter { font-size: max(11px, 3.8cqw); }
  .cb-statistics { border-block-start: 1px solid #bccad84d; padding-block-start: 1.7cqw; }
  .cb-stat { flex-direction: row; align-items: baseline; gap: .44em; padding-inline: 2.6cqw; }
  .cb-stat:first-child { padding-inline-start: 0; border-inline-start: 0; }
  .cb-stat strong { font-size: max(15px, 5.7cqw); }
  .cb-stat span { font-size: max(10px, 3.4cqw); }
  .cb-card:not([aria-current="true"]) .cb-card-name { font-size: max(15px, 7cqw); }
  .cb-pager { block-size: calc(52 * var(--u)); }
  .cb-menu .cb-dot { inline-size: max(26px, calc(31 * var(--u))); }
  .cb-dock { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(10 * var(--u)); padding: calc(10 * var(--u)); border-radius: calc(18 * var(--u)); }
  .cb-mode-settings { flex-direction: column; align-items: stretch; gap: calc(7 * var(--u)); }
  .cb-mode-toggle { display: grid; grid-template-columns: 1fr 1fr; }
  .cb-mode-option span { flex: 1 1 auto; }
  .cb-mode-option span { justify-content: center; text-align: center; min-block-size: max(32px, calc(38 * var(--u))); padding-inline: calc(10 * var(--u)); font-size: max(13px, calc(14 * var(--u))); }
  .cb-mode-rule { font-size: max(12px, calc(12.5 * var(--u))); text-align: center; line-height: 1.3; white-space: normal; text-wrap: balance; }
  .cb-dock .cb-race { inline-size: 100%; }


  /* Riders: the figure on top, the profile under it, the roster and confirm at the bottom. */
  .cb-rider-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: calc(10 * var(--u)); padding-block: calc(8 * var(--u)); align-items: stretch; inline-size: min(100%, calc(430 * var(--u))); margin-inline: auto; }
  .cb-rider-figure { grid-column: 1; grid-row: 1; max-inline-size: none; }
  .cb-rider-header h1 { font-size: max(22px, calc(30 * var(--u))); }
  .cb-rider-header { row-gap: calc(6 * var(--u)); }
  .cb-rider-info { grid-column: 1; grid-row: 2; grid-template-columns: minmax(0, 1fr) auto; column-gap: calc(12 * var(--u)); row-gap: calc(8 * var(--u)); align-items: end; }
  .cb-rider-id { grid-column: 1; grid-row: 1; }
  .cb-profile-no { font-size: max(11px, calc(12 * var(--u))); }
  .cb-profile-no::before { inline-size: calc(36 * var(--u)); margin-block-end: calc(6 * var(--u)); }
  .cb-profile-name { font-size: max(26px, calc(36 * var(--u))); }
  .cb-profile-title { margin-block-start: calc(2 * var(--u)); font-size: max(13px, calc(15 * var(--u))); }
  .cb-profile-prop { grid-column: 2; grid-row: 1; grid-template-columns: auto auto; gap: calc(8 * var(--u)); padding: 0; border: 0; }
  .cb-prop-text { text-align: end; }
  .cb-prop-text span { font-size: max(11px, calc(11 * var(--u))); }
  .cb-prop-text strong { font-size: max(13px, calc(14 * var(--u))); }
  .cb-prop-img { inline-size: max(48px, calc(64 * var(--u))); padding: calc(6 * var(--u)); border-radius: calc(12 * var(--u)); }
  .cb-rider-detail { grid-column: 1 / -1; grid-row: 2; grid-template-columns: calc(140 * var(--u)) minmax(0, 1fr); gap: calc(12 * var(--u)); padding: calc(10 * var(--u)) calc(12 * var(--u)); border-radius: calc(16 * var(--u)); }
  .cb-story { font-size: max(12px, calc(13 * var(--u))); line-height: 1.55; }
  .cb-radar-label small { font-size: max(10px, calc(10 * var(--u))); }
  .cb-radar-label b { font-size: max(11px, calc(12 * var(--u))); }
  .cb-roster-dock { flex-direction: column; align-items: stretch; gap: calc(10 * var(--u)); padding: calc(10 * var(--u)); border-radius: calc(18 * var(--u)); inline-size: min(calc(100vw - var(--edge) * 2), calc(394 * var(--u))); align-self: center; margin-inline: auto; }
  .cb-menu .cb-roster-tile { inline-size: max(44px, calc(50 * var(--u))); font-size: max(11px, calc(11.5 * var(--u))); }
  .cb-roster-tile img { border-radius: calc(12 * var(--u)); }
  .cb-roster-dock .cb-confirm { inline-size: 100%; }

  [data-nav="slide"] .cb-carousel { --dx: calc(420 * var(--u)); }
  [data-nav="slide"] .cb-rider-figure { --dx: calc(380 * var(--u)); }
  [data-nav="slide"] .cb-a { --dx: calc(160 * var(--u)); }

  /* About & feedback, portrait: one column. */
  .cb-page-header > h1.cb-a { font-size: max(22px, calc(30 * var(--u))); }
  .cb-page-header { row-gap: calc(6 * var(--u)); }
  .cb-page-body { gap: calc(14 * var(--u)); padding-block-start: calc(12 * var(--u)); }
  .cb-about-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .cb-eyebrow { font-size: max(11px, calc(11 * var(--u))); }
  .cb-eyebrow::before { inline-size: calc(36 * var(--u)); margin-block-end: calc(8 * var(--u)); }
  .cb-about-intro h2 { font-size: max(28px, calc(38 * var(--u))); }
  .cb-about-lead { font-size: max(14px, calc(16 * var(--u))); }
  .cb-about-text { margin-block-start: calc(8 * var(--u)); font-size: max(13px, calc(13.5 * var(--u))); line-height: 1.6; }
  .cb-about-facts { gap: calc(18 * var(--u)); margin-block-start: calc(10 * var(--u)); padding-block: calc(8 * var(--u)); }
  .cb-about-facts dt { font-size: max(18px, calc(22 * var(--u))); }
  .cb-about-facts dd { font-size: max(11px, calc(11 * var(--u))); }
  .cb-about-version { display: none; }
  .cb-about-panel { border-radius: calc(18 * var(--u)); }
  .cb-page-sheet { gap: calc(20 * var(--u)); padding: calc(14 * var(--u)) calc(16 * var(--u)); }
  .cb-tabs { padding: calc(6 * var(--u)) calc(10 * var(--u)) 0; }
  .cb-menu .cb-tabs [role="tab"] { font-size: max(13px, calc(14 * var(--u))); padding: 8px 10px 10px; }
  .cb-page-turn { padding: calc(8 * var(--u)) calc(10 * var(--u)); }
  .cb-keys { grid-template-columns: minmax(0, 1fr); }
  .cb-keys > div { grid-template-columns: calc(120 * var(--u)) minmax(0, 1fr); }
  .cb-keys dd { font-size: max(12px, calc(13 * var(--u))); }
  .cb-settings-panel { padding: calc(14 * var(--u)) calc(16 * var(--u)); gap: calc(16 * var(--u)); border-radius: calc(18 * var(--u)); }
  .cb-settings-panel { grid-template-columns: minmax(0, 1fr); }
  .cb-setting { flex-wrap: wrap; gap: calc(10 * var(--u)); }
  .cb-setting strong { font-size: max(14px, calc(15 * var(--u))); }
  .cb-setting small { font-size: max(11px, calc(12 * var(--u))); }
  .cb-range { flex: 1 1 100%; }
  .cb-records-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .cb-records-main { container-type: normal; gap: calc(8 * var(--u)); }
  .cb-records-main { --world-w: 100%; }
  .cb-world { border-radius: calc(16 * var(--u)); }
  .cb-record-detail { flex: none; padding: calc(10 * var(--u)) calc(12 * var(--u)); border-radius: calc(14 * var(--u)); grid-template-rows: auto auto; row-gap: 6px; }
  .cb-detail-text, .cb-detail-tags, .cb-detail-hint { display: none; }
  .cb-detail-head strong { font-size: max(16px, calc(18 * var(--u))); }
  .cb-detail-bests { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 1fr 1fr; padding: 0; border: 0; }
  .cb-detail-bests dd { font-size: max(13px, calc(14 * var(--u))); }
  .cb-menu .cb-detail-go { block-size: 36px; font-size: 14px; }
  .cb-composer { align-self: auto; }
  .cb-composer textarea { flex: none; }
  .cb-menu .cb-record button { grid-template-columns: calc(72 * var(--u)) minmax(0, 1fr) auto; gap: calc(10 * var(--u)); }
  .cb-record-stats { gap: calc(10 * var(--u)); }
  .cb-record-summary { padding: calc(10 * var(--u)) calc(12 * var(--u)); }
  .cb-pin-label { display: none; }
  .cb-pin-dot { inline-size: max(24px, calc(28 * var(--u))); font-size: 12px; }
  .cb-pin[aria-pressed="true"] .cb-pin-label { display: block; }
  .cb-page h3 { margin-block-end: calc(8 * var(--u)); font-size: max(14px, calc(15 * var(--u))); }
  .cb-rules li, .cb-credit { font-size: max(13px, calc(13.5 * var(--u))); }
  .cb-mode-cards { grid-template-columns: minmax(0, 1fr); gap: calc(8 * var(--u)); }
  .cb-mode-card { padding: calc(10 * var(--u)) calc(12 * var(--u)); }
  .cb-mode-card strong { font-size: max(14px, calc(15 * var(--u))); }
  .cb-mode-card span { font-size: max(12px, calc(13 * var(--u))); }
  .cb-map-grid { grid-template-columns: 1fr 1fr; gap: calc(10 * var(--u)); }
  .cb-map-tile figcaption { padding: calc(8 * var(--u)); }
  .cb-map-tile strong { font-size: max(13px, calc(14 * var(--u))); }
  .cb-map-tile span { display: none; }
  .cb-map-tile small, .cb-map-tile em { font-size: max(10px, calc(10.5 * var(--u))); }

  .cb-feedback-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .cb-wall-area { grid-row: 1; gap: calc(10 * var(--u)); }
  .cb-wall-tools { flex-wrap: nowrap; }
  .cb-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-inline-size: 0; }
  .cb-chip span { min-block-size: max(30px, calc(32 * var(--u))); padding-inline: calc(11 * var(--u)); font-size: max(12px, calc(13 * var(--u))); }
  .cb-wall { columns: 2 calc(150 * var(--u)); column-gap: calc(10 * var(--u)); padding-inline: 2px; }
  .cb-note { margin-block-end: calc(10 * var(--u)); padding: calc(10 * var(--u)) calc(11 * var(--u)) calc(6 * var(--u)); border-radius: calc(12 * var(--u)); }
  .cb-note header, .cb-note footer { font-size: max(11px, calc(11 * var(--u))); }
  .cb-note p { margin-block: calc(6 * var(--u)); font-size: max(13px, calc(13.5 * var(--u))); line-height: 1.5; }
  .cb-composer { grid-row: 2; gap: calc(8 * var(--u)); padding: calc(10 * var(--u)); border-radius: calc(18 * var(--u)); }
  .cb-composer h2, .cb-composer-note { display: none; }
  .cb-composer .cb-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cb-composer textarea { min-block-size: 0; block-size: max(64px, calc(70 * var(--u))); font-size: max(14px, calc(14 * var(--u))); }
  .cb-composer .cb-field { padding: .5em .8em; font-size: max(14px, calc(14 * var(--u))); }
  .cb-composer-row .cb-gold { min-block-size: max(40px, calc(42 * var(--u))); font-size: max(15px, calc(16 * var(--u))); padding-inline: calc(16 * var(--u)); }
  .cb-menu:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru)) .cb-profile-name { font-size: max(24px, calc(32 * var(--u))); }
  .cb-menu:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru)) .cb-roster-tile { inline-size: max(52px, calc(58 * var(--u))); font-size: max(10px, calc(11 * var(--u))); }


  .cb-rider-backdrop img.cb-rider-scene { inset-inline-start: 0; inline-size: 100%; object-position: 78% 30%; -webkit-mask-image: none; mask-image: none; }
  .cb-riders[data-scene] .cb-rider-shade { background: linear-gradient(180deg, #0d182880 0%, transparent 16%, transparent 34%, #0d1828d9 56%, #0d1828f2 100%); }


  /* Home, portrait: tool pill centred on top, logo under it, compact dock with Start above the tiles. */
  .cb-home-art { object-position: 62% 50%; transform: scale(1.12); transform-origin: 62% 30%; }
  .cb-home-shade { background: linear-gradient(180deg, #0c172790 0%, transparent 18%), linear-gradient(0deg, #0c1727f0 0%, #0c1727c8 14%, #0c172780 24%, #0c172730 32%, transparent 40%); }
  .cb-home-tools { inset-inline-end: 50%; translate: 50% 0; inset-block-start: max(calc(16 * var(--u)), calc(env(safe-area-inset-top, 0px) + 8px)); padding: 3px; }
  .cb-menu .cb-tool { block-size: max(32px, calc(34 * var(--u))); padding-inline: .8em; gap: .35em; font-size: max(12px, calc(13 * var(--u))); }
  .cb-lang-menu { inset-inline: 0 auto; }
  .cb-logo { inset-inline-start: 50%; translate: -50% 0; inset-block-start: max(calc(66 * var(--u)), calc(env(safe-area-inset-top, 0px) + 56px)); inline-size: min(calc(100% - 40px), calc(320 * var(--u))); }
  .cb-home-dock { inset-inline: max(var(--edge), calc((100% - 394 * var(--u)) / 2)); translate: none; inset-block-end: max(calc(18 * var(--u)), calc(env(safe-area-inset-bottom, 0px) + 8px)); flex-direction: column-reverse; align-items: stretch; gap: calc(8 * var(--u)); padding: calc(8 * var(--u)); border-radius: calc(22 * var(--u)); }
  .cb-home-sep { display: none; }
  .cb-menu .cb-home-start { inline-size: 100%; block-size: max(48px, calc(54 * var(--u))); padding-inline: calc(26 * var(--u)) calc(22 * var(--u)); border-radius: calc(16 * var(--u)); font-size: max(17px, calc(22 * var(--u))); }
  .cb-home-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(8 * var(--u)); }
  .cb-menu .cb-home-tile { inline-size: auto; block-size: max(52px, calc(56 * var(--u))); gap: 3px; border-radius: calc(14 * var(--u)); font-size: max(12px, calc(13 * var(--u))); }
  .cb-home-tile .cb-icon { inline-size: max(20px, calc(22 * var(--u))); block-size: max(20px, calc(22 * var(--u))); }
  .cb-home-tile small { inset-block-start: -7px; inset-inline-end: -4px; font-size: 10px; }
  .cb-home-version { display: none; }



  /* Home bottom, portrait: dock, then the notice; the age badge sits beside the notice. */
  .cb-home-bottom { translate: none; inline-size: auto; max-inline-size: none; gap: 10px; inset-inline: max(var(--edge), calc((100% - 394 * var(--u)) / 2)); inset-block-end: max(calc(12 * var(--u)), calc(env(safe-area-inset-bottom, 0px) + 8px)); }

  .cb-home-legal { display: flex; align-items: stretch; gap: 10px; }
  .cb-age-corner { display: none !important; }
  .cb-age-inline { display: flex !important; position: static; flex: none; flex-direction: column; border-radius: 6px; }
  .cb-age-inline b { flex: 1; padding: 0; font-size: calc(var(--hf) * 1.3); }
  .cb-age-inline small { display: grid; flex: none; padding: .1em .4em .2em; font-size: calc(var(--hf) * .95); background: #e2b878; color: #3c2e1e; white-space: nowrap; }
  .cb-home-bottom .cb-health { flex: 1; inline-size: auto; min-inline-size: 0; text-align: start; font-size: 10px; line-height: 1.55; letter-spacing: 0; }
  /* Portrait: always exactly two lines like the standard notice; the text shrinks to fit instead of wrapping. */
  .cb-home-legal { container-type: inline-size; }
  .cb-home-legal > * { --hf: clamp(7px, calc((100cqi - 56px) / 29), 11px); }
  .cb-menu:not(:lang(zh-CN), :lang(ja), :lang(ko)) .cb-home-legal > * { --hf: clamp(7px, calc((100cqi - 56px) / 52), 11px); }
  .cb-health-line { display: block; margin: 0; white-space: nowrap; }
  .cb-menu.cb-menu .cb-home-bottom .cb-health-line + .cb-health-line { margin-inline-start: 0; }
  /* The badge stretches to the two lines; trimming the half-leading lines its top and bottom up with the text. */
  .cb-home-bottom .cb-health { align-self: center; font-size: var(--hf); line-height: 1.7; text-box: trim-both cap alphabetic; padding-block: .15em; }
}

/* ==== Phone landscape (short screens): design canvas 900 × 420 ==================================== */
@media (min-aspect-ratio: 1001/1000) and (max-height: 540px) {
  .cb-menu {
    --u: min(calc(100vw / 900), calc(100svh / 420));
    --edge: max(calc(24 * var(--u)), env(safe-area-inset-left, 0px), 12px);
    --top: calc(12 * var(--u));
    --bottom: calc(10 * var(--u));
    --btn-h: max(32px, calc(36 * var(--u)));
    --btn-font: max(12px, calc(14 * var(--u)));
    --title: max(19px, calc(24 * var(--u)));
    --round: calc(12 * var(--u));
    --card-w: calc(440 * var(--u));
    --card-h: calc(250 * var(--u));
    --dock-w: calc(440 * var(--u));
    --dock-h: calc(54 * var(--u));
    --race-w: calc(150 * var(--u));
    --race-h: max(32px, calc(38 * var(--u)));
    --race-font: max(15px, calc(17 * var(--u)));
  }
  .cb-header { padding-block-start: max(var(--top), env(safe-area-inset-top, 0px), 8px); }
  .cb-menu .cb-card { border-radius: calc(18 * var(--u)); padding: calc(3 * var(--u)); }
  .cb-rim { padding: max(2px, calc(3 * var(--u))); }
  .cb-card-content { grid-template-rows: minmax(0, 1.6fr) minmax(0, 1fr); border-radius: calc(15 * var(--u)); }
  .cb-info { padding: 2.4cqw 3cqw; gap: 2.4cqw; }
  .cb-card-copy { margin-block-start: .2em; }
  .cb-tags { display: none; }
  .cb-pager { block-size: calc(30 * var(--u)); }
  .cb-dock { padding: calc(6 * var(--u)) calc(8 * var(--u)); border-radius: calc(12 * var(--u)); }
  .cb-mode-settings { flex-direction: row; align-items: center; gap: 8px; }
  .cb-mode-option span { min-block-size: max(26px, calc(30 * var(--u))); padding-inline: calc(8 * var(--u)); font-size: max(11px, calc(13 * var(--u))); }
  .cb-mode-rule { display: none; }
  .cb-dock .cb-race { inline-size: var(--race-w); }


  .cb-rider-stage { grid-template-columns: calc(330 * var(--u)) minmax(0, 1fr); gap: calc(16 * var(--u)); padding-block: calc(6 * var(--u)); }
  .cb-rider-header { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cb-rider-header h1 { grid-column: 2; grid-row: 1; font-size: var(--title); }
  .cb-rider-header > .cb-summary { grid-column: 3; }
  .cb-rider-stage { grid-template-columns: calc(560 * var(--u)) minmax(0, 1fr); }
  .cb-rider-info { grid-template-columns: minmax(0, 1fr) auto; column-gap: calc(12 * var(--u)); row-gap: calc(8 * var(--u)); margin-block-start: 0; }
  .cb-profile-no { font-size: max(10px, calc(10 * var(--u))); }
  .cb-profile-no::before { inline-size: calc(30 * var(--u)); margin-block-end: calc(5 * var(--u)); }
  .cb-profile-name { font-size: max(22px, calc(34 * var(--u))); }
  .cb-profile-title { margin-block-start: 0; font-size: max(11px, calc(12 * var(--u))); }
  .cb-profile-prop { gap: calc(8 * var(--u)); }
  .cb-prop-text span { font-size: max(10px, calc(10 * var(--u))); }
  .cb-prop-text strong { font-size: max(12px, calc(12 * var(--u))); }
  .cb-prop-img { inline-size: max(44px, calc(58 * var(--u))); padding: calc(5 * var(--u)); border-radius: calc(10 * var(--u)); }
  .cb-rider-detail { grid-template-columns: calc(124 * var(--u)) minmax(0, 1fr); gap: calc(10 * var(--u)); padding: calc(8 * var(--u)) calc(12 * var(--u)); border-radius: calc(12 * var(--u)); }
  .cb-story { font-size: max(10px, calc(10.5 * var(--u))); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
  .cb-radar-label small { font-size: 10px; }
  .cb-radar-label b { font-size: 11px; }
  .cb-roster-dock { gap: calc(12 * var(--u)); padding: calc(6 * var(--u)) calc(8 * var(--u)); border-radius: calc(14 * var(--u)); }
  .cb-menu .cb-roster-tile { inline-size: max(40px, calc(44 * var(--u))); gap: 2px; font-size: max(10px, calc(10.5 * var(--u))); }
  .cb-roster-tile img { border-radius: calc(9 * var(--u)); }

  .cb-page-header { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cb-page-header > h1.cb-a { grid-column: 2; grid-row: 1; font-size: var(--title); }
  .cb-page-header > .cb-summary { grid-column: 3; }
  .cb-page-body { gap: calc(20 * var(--u)); padding-block-start: calc(8 * var(--u)); }
  .cb-about-body { grid-template-columns: calc(300 * var(--u)) minmax(0, 1fr); }
  .cb-eyebrow { font-size: 10px; }
  .cb-eyebrow::before { inline-size: calc(30 * var(--u)); margin-block-end: calc(6 * var(--u)); }
  .cb-about-intro h2 { font-size: max(22px, calc(36 * var(--u))); }
  .cb-about-lead { font-size: max(13px, calc(15 * var(--u))); }
  .cb-about-text { margin-block-start: calc(6 * var(--u)); font-size: max(11px, calc(11.5 * var(--u))); line-height: 1.55; }
  .cb-about-facts { gap: calc(14 * var(--u)); margin-block-start: calc(8 * var(--u)); padding-block: calc(6 * var(--u)); }
  .cb-about-facts dt { font-size: max(15px, calc(18 * var(--u))); }
  .cb-about-facts dd { font-size: 10px; }
  .cb-about-version { display: none; }
  .cb-about-panel { border-radius: calc(14 * var(--u)); }
  .cb-page-sheet { gap: calc(14 * var(--u)); padding: calc(10 * var(--u)) calc(14 * var(--u)); }
  .cb-tabs { padding: 4px calc(10 * var(--u)) 0; }
  .cb-menu .cb-tabs [role="tab"] { font-size: max(12px, calc(13 * var(--u))); padding: 6px 10px 8px; }
  .cb-page-turn { padding: 4px calc(10 * var(--u)); }
  .cb-menu .cb-page-turn button { min-block-size: 30px; }
  .cb-keys > div { grid-template-columns: calc(110 * var(--u)) minmax(0, 1fr); min-block-size: 30px; }
  .cb-keys kbd { min-inline-size: 22px; block-size: 22px; font-size: 11px; }
  .cb-keys dd { font-size: max(11px, calc(11.5 * var(--u))); }
  .cb-settings-panel { padding: calc(10 * var(--u)) calc(14 * var(--u)); gap: calc(10 * var(--u)) calc(24 * var(--u)); border-radius: calc(14 * var(--u)); }
  .cb-setting { min-block-size: 40px; padding-block: 4px; }
  .cb-setting strong { font-size: max(12px, calc(13 * var(--u))); }
  .cb-setting small { font-size: 10px; }
  .cb-records-body { grid-template-columns: minmax(0, 1fr) calc(330 * var(--u)); gap: calc(14 * var(--u)); }
  .cb-menu .cb-record button { grid-template-columns: minmax(0, 1fr) auto; gap: calc(8 * var(--u)); padding: 4px 6px; }
  .cb-record img { display: none; }
  .cb-record-summary { padding: 6px 10px; }
  .cb-pin-label { font-size: 10px; }
  .cb-records-main { --detail-h: calc(86 * var(--u)); gap: calc(8 * var(--u)); }
  .cb-record-detail { padding: 6px 12px; row-gap: 4px; grid-template-rows: auto auto; border-radius: calc(12 * var(--u)); }
  .cb-detail-text, .cb-detail-tags, .cb-detail-hint { display: none; }
  .cb-detail-head strong { font-size: max(14px, calc(15 * var(--u))); }
  .cb-detail-bests { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 1fr 1fr; padding: 0; border: 0; gap: 2px 12px; }
  .cb-detail-bests dd { font-size: 12px; }
  .cb-detail-bests dt { font-size: 10px; }
  .cb-menu .cb-detail-go { block-size: 30px; font-size: 12px; }
  .cb-record-summary dt { font-size: max(14px, calc(18 * var(--u))); white-space: nowrap; }
  .cb-pin-dot { inline-size: 26px; font-size: 12px; }
  .cb-record-name strong, .cb-record-stats b { font-size: max(12px, calc(12 * var(--u))); }
  .cb-page h3 { margin-block-end: calc(6 * var(--u)); font-size: max(13px, calc(13 * var(--u))); }
  .cb-rules li, .cb-credit, .cb-mode-card span { font-size: max(11px, calc(11.5 * var(--u))); }
  .cb-mode-card strong, .cb-map-tile strong { font-size: max(12px, calc(13 * var(--u))); }
  .cb-map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cb-map-tile span { display: none; }
  .cb-feedback-body { grid-template-columns: calc(290 * var(--u)) minmax(0, 1fr); }
  .cb-composer { gap: calc(7 * var(--u)); padding: calc(10 * var(--u)) calc(12 * var(--u)); border-radius: calc(14 * var(--u)); }
  .cb-composer h2 { font-size: max(14px, calc(15 * var(--u))); }
  .cb-composer textarea { min-block-size: calc(60 * var(--u)); }
  .cb-composer .cb-field { padding: .45em .7em; font-size: max(12px, calc(12 * var(--u))); }
  .cb-composer-note { display: none; }
  .cb-composer-row .cb-gold { min-block-size: 34px; font-size: max(13px, calc(14 * var(--u))); padding-inline: calc(12 * var(--u)); }
  .cb-chip span { min-block-size: 28px; padding-inline: calc(9 * var(--u)); font-size: max(11px, calc(11.5 * var(--u))); }
  .cb-wall-area { gap: calc(8 * var(--u)); }
  .cb-wall-tools { flex-wrap: nowrap; }
  .cb-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-inline-size: 0; }
  .cb-wall { columns: 2 calc(200 * var(--u)); column-gap: calc(10 * var(--u)); }
  .cb-note { margin-block-end: calc(10 * var(--u)); padding: calc(8 * var(--u)) calc(10 * var(--u)) calc(4 * var(--u)); border-radius: calc(10 * var(--u)); }
  .cb-note header, .cb-note footer { font-size: 11px; }
  .cb-note p { margin-block: calc(5 * var(--u)); font-size: max(12px, calc(12 * var(--u))); line-height: 1.45; }
  .cb-menu:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru)) .cb-profile-name { font-size: max(20px, calc(28 * var(--u))); }
  .cb-menu:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru)) .cb-roster-tile { inline-size: max(48px, calc(52 * var(--u))); font-size: 10px; }
  .cb-prop-img { inline-size: max(40px, calc(48 * var(--u))); }



  .cb-logo { inline-size: calc(250 * var(--u)); inset-block-start: max(calc(12 * var(--u)), env(safe-area-inset-top, 0px)); inset-inline-start: max(calc(20 * var(--u)), env(safe-area-inset-left, 0px)); }
  .cb-menu .cb-tool { block-size: max(30px, calc(32 * var(--u))); font-size: max(11px, calc(12 * var(--u))); padding-inline: .75em; }
  .cb-home-tools { padding: 2px; }
  .cb-home-dock { inset-block-end: max(calc(10 * var(--u)), calc(env(safe-area-inset-bottom, 0px) + 6px)); gap: calc(6 * var(--u)); padding: calc(6 * var(--u)); border-radius: calc(16 * var(--u)); }
  .cb-home-tiles { gap: calc(6 * var(--u)); }
  .cb-menu .cb-home-tile { inline-size: max(48px, calc(54 * var(--u))); block-size: max(46px, calc(52 * var(--u))); gap: 2px; border-radius: calc(12 * var(--u)); font-size: max(10px, calc(11 * var(--u))); }
  .cb-home-tile .cb-icon { inline-size: 18px; block-size: 18px; }
  .cb-home-tile small { inset-block-start: -6px; inset-inline-end: -6px; font-size: 10px; }
  .cb-home-sep { block-size: calc(36 * var(--u)); margin-inline: 2px; }
  .cb-menu .cb-home-start { inline-size: auto; min-inline-size: calc(170 * var(--u)); block-size: max(46px, calc(52 * var(--u))); padding-inline: calc(18 * var(--u)) calc(14 * var(--u)); font-size: max(15px, calc(18 * var(--u))); border-radius: calc(12 * var(--u)); }
  .cb-home-version { display: none; }


  .cb-home-bottom { gap: 4px; inset-block-end: max(4px, env(safe-area-inset-bottom, 0px)); }
  .cb-age { inset-block-end: max(calc(28 * var(--u)), calc(env(safe-area-inset-bottom, 0px) + 22px)); inset-inline-start: max(calc(16 * var(--u)), env(safe-area-inset-left, 0px)); border-radius: 6px; }
  .cb-age b { padding: 6px 7px; font-size: 12px; }
  .cb-age small { display: none; }
}
