/* Layout: a full-screen sky that darkens with altitude; the only elements are the meters and settings bottom right, notes bottom left and a card (falling, paused, flight over) top center. */
/* (and the pretend mini window's view in the page, mini.js, which has its own sky, light or dark, whatever the page's) */
:root, .mini-demo > .mini {
  --bg: #ffffff;
  --ink: #141414;
  --ink-2: #555555;
  --muted: #9a9a9a;
  --line: #e6e6e6;
  --line-2: #cfcfcf;
  --soft: #f4f4f4;
  --btn-h: #2c2c2c;
  --accent: #ff4f2e;
  --f-ui: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-num: var(--f-ui);
  /* the screen's edge on a phone or tablet (notch, camera, home bar), 0 on a computer; the canvas reads the top one (trainings.js) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  color-scheme: light;
}
/* high up in the dark sky the interface switches to light text */
.game.dark {
  --bg: #0f1117;
  --ink: #f1f1f1;
  --ink-2: #b4b8c0;
  --muted: #7c818b;
  --line: #2a2e37;
  --line-2: #464b56;
  --soft: #1b1e25;
  --btn-h: #d4d4d4;
  color-scheme: dark;
}
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--f-ui); font-size: 14px; line-height: 1.45; overflow: hidden; }
[hidden] { display: none !important; }
.game { position: relative; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
canvas { display: block; width: 100%; height: 100%; }
.vals, .gear, .sheet, .card { transition: color .8s ease, background-color .8s ease, border-color .8s ease, filter .8s ease; }

@keyframes arrive { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: 16px; padding-bottom: var(--safe-bottom); pointer-events: none;
}
.note {
  flex: 1 1 300px; min-width: 0; max-width: 34ch; margin: 0;
  color: var(--ink-2); font-size: 24px; line-height: 1.35;
  opacity: 0; transform: translateY(3px); transition: opacity 1s ease, transform 1s ease, color .8s ease;
}
.note.on { opacity: 1; transform: none; }
.note.swap { transition-duration: .3s; }
.nt { color: var(--ink); font-weight: 500; transition: color .8s ease; }
.meter { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 16px; pointer-events: auto; }
/* the meters stand in a column over the buttons, all one size and colour: height, watts, heart rate; then the ride time and distance
   as one quiet line, smaller and grey */
.vals {
  flex-basis: 100%; display: flex; flex-direction: column; align-items: flex-end; gap: 9px;
  font-family: var(--f-num); font-weight: 500; font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap;
}
#time { font-size: .65em; letter-spacing: 0; color: var(--ink-2); transition: color .8s ease; }
.gear {
  width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
}
.gear:hover, .gear[aria-expanded="true"] { color: var(--ink); border-color: var(--line-2); }
.gear svg { width: 17px; height: 17px; }
/* the speaker shows its waves while sound is on and a cross while it's off; full screen shows the way it goes */
.gear .off, .gear[aria-pressed="false"] .on { display: none; }
.gear[aria-pressed="false"] .off { display: inline; }

.sheet {
  position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(48px + var(--safe-bottom));
  box-sizing: border-box; width: min(352px, calc(100% - 32px)); max-height: calc(100% - 80px - var(--safe-bottom) - var(--safe-top)); overflow: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .08); padding: 16px;
  display: flex; flex-direction: column; gap: 18px;
}
.sh-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sh-title { font-weight: 600; font-size: 15px; }
.sh-sec { display: flex; flex-direction: column; gap: 8px; }
.sh-lbl { font-size: 12px; color: var(--muted); }
.sh-val { font-family: var(--f-num); font-size: 13px; font-variant-numeric: tabular-nums; }
.sh-hint { margin: 0; font-size: 12.5px; color: var(--ink-2); max-width: 48ch; }
.sh-hint a { color: var(--ink); text-underline-offset: 2px; }
.sh-about { align-self: flex-start; font-size: 12.5px; color: var(--muted); text-underline-offset: 2px; }
.sh-about:hover { color: var(--ink); }
/* settings (ui.js): one column in groups, a larger title and each group under a heading in plain black text; in Free ride the watts
   stay, greyed; About, Buy me a coffee and the units small at the bottom (the coffee also on the end card) */
.sh-title.big { font-size: 19px; }
.sh-h { margin: 0; font: 500 15.5px/1.3 var(--f-ui); color: var(--ink); }
#sheet { gap: 22px; }
#sheet > .sh-sec { gap: 10px; }
#erg-ctl { transition: opacity .3s ease; }
#erg-ctl.off { opacity: .35; }
/* a browser without Bluetooth (ui.js): what only riding needs shows greyed out and can't be used */
.sh-sec.nobt { opacity: .35; }
.sh-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; }
/* the units, small at the end of the line (ui.js), the links level with them; where the links fill the line, the units go under them */
.sh-foot .sh-about, .sh-foot .link { flex: none; align-self: center; }
.seg.units { margin-left: auto; padding: 2px; border-radius: 8px; }
.seg.units button { flex: none; font-size: 12px; padding: 4px 9px; border-radius: 6px; }
/* the small windows from settings (Bluetooth, the pilot, another device): beside the sheet on a wide screen (the sheet is 352 px with
   its padding), over it on a narrow one */
.sheet.sub { right: calc(max(16px, env(safe-area-inset-right, 0px)) + 364px); gap: 16px; }
@media (max-width: 780px) { .sheet.sub { right: max(16px, env(safe-area-inset-right, 0px)); box-shadow: 0 14px 44px rgba(0, 0, 0, .18); } }
/* their rows: a label, a value, and Change (or Connect) with its control opening under the row */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; align-items: baseline; gap: 6px 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; padding-top: 2px; }
.rows .rv { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.rows .rv.dim { color: var(--muted); }
.rows .link { align-self: baseline; }
.rows .ed { grid-column: 1 / -1; padding-top: 6px; }
/* in a window the country's list opens in place, so the window grows up instead of the list spilling out of it */
.rows .pick-l { position: static; margin-top: 4px; }
.stats.three { grid-template-columns: repeat(3, auto); justify-content: space-between; padding-bottom: 4px; }
.cw-join { padding-top: 16px; border-top: 1px solid var(--line); }
/* where Bluetooth works, small and quiet under the Bluetooth window's rows */
.dev-where { padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; line-height: 0; }
.x:hover { color: var(--ink); }
.x svg { width: 16px; height: 16px; }
.btn {
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: 500 13.5px var(--f-ui);
  padding: 9px 14px; border-radius: 9px; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--btn-h); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--line-2); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: flex; gap: 3px; background: var(--soft); padding: 3px; border-radius: 9px; }
.seg button { flex: 1 1 0; border: 0; background: transparent; color: var(--ink-2); font: 500 13px var(--f-ui); padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.sh-row label { font-size: 13px; }
.sh-row output { font-family: var(--f-num); font-size: 13px; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; margin: 0; accent-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card {
  position: absolute; left: 16px; right: 16px; top: max(84px, 15%); margin-inline: auto; max-width: 340px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .1); padding: 16px;
  display: flex; gap: 16px 20px;
  animation: arrive .5s ease both;
}
/* in a training the falling and paused cards sit below the workout's graph (trainings.js) */
.card.low { top: max(calc(196px + var(--safe-top)), 15%); }
.card-in { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.card .sh-hint { margin-top: -6px; }
.card .btns .btn { flex: 1 1 0; padding-block: 11px; }
/* the postcard (postcard.js): on the end card beside the ride, above it on narrow screens; a click opens it big over the game */
.card.pc { max-width: 660px; }
.pc-thumb {
  flex: 0 0 300px; align-self: flex-start; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: zoom-in;
  background: var(--soft); border: 1px solid var(--line); border-radius: 10px;
}
.pc-thumb:hover { border-color: var(--line-2); }
.pc-thumb img { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .4s ease; }
.pc-thumb img.on { opacity: 1; }
.pc-big {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px;
  background: rgba(255, 255, 255, .85); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .3s ease both;
}
.pc-big img {
  display: block; width: min(640px, calc(100vw - 32px), calc(100vh - 128px)); aspect-ratio: 1;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 44px rgba(0, 0, 0, .12);
}
.pc-big .x { position: absolute; top: max(16px, var(--safe-top)); right: max(16px, env(safe-area-inset-right, 0px)); }
.pc-big .x svg { width: 20px; height: 20px; }
.pc-big .btn { min-width: 120px; padding-block: 11px; }
@media (max-width: 720px) {
  .card { flex-direction: column; }
  .card.pc { max-width: 340px; }
  .pc-thumb { flex: 0 0 auto; width: min(100%, 30vh); }
}
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-family: var(--f-num); font-size: 16px; font-variant-numeric: tabular-nums; }
/* the journey's end card: the ride's bike km times each engine, then the journey so far */
.field {
  width: 100%; box-sizing: border-box; min-width: 0; font: 14px var(--f-ui); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; user-select: text; -webkit-user-select: text;
}
.field:focus { outline: none; border-color: var(--line-2); }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-list li {
  display: grid; grid-template-columns: 2.4ch minmax(0, 1fr) auto 5.5ch; gap: 10px; align-items: baseline;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px;
}
.lb-list li:first-child { border-top: 0; padding-top: 0; color: var(--muted); font-size: 12px; }
.lb-list .r, .lb-list .s { font-family: var(--f-num); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-list .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-list .a { font-family: var(--f-num); font-variant-numeric: tabular-nums; text-align: right; }
.lb-list .s { text-align: right; }
.lb-list li.me .n, .lb-list li.me .a { font-weight: 600; }
.lb-list li.me .r { color: var(--accent); }
/* the journey's boards (You, World, your country) in one look, in a wider sheet: each ride or pilot with the rocket, the bike and the
   time in their own columns, lined up across the rows (the list is one grid, each row a subgrid of it). On a narrow screen the three go
   under the name */
#lb { box-sizing: border-box; width: min(572px, calc(100% - 32px)); }
.lb-list.board { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; column-gap: 18px; }
.lb-list.board li { grid-column: 1 / -1; grid-template-columns: subgrid; gap: 3px 18px; padding: 9px 0; }
.board .a, .board .b, .board .s { font-family: var(--f-num); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; white-space: nowrap; }
.board li.head span { font-family: var(--f-ui); font-size: 12px; color: var(--muted); }
.board li.me span:not(.r) { font-weight: 600; }
/* "Together · …" closes the list as its sum, under a darker line, and stays at the sheet's bottom edge while a long list scrolls */
.board li.total { position: sticky; bottom: -16px; margin-top: 4px; padding-bottom: 16px; border-top-color: var(--line-2); background: var(--bg); transition: background-color .8s ease; }
.board li.total span { font-weight: 500; }
@media (max-width: 600px) {
  .lb-list.board { grid-template-columns: auto repeat(3, auto); justify-content: space-between; column-gap: 10px; }
  .lb-list.board li { column-gap: 10px; }
  .board .n { grid-column: 2 / -1; }
  .board .a { grid-column: 2; text-align: left; }
  .board .a, .board .b, .board .s { font-size: 13px; }
  .board li.head .r, .board li.head .n { display: none; }
}
/* the last rides kept on this device (rides.js) end in ›, in a column of their own, on the name's line on a narrow screen; a tap on
   the row opens its window, and the row stays lit while it's open */
.lb-list.board.kept { grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; }
@media (max-width: 600px) {
  .lb-list.board.kept { grid-template-columns: auto repeat(3, auto); }
  .board li.kept .n { grid-column: 2 / 4; }
  .board .lr-go { grid-column: 4; grid-row: 1; justify-self: end; }
}
.board li.kept { cursor: pointer; }
.board li.kept:hover, .board li.kept.on { background: var(--soft); box-shadow: -8px 0 0 var(--soft), 8px 0 0 var(--soft); }
.lr-go { align-self: center; border: 0; padding: 0; background: none; color: var(--muted); line-height: 0; cursor: pointer; }
.board li.kept:hover .lr-go, .board li.kept.on .lr-go { color: var(--ink); }
.lr-go svg { width: 16px; height: 16px; }
/* the ride's window: beside the leaderboard (572 px) on a wide screen, over it on a narrow one; its postcard as on the end card, then
   Strava file and Postcard */
#lr { right: calc(max(16px, env(safe-area-inset-right, 0px)) + 584px); width: 320px; gap: 14px; }
#lr .pc-thumb { flex: none; width: 100%; }
#lr .btns .btn { flex: 1 1 0; padding-block: 10px; }
@media (max-width: 940px) {
  #lr { right: max(16px, env(safe-area-inset-right, 0px)); width: min(352px, calc(100% - 32px)); box-shadow: 0 14px 44px rgba(0, 0, 0, .18); }
}
/* your country's tab (switched off for now) is named by its flag and name, shortened when it's long */
#lb-land { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-list li.gap { padding: 2px 0 0; border-top: 0; color: var(--muted); }
/* you (players.js): the personal code, hidden until shown, and a code from another device */
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btns:has(.sm) { gap: 6px; }
.code { font-family: var(--f-num); font-size: 15px; letter-spacing: .02em; font-variant-numeric: tabular-nums; white-space: nowrap; user-select: text; -webkit-user-select: text; }
.code.dim { color: var(--muted); user-select: none; -webkit-user-select: none; }
.link { align-self: flex-start; border: 0; padding: 0; background: none; font: 12.5px var(--f-ui); color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--ink); }
.field.code-in { font-family: var(--f-num); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
/* feedback (feedback.js): the words in a field of a few lines, the email under them, then Send with the small rocket at the other end
   of the line, standing on it as on the pad. Sent, the rocket lifts off out of the window (the sheet clips it) and comes back faded in */
#fb-f { display: flex; flex-direction: column; gap: 10px; }
textarea.field { display: block; resize: none; line-height: 1.45; }
#fb .field::placeholder { color: var(--muted); opacity: 1; }
.fb-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.fb-row .btn { min-width: 96px; }
.fb-rocket { flex: none; width: 17px; height: 32px; margin-right: 8px; overflow: visible; }
.fb-rocket .flame { opacity: 0; }
.fb-rocket.go { animation: fb-go 2.2s both; }
.fb-rocket.go .flame { animation: fb-flame 2.2s both; }
@keyframes fb-go {
  0% { transform: none; opacity: 1; animation-timing-function: cubic-bezier(.6, 0, .9, .5); }
  45% { transform: translateY(-360px); opacity: 1; }
  46%, 70% { transform: none; opacity: 0; animation-timing-function: ease; }
  100% { opacity: 1; }
}
@keyframes fb-flame { 0%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }
.found { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.found b { font-weight: 600; }
.found span { font-family: var(--f-num); font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
#join .btns .btn { flex: 1 1 0; }
/* the pilot (pilot.js): the start box on the pad and the pilot's window from settings, the same fields with the same small labels.
   The FTP's side of the toggle is lit while it has watts or is being typed in, "I don't know" otherwise */
.sh-row label.sh-lbl { font-size: 12px; }
/* the country: a field to type in with a small chevron ("—" faint until one is picked), and the countries in a list under it in the
   sheets' look */
.pick { position: relative; }
.pick .field {
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.pick .field::placeholder, #sb-name::placeholder, #pl-name::placeholder { color: var(--muted); opacity: 1; }
/* a small square flag (flags/, flag-icons) before a country's name, slightly rounded with a hairline edge: in the field, in the list
   and on the leaderboard's tab */
.flag-i {
  display: inline-block; width: 16px; height: 16px; border-radius: 3px; vertical-align: -3px; margin-right: 8px;
  outline: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); outline-offset: -1px;
}
.pick .flag { position: absolute; left: 11px; top: 11px; line-height: 0; pointer-events: none; }
.pick .flag .flag-i { margin: 0; }
.pick.fl .field { padding-left: 35px; }
#lb-land .flag-i { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.pick-l {
  position: absolute; z-index: 3; left: 0; right: 0; top: calc(100% + 4px); max-height: 216px; overflow: auto; margin: 0; padding: 4px;
  list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 44px rgba(0, 0, 0, .12);
}
.pick-l li { padding: 6px 9px; border-radius: 7px; font-size: 13.5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-l li:hover, .pick-l li.on { background: var(--soft); }
.pick-l li[aria-selected="true"] { font-weight: 500; }
.ftp-w {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: 7px; cursor: text;
  font: 500 13px/1.45 var(--f-num); font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.ftp-w input {
  width: 3.4ch; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: right;
  user-select: text; -webkit-user-select: text;
}
.ftp-w input::placeholder { color: var(--muted); }
.ftp-w input:focus { outline: none; }
.ftp:has([aria-pressed="false"]) .ftp-w { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
#start .btns { margin-top: 4px; }
/* trainings (trainings.js): the list has each training with how long it takes, and under them a line on what it is */
.tr-list { list-style: none; margin: 0; padding: 0; }
.tr-list button {
  display: flex; flex-wrap: wrap; width: 100%; justify-content: space-between; align-items: baseline; gap: 2px 10px; padding: 10px 0;
  border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); font: 14px var(--f-ui); text-align: left; cursor: pointer;
}
.tr-list small { flex-basis: 100%; font-size: 12.5px; font-weight: 400; line-height: 1.35; color: var(--ink-2); text-wrap: pretty; }
.tr-list .soon small { color: inherit; }
/* its small graph, with what each part asks under it (trGraph); still to come, it's greyed */
.tr-g { flex-basis: 100%; min-width: 0; margin-top: 8px; color: var(--ink); }
.tr-g svg { display: block; width: 100%; height: auto; overflow: visible; }
.tr-g .f { fill: none; stroke: currentColor; stroke-opacity: .45; stroke-dasharray: 3 3; }
.tr-g text { fill: currentColor; font-family: var(--f-num); font-weight: 500; font-variant-numeric: tabular-nums; text-anchor: middle; }
.tr-g text.t { fill: var(--muted); font-weight: 400; }
.soon .tr-g { opacity: .5; }
#tr-ftp { margin-left: 6px; font-size: 12.5px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.tr-list li:first-child button { border-top: 0; padding-top: 2px; }
.tr-list button:hover, .tr-list button[aria-current] { font-weight: 500; }
.tr-list .b { font-family: var(--f-num); font-size: 12.5px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
/* a note while flying (ui.js) in the milestones' big letters: its title big with its text small under it, or a sentence alone (a
   fact, a training's line) all big, left of the rocket and low enough to stay under its flame; a long title or sentence wraps, its
   lines evened out, and the small text leaves no word alone on its last line (a phone's narrow screen). The hint on the pad stays
   small. The unlock's note (below) is its own big look */
.note.big { --bt: clamp(28px, min(4.4vw, 7vh), 76px); --bl: clamp(24px, min(3.3vw, 5.2vh), 58px); max-width: calc(50% - 72px); }
.big .nt { display: block; font-size: var(--bt); font-weight: 600; line-height: .95; letter-spacing: -.035em; text-wrap: balance; }
.big .nf { display: block; max-width: 36ch; margin-top: .45em; text-wrap: pretty; }
.big.line .nf {
  max-width: none; margin: 0; color: var(--ink); font-size: var(--bl); font-weight: 600; line-height: 1.02; letter-spacing: -.03em;
  text-wrap: balance; transition: color .8s ease;
}
@media (max-width: 620px) { .note.big { --bt: clamp(26px, 8vw, 40px); --bl: clamp(22px, 6.4vw, 30px); flex-basis: 100%; max-width: none; } }
/* unlocks (unlocks.js): the unlock's note as the milestones' big titles were, its button's icon over its title on one line (shrunk
   to fit and to stay clear of the rocket) before the icon flies into the button, and the next training to come shows faint in the
   list */
.ul-i { display: none; }
.note.unlock { --uf: clamp(48px, min(9vw, 14vh), 120px); max-width: calc(50% - 72px); }
.unlock .ul-i { display: block; width: .8em; height: .8em; margin-bottom: .1em; font-size: var(--uf); color: var(--ink); transform-origin: 0 0; transition: color .8s ease; }
.ul-i svg { display: block; width: 100%; height: 100%; }
.unlock .nt { display: block; font-size: var(--uf); font-weight: 600; line-height: .95; letter-spacing: -.035em; white-space: nowrap; }
.unlock .nf { display: block; max-width: 36ch; margin-top: .45em; }
@media (max-width: 620px) { .note.unlock { flex-basis: 100%; max-width: none; } }
/* in the mini window the unlock's icon and title come in at the top while the note shows (under a training's strip, mini.js; a dark
   halo in the dark sky) */
.mini-ul {
  position: absolute; top: var(--ul-top, 12px); left: 14px; right: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  font: 600 calc(var(--mf) * .72)/1.1 var(--f-ui); letter-spacing: -.01em; color: var(--ink); pointer-events: none;
  opacity: 0; transform: translateY(-3px); transition: opacity .6s ease, transform .6s ease, color .8s ease;
}
.mini-ul.on { opacity: 1; transform: none; }
.mini-ul svg { display: block; width: 1.6em; height: 1.6em; }
.mini.dark .mini-ul { filter: drop-shadow(0 0 1px var(--bg)) drop-shadow(0 0 1px var(--bg)) drop-shadow(0 0 3px var(--bg)); }
@media (prefers-reduced-motion: reduce) { .mini-ul { transform: none; } }
/* a button whose part hasn't opened yet: its icon dimmed and a small lock at its corner, there from the start without any motion; it
   drops off when the part opens (the only time it moves); the tip over it says when */
.gear { position: relative; }
.gear .lock {
  position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; padding: 2px; box-sizing: border-box; border-radius: 50%;
  background: var(--bg); fill: none; stroke: var(--ink-2); stroke-width: 1.3; stroke-linejoin: round; transition: background-color .8s ease;
}
.gear:not(.locked) .lock {
  transform: translateY(16px) rotate(30deg); opacity: 0;
  transition: transform .7s cubic-bezier(.55, 0, .8, .2), opacity .7s ease, background-color .8s ease;
}
.gear.locked > svg:first-child { opacity: .4; }
.gear.locked { cursor: default; }
@media (prefers-reduced-motion: reduce) { .gear:not(.locked) .lock { transform: none; } }
.lock-tip {
  position: absolute; z-index: 4; max-width: calc(100% - 32px); padding: 7px 11px; border-radius: 9px; pointer-events: none;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(0, 0, 0, .12);
  font-size: 12.5px; white-space: nowrap; animation: fade .2s ease both;
}
.tr-list .soon { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); }
.tr-list li:first-child .soon { border-top: 0; padding-top: 2px; }
/* the garage (garage.js): the vehicle big on top, then a shelf each for the vehicle, the paint and the sticker, seven to a row; the one
   picked has a dark ring */
.gar-pv { display: block; width: 100%; height: 180px; border-radius: 10px; background: var(--soft); transition: background-color .8s ease; }
.gar-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.gar-row button {
  aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer;
  display: grid; place-items: center; transition: border-color .8s ease, background-color .8s ease;
}
.gar-row button:hover { border-color: var(--line-2); }
.gar-row button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.gar-row canvas { display: block; width: 100%; height: 100%; }
.gar-row .pt { border-radius: 50%; padding: 5px; }
.gar-row .pt i { display: block; width: 100%; height: 100%; border-radius: 50%; outline: 1px solid rgba(20, 20, 20, .25); outline-offset: -1px; }
/* mini mode (mini.js): the mini window's sky and rocket over height, watts and heart rate, all one size, and the ride time and distance
   smaller and grey */
.mini { --mf: clamp(18px, 11vw, 44px); }
/* in a training they make room for its strip at the top in a wide, low window */
.mini.wk { --mf: clamp(18px, min(11vw, 11vh), 44px); }
.mini-n {
  position: absolute; left: 14px; bottom: 12px; display: flex; flex-direction: column; gap: .3em;
  font: 500 var(--mf)/1 var(--f-num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--ink); transition: color .8s ease; pointer-events: none;
}
.mini-n small { margin-left: .25em; font-size: .6em; font-weight: 400; letter-spacing: 0; }
.mini-hr svg { width: .72em; height: .72em; margin-right: .22em; }
.mini-t { font-size: .65em; letter-spacing: 0; color: var(--ink-2); transition: color .8s ease; }
/* in a training: the watts of now and the time left in the part, top right over the workout's strip (mini.js draws it under them),
   as on the game's graph */
.mini-wk {
  position: absolute; top: 9px; right: 10px; display: flex; align-items: baseline;
  font: 500 calc(var(--mf) * .8)/1 var(--f-num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--ink); transition: color .8s ease; pointer-events: none;
}
.mini-wk small { margin-left: .25em; font-size: .6em; font-weight: 400; letter-spacing: 0; }
.mini-left { margin-left: .5em; color: var(--ink-2); transition: color .8s ease; }
/* the pretend mini window in the test flight (mini.js): the real one's view at its first size (its --mf as 11vw there), scaled down
   in a thin ink frame; a click opens the real one. Its button lights up a moment as it goes back in */
.mini-demo { position: absolute; overflow: hidden; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--bg); cursor: pointer; transition: border-color .8s ease; }
.mini-demo > .mini { position: absolute; left: 0; top: 0; transform-origin: 0 0; --mf: 22px; }
.gear.ping { animation: ping .9s ease; }
@keyframes ping { 25% { color: var(--ink); border-color: var(--ink); } }

/* a touch screen (an iPad or a phone, and the app): the small controls reach further than they show, so a finger finds them: the round
   buttons, the ✕ and the links; and the rows of a list (countries, the devices found) are taller */
@media (pointer: coarse) {
  .gear::after { content: ''; position: absolute; inset: -6px; }
  .x { padding: 10px; margin: -8px; }
  .link, .first-n[href] { padding: 10px; margin: -10px; }
  .pick-l li { padding-block: 10px; }
  .seg.units button { padding-block: 8px; }
}
/* a short screen (a phone on its side): a card starts near the top and may cover the buttons while it shows, the postcard on the end
   card is smaller, and a card still too tall for the screen scrolls */
@media (max-height: 500px) {
  .card { top: max(16px, var(--safe-top)); max-height: calc(100% - 16px - var(--safe-top) - var(--safe-bottom)); overflow: auto; box-sizing: border-box; }
  .pc-thumb { flex-basis: min(300px, calc(100vh - 150px)); }
}
/* a big screen (a computer, an iPad either way up), seen from the bike: the meters, the round buttons with their locks and the card
   (falling, paused, the end with its postcard) 15% larger, as the sky's lines and the next stop are (draw.js); the sheets open above
   the larger buttons */
@media (min-width: 1024px), (pointer: coarse) and (min-width: 700px) and (min-height: 501px) {
  .meter { gap: 18px; }
  .vals { font-size: 30px; gap: 10px; }
  .gear { width: 39px; height: 39px; }
  .gear svg { width: 19.5px; height: 19.5px; }
  .gear .lock { right: -3.5px; bottom: -3.5px; width: 17px; height: 17px; padding: 2.3px; }
  .lock-tip { padding: 8px 13px; border-radius: 10px; font-size: 14.5px; }
  .sheet { bottom: calc(53px + var(--safe-bottom)); }
  #card { max-width: 390px; padding: 18px; border-radius: 16px; gap: 18px 23px; }
  #card.pc { max-width: 760px; }
  #card .pc-thumb { flex-basis: min(345px, calc(100vh - 150px)); }
  #card .card-in { gap: 14px; }
  #card .sh-title { font-size: 17px; }
  #card .sh-hint { margin-top: -7px; font-size: 14.5px; }
  #card .sh-about { font-size: 14.5px; }
  #card .x svg { width: 18px; height: 18px; }
  #card .btns { gap: 9px; }
  #card .btn { padding: 12.5px 16px; border-radius: 10px; font-size: 15.5px; }
  #card .stats { gap: 14px 18px; }
  #card .stats dt { font-size: 14px; }
  #card .stats dd { font-size: 18.5px; }
}
/* a tablet (a touch screen neither narrow nor short: an iPad either way up, not a phone on its side), seen from the bike: a smaller
   screen with smaller px than a computer's, so the meters are larger still, as the sky's lines and the next stop are (draw.js), and a
   note looks as it does on a computer: its letters about as large, across all the width the meters leave. It stays under the flame
   as the rocket flies over it: three lines at most on its side, five upright, each in big letters. On the pad its letters are as
   large as fit under the ground's line. The meters' box keeps its width, so a long height doesn't narrow the note or push it to a line
   of its own */
@media (pointer: coarse) and (min-width: 700px) and (min-height: 501px) {
  .meter { flex: none; width: 330px; }
  .vals { font-size: 38px; gap: 13px; }
  .note { font-size: 28px; }
  .note.big {
    --bt: clamp(28px, min(8.2vw, 9vh), 76px); --bl: clamp(24px, min(6.2vw, 6.5vh), 58px);
    flex: 1 1 0; max-width: none;
  }
  .big .nf { max-width: 52ch; }
  .note.big.pad { --bt: clamp(28px, min(6.6vw, 5.6vh), 76px); --bl: clamp(24px, min(6.2vw, 4.4vh), 58px); }
}
/* narrow screens: smaller meters and notes */
@media (max-width: 620px) {
  .vals { font-size: 22px; gap: 8px; }
}
@media (max-width: 460px) {
  .note { font-size: 21px; }
}
/* reduced motion: notes only fade */
@media (prefers-reduced-motion: reduce) {
  .note { transform: none; }
  .fb-rocket.go, .fb-rocket.go .flame { animation: none; }
}
@keyframes fade { from { opacity: 0; } }
/* the first look (first.js), straight on the sky: for a new visitor on the pad, in the middle of the sky, the game in one big line,
   who it's for small under it, Connect devices and the test drive, which ends in the same look with its own words. Its middle is at
   40%, halfway down to the ground (80%, draw.js), so a longer line grows it both ways, clear of the rocket. A rider with rides sees only
   Connect devices, top middle where the cards come. The test drive's time shows small at the
   top edge */
.first {
  position: absolute; left: 16px; right: 16px; top: max(84px, 15%); margin-inline: auto; max-width: 560px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; pointer-events: none;
  animation: arrive .5s ease both;
}
.first.fresh { top: 40%; translate: 0 -50%; }
.first p { margin: 0; text-wrap: balance; transition: color .8s ease; }
.first-t { font-size: clamp(28px, 4.2vw, 44px); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; color: var(--ink); }
.first-s { max-width: 46ch; font-size: 14px; color: var(--ink-2); }
.first .btns { justify-content: center; margin-top: 12px; pointer-events: auto; }
.first .btn { padding: 11px 16px; }
/* the game's name, one quiet line top left while the first look shows, coming and going with it (first.js): small, so the big line
   stays the one that speaks. A link to About */
.first-n {
  position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); top: max(16px, env(safe-area-inset-top, 0px));
  font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: -.01em; color: var(--ink); text-decoration: none;
  transition: color .8s ease; animation: arrive .5s ease both;
}
.first-n[href]:hover { color: var(--ink-2); transition-duration: .2s; }
.drive {
  position: absolute; left: 16px; right: 16px; top: max(16px, env(safe-area-inset-top, 0px)); margin: 0; text-align: center;
  font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; pointer-events: none;
  transition: color .8s ease; animation: fade .5s ease both;
}
/* About in the app: a frame over the game (app.js), white out to the screen's edges, its page inside what's safe from the notch */
.about-frame {
  position: fixed; inset: 0; z-index: 10; box-sizing: border-box; width: 100%; height: 100%; border: 0; background: #ffffff;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
/* in the app the test flight's series line has the rider's show playing small over the game, as iOS floats it (first.js): a toy of
   it, a dark frame with a thin bar of how far it's played, in the pretend mini window's thin ink border, floats in at the top right
   corner, clear of the note, the meters and the buttons at the bottom, while the line shows, and back out. It takes no taps */
.app-show {
  position: absolute; top: max(16px, var(--safe-top)); right: max(16px, env(safe-area-inset-right, 0px));
  width: clamp(150px, 24vw, 260px); aspect-ratio: 16 / 9; border: 1.5px solid var(--ink); border-radius: 8px; background: #15171c;
  pointer-events: none; animation: show-in .6s cubic-bezier(.3, 1.25, .5, 1) both; transition: border-color .8s ease;
}
.app-show.going { animation: show-out .4s cubic-bezier(.55, 0, .75, .25) both; }
.app-show i { position: absolute; left: 10px; right: 10px; bottom: 9px; height: 2px; border-radius: 1px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.app-show i::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, .85); transform-origin: 0 0; animation: played 40s linear both; }
/* on a phone, under the test flight's time, which then reaches the corner */
@media (max-width: 620px) { .app-show { top: calc(max(16px, var(--safe-top)) + 28px); } }
@keyframes show-in { from { transform: translateX(calc(100% + 40px)); } }
@keyframes show-out { to { transform: translateX(calc(100% + 40px)); } }
@keyframes played { from { transform: scaleX(.32); } to { transform: scaleX(.6); } }
@keyframes gone { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .app-show { animation-name: fade; }
  .app-show.going { animation-name: gone; }
  .app-show i::after { animation: none; transform: scaleX(.4); }
}
