/* The three game settings, built as small precision instruments:
 *   rounds  - a mechanical counter (navy window, rolling numeral, keys that press down)
 *   radius  - a ruler slider with the circle it draws beside it, and a two-position selector
 *   timer   - the same selector, plus a tempo ruler with a needle
 *
 * Linework only: 1px ink, the paper tones, and terracotta for what is ENGAGED
 * (the knob and arc, the selected position, the chosen tick). Every size scales
 * with --ui like the rest of the landing plate. Motion is short and springy,
 * and switched off by the global prefers-reduced-motion rule.
 */

:root {
  --spring: cubic-bezier(0.34, 1.5, 0.5, 1);
}

/* ---------------------------------------------------------------- rounds: counter */

.counter {
  display: inline-flex;
  align-items: center;
  gap: calc(6px * var(--ui));
}

.counterKey {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(38px * var(--ui));
  height: calc(46px * var(--ui));
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-bottom-width: 4px;               /* the key's depth ... */
  border-radius: var(--radius);
  background: linear-gradient(180deg, #FBFAF6 0%, var(--sheet) 55%, #E9E6DC 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 2px 3px rgba(23, 33, 58, 0.16);
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* the release: quick, and it lands without a bounce */
  transition: transform 90ms var(--ease-std), border-bottom-width 90ms var(--ease-std),
    box-shadow 90ms var(--ease-std), background var(--dur-fast) var(--ease-std);
}

.counterKey:hover { background: linear-gradient(180deg, #FFFFFC 0%, #F7F5EF 55%, #ECE9DF 100%); }

/* ... which it gives up when pressed: the cap travels down 3px at once, its
   highlight dims and its shadow closes up under it */
.counterKey:active,
.counterKey.pressed {
  transform: translateY(3px);
  border-bottom-width: 1px;
  background: linear-gradient(180deg, #ECE9DF 0%, var(--sunk) 100%);
  box-shadow: inset 0 1px 2px rgba(23, 33, 58, 0.14), 0 0 1px rgba(23, 33, 58, 0.2);
  transition-duration: 30ms;
}

.counterKey[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }

.counterKey:focus-visible,
.counterWin:focus-visible {
  outline: 2px solid var(--terra-deep);
  outline-offset: 3px;
}

/* the window: a navy aperture with the numeral rolling inside it */
.counterWin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: calc(66px * var(--ui));
  height: calc(46px * var(--ui));
  background: var(--slate);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 2px 0 rgba(23, 33, 58, 0.55);
  cursor: ns-resize;
  touch-action: manipulation;
}

/* index marks at the edges of the aperture */
.counterWin::before,
.counterWin::after {
  content: "";
  position: absolute;
  top: calc(50% - 1px);
  width: calc(5px * var(--ui));
  height: 2px;
  background: var(--terra);
}
.counterWin::before { left: 0; }
.counterWin::after { right: 0; }

.counterNum {
  font-family: var(--font-display);
  font-size: calc(32px * var(--ui));
  font-weight: 700;
  line-height: 1;
  color: var(--sheet);
  font-variant-numeric: lining-nums tabular-nums;
  will-change: transform;
}

/* quick picks: a scale; the chosen mark is taller and terracotta */
.pillRow { display: flex; gap: 0; margin-top: calc(2px * var(--ui)); }

.pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;        /* the mark grows toward the label; the labels stay on one line */
  height: calc(34px * var(--ui));
  min-width: calc(36px * var(--ui));
  padding: 0 calc(6px * var(--ui));
  font-size: calc(13px * var(--ui));
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-fast) var(--ease-std), transform 90ms var(--ease-std);
  touch-action: manipulation;
}

.pill::before {
  content: "";
  width: 1px;
  height: calc(6px * var(--ui));
  background: var(--ink-4);
  transition: height 0.22s var(--spring), width 0.14s var(--ease-std), background var(--dur-fast) var(--ease-std);
}

.pill:hover { color: var(--ink); }
.pill:hover::before { height: calc(9px * var(--ui)); background: var(--ink); }
.pill:active { transform: translateY(1px); }
.pill.pill-active { color: var(--ink); }
.pill.pill-active::before { width: 2px; height: calc(12px * var(--ui)); background: var(--terra-deep); }
.pill:focus-visible { outline: 2px solid var(--terra-deep); outline-offset: 2px; }

/* ---------------------------------------------------------------- two-position selector (radius + timer) */

/* --seg-w: one width for both selectors (radius and timer), so they read as the same instrument */
.segmented {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: var(--seg-w);
  --seg-w: calc(150px * var(--ui));
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  overflow: hidden;
  /* a channel milled into the plate: shaded under its upper edge */
  background: rgba(23, 33, 58, 0.035);
  box-shadow: inset 0 1px 2px rgba(23, 33, 58, 0.13);
}

/* the index plate: it slides to the chosen position and settles with a little overshoot */
.segmentThumb {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  box-sizing: border-box;
  width: 100%;
  height: calc(100% / var(--n, 2));   /* --n: how many positions (radius has three) */
  background: var(--sunk);
  border-left: 3px solid var(--terra-deep);
  transition: transform 0.34s var(--spring);
}

.segmented[data-active="1"] .segmentThumb { transform: translateY(100%); }
.segmented[data-active="2"] .segmentThumb { transform: translateY(200%); }

.segmentBtn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: calc(34px * var(--ui));
  padding: 0 calc(12px * var(--ui)) 0 calc(14px * var(--ui));
  font-size: calc(13.5px * var(--ui));
  font-weight: 600;
  text-align: left;
  color: var(--ink-3);
  white-space: nowrap;
  touch-action: manipulation;
  transition: color var(--dur) var(--ease-std), transform 90ms var(--ease-std);
}

.segmentBtn + .segmentBtn { border-top: 1px solid var(--rule); }
.segmentBtn:hover { color: var(--ink); }
.segmentBtn.active { color: var(--ink); font-weight: 700; }
.segmentBtn:active { transform: translateX(1px); }
.segmentBtn:focus-visible { outline: 2px solid var(--terra-deep); outline-offset: -2px; }

/* A row of positions (radius: random / exact, timer: off / on). The plate
   slides sideways under the chosen one and marks it from below, the way the
   region and scale tabs are marked. */
.segmented.isRow { flex-direction: row; }
.segmented.isRow .segmentBtn {
  flex: 1 1 0;
  justify-content: center;
  height: calc(32px * var(--ui));
  padding: 0 calc(10px * var(--ui));
}
.segmented.isRow .segmentBtn + .segmentBtn { border-top: 0; border-left: 1px solid var(--rule); }
.segmented.isRow .segmentBtn:active { transform: translateY(1px); }
/* the plate's place and width come from the chosen button (placeSegmentThumb in
   app.js); a plain glide there, without overshoot, since its width changes too */
/* The slide is a raised plate riding in the channel: lit along its top edge,
   a contact shadow under it, and the terracotta index on its lower face. It
   glides and stops dead on its position, without overshoot. */
.segmented.isRow .segmentThumb {
  width: calc(100% / var(--n, 2));
  height: 100%;
  border-left: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, #FAF9F4 0%, var(--sheet) 60%, #ECE9DF 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 0 var(--terra-deep),
    0 0 0 1px rgba(23, 33, 58, 0.22),
    0 1px 2px rgba(23, 33, 58, 0.18);
  transition: transform 0.24s cubic-bezier(0.3, 0, 0.15, 1), width 0.24s cubic-bezier(0.3, 0, 0.15, 1);
}

/* "Exact" chosen: a one-line note that this is practice */
.exactNote {
  margin: 0;
  font-size: calc(12px * var(--ui));
  line-height: 1.35;
  color: var(--terra-ink);
}
.exactNote:not(.hidden) { animation: rowIn var(--dur) var(--ease); }

/* the radius's scale, in the place of the other fields' hint: light tabs */
.scaleTabs { display: flex; flex-wrap: wrap; gap: 0 calc(14px * var(--ui)); }
.scaleTab {
  padding: 0 0 calc(2px * var(--ui));
  font-size: calc(12.5px * var(--ui));
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-3);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-std), border-color var(--dur-fast) var(--ease-std);
}
.scaleTab:hover { color: var(--ink); }
/* a country too small for the large scale: the tab stays, greyed, and says why on hover */
.scaleTab:disabled { color: var(--ink-4); opacity: 0.6; cursor: not-allowed; }
.scaleTab:disabled:hover { color: var(--ink-4); }
.scaleTab.active { color: var(--ink); border-color: var(--terra-deep); }
.scaleTab:focus-visible { outline: 2px solid var(--terra-deep); outline-offset: 2px; }
.segRange { font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- radius: a slider, and the circle it draws */

.radiusInstrument {
  display: flex;
  align-items: flex-start;   /* the selector and ruler line up with the timer's, the dial hangs beside */
  gap: calc(12px * var(--ui));
}

/* the selector and the ruler stack beside the picture */
.radiusControls {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: calc(6px * var(--ui));
  min-width: 0;
}

/* 150px like the timer's selector, giving a little only when the strip is tight */
.radiusControls { flex: 0 0 auto; width: calc(168px * var(--ui)); }
.radiusControls .segmented { width: 100%; }
/* the timer column keeps one width whether or not its seconds ruler is showing */
.fieldTimer .fieldBody { min-width: calc(184px * var(--ui)); }
.fieldTimer .segmented,
.fieldTimer .tempo { width: 100%; }

/* no timer: the seconds ruler stays in place, quiet, ready to be touched */
.tempo.isIdle .tempoRuler,
.tempo.isIdle .tempoVal { opacity: 0.42; transition: opacity var(--dur-fast) var(--ease-std); }
.tempo.isIdle:hover .tempoRuler,
.tempo.isIdle:hover .tempoVal { opacity: 0.7; }
/* its ruler sits on the same line as the radius ruler: 6px under the selector, like there */
.fieldTimer .tempo { margin-top: calc(-2px * var(--ui)); }
.radiusControls .tempoRuler { flex: 0 0 auto; min-width: 0; }   /* the ruler keeps its own height in this column */

/* in "random" nothing is chosen: the ruler shows the whole range, the needle rests */
.radiusRuler.random .tempoFill { width: 100%; opacity: 0.28; }
.radiusRuler.random input[type="range"]::-webkit-slider-thumb { opacity: 0.45; }
.radiusRuler.random input[type="range"]::-moz-range-thumb { opacity: 0.45; }

/* the picture: not a control, so nothing about it invites a click */
.dial {
  flex: 0 0 auto;
  width: calc(76px * var(--ui));
  height: calc(86px * var(--ui));
  pointer-events: none;
  user-select: none;
}

.dial svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* the 100 km limit is a faint disc; the rings are the scale */
.dialDisk { fill: var(--terra); fill-opacity: 0.09; transition: opacity var(--dur) var(--ease-std); }

.dialRing {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 1.5 3;
  opacity: 0.38;
  transition: stroke var(--dur-fast) var(--ease-std), opacity var(--dur-fast) var(--ease-std);
}
.dialRing[data-v="100"] { stroke-dasharray: none; opacity: 0.75; }
.dialRing.passed { stroke: var(--terra-deep); opacity: 0.85; }
.dialRing.hit { animation: ringHit 0.3s var(--ease); }

@keyframes ringHit {
  0% { stroke: var(--terra-deep); stroke-width: 3.4; opacity: 1; }
  100% { stroke-width: 1; }
}

/* the circle: scaled, never redrawn, so its edge glides with the slider */
.dialCircle {
  fill: var(--terra);
  fill-opacity: 0.2;
  stroke: var(--terra-deep);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  transform-origin: 48px 48px;
  transform: scale(0.25);
  transition: transform 0.18s var(--ease), opacity var(--dur) var(--ease-std);
}

.dialRadius {
  stroke: var(--terra-deep);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  transform-origin: 48px 48px;
  transition: transform 0.18s var(--ease), opacity var(--dur) var(--ease-std);
}

.dialDot { fill: var(--ink); }

/* random: the whole range is lit, no particular circle */
.dial.random .dialCircle,
.dial.random .dialRadius { opacity: 0; }
.dial:not(.random) .dialDisk { opacity: 0; }

.dialLab {
  font: 600 6.5px var(--font-ui);
  fill: var(--ink-3);
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 1.8px;
  stroke-linejoin: round;
  transition: fill var(--dur-fast) var(--ease-std);
}
.dialLab.passed { fill: var(--terra-ink); }

.dialNum {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
  font-variant-numeric: lining-nums tabular-nums;
}

/* the value lives on the slider; this stub only holds the label the game updates */
#fixedRadiusRow { display: none !important; }

/* ---------------------------------------------------------------- timer: tempo ruler */

.tempo {
  display: flex;
  align-items: center;
  gap: calc(10px * var(--ui));
  width: 100%;
  margin-top: calc(8px * var(--ui));
}

.tempo:not(.hidden) { animation: rowIn var(--dur) var(--ease); }

.tempoRuler {
  --p: 0.25;                                /* the needle's position, 0..1 (set by instruments.js) */
  position: relative;
  flex: 1;
  height: calc(34px * var(--ui));
  min-width: calc(110px * var(--ui));
}

/* the baseline and the stretch already "run" */
.tempoRuler::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(12px * var(--ui));
  height: 1.5px;
  background: var(--ink);
}

.tempoFill {
  position: absolute;
  left: 0;
  top: calc(11px * var(--ui));
  height: 3.5px;
  width: calc(var(--p) * (100% - 6px) + 3px);
  background: var(--terra-deep);
  transition: width 0.12s var(--ease-std);
}

.tempoTick {
  position: absolute;
  top: calc(12px * var(--ui));
  width: 1px;
  height: calc(7px * var(--ui));
  left: calc(var(--t) * (100% - 6px) + 3px);
  background: var(--ink-4);
  transition: background var(--dur-fast) var(--ease-std);
}
.tempoTick.major { height: calc(11px * var(--ui)); }
.tempoTick.on { background: var(--ink); }

.tempoLabel {
  position: absolute;
  top: calc(23px * var(--ui));
  left: calc(var(--t) * (100% - 6px) + 3px);
  transform: translateX(-50%);
  font-size: calc(10.5px * var(--ui));
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.tempoRuler input[type="range"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  touch-action: pan-y;
}

.tempoRuler input[type="range"]::-webkit-slider-runnable-track { height: calc(34px * var(--ui)); background: transparent; }
.tempoRuler input[type="range"]::-moz-range-track { height: calc(34px * var(--ui)); background: transparent; }

/* the needle */
.tempoRuler input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 6px;
  height: calc(22px * var(--ui));
  margin-top: calc(1px * var(--ui));
  background: linear-gradient(90deg, #DD9A74 0%, var(--terra) 45%, #C27650 100%);   /* a machined slide, lit from the left */
  border: 1.5px solid var(--ink);
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(23, 33, 58, 0.3);
  cursor: grab;
}
.tempoRuler input[type="range"]::-moz-range-thumb {
  box-sizing: border-box;
  width: 6px;
  height: calc(22px * var(--ui));
  background: var(--terra);
  border: 1.5px solid var(--ink);
  border-radius: 1px;
  cursor: grab;
}
.tempoRuler input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; background: var(--terra-deep); }
.tempoRuler input[type="range"]:focus-visible { outline: 2px solid var(--terra-deep); outline-offset: 2px; }

.tempoVal {
  min-width: calc(46px * var(--ui));
  font-family: var(--font-display);
  font-size: calc(21px * var(--ui));
  font-weight: 700;
  line-height: 1;
  text-align: right;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---------------------------------------------------------------- timer: a detented rotary knob */

/* An engraved scale on the plate, a recessed well cut into it, and a satin
   ceramic cap turning in the well. The light comes from the upper left and
   stays there: the gloss does not turn with the cap, the knurled rim and the
   terracotta index do. */
.knobRow { gap: calc(14px * var(--ui)); margin-top: calc(6px * var(--ui)); }

.knob {
  --k: calc(76px * var(--ui));
  position: relative;
  flex: 0 0 auto;
  width: var(--k);
  height: var(--k);
  border-radius: 50%;
  cursor: grab;
  touch-action: none;                  /* only the knob: the page still scrolls around it */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.knob.held { cursor: grabbing; }
.knob:focus-visible { outline: none; }

.knobScale { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.knobTrack { fill: none; stroke: rgba(23, 33, 58, 0.1); stroke-width: 1.2; stroke-linecap: round; }
.knobArc {
  fill: none;
  stroke: var(--terra-deep);
  stroke-width: 2.4;
  stroke-linecap: round;
  transition: opacity var(--dur) var(--ease-std);
}
.knobTick { stroke: var(--ink-4); stroke-width: 1; transition: stroke var(--dur-fast) var(--ease-std); }
.knobTick.major { stroke-width: 1.5; }
.knobTick.on { stroke: var(--ink); }
.knobNum {
  font: 600 7.5px var(--font-ui);
  fill: var(--ink-3);
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
}

/* the well: a hole in the plate, shaded at its upper lip, catching light at its lower one */
.knobWell {
  position: absolute;
  inset: 13.75%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #D6D2C3 0%, #CFCABA 70%, #C4BFAE 100%);
  box-shadow:
    inset 0 2px 3px rgba(23, 33, 58, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.55),
    0 0 0 1px rgba(23, 33, 58, 0.18);
  transition: box-shadow var(--dur-fast) var(--ease-std);
}
.knob:focus-visible .knobWell {
  box-shadow:
    inset 0 2px 3px rgba(23, 33, 58, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.55),
    0 0 0 1px rgba(23, 33, 58, 0.18),
    0 0 0 3px var(--paper),
    0 0 0 5px var(--terra-deep);
}

/* the cap: satin ceramic with a machined edge, standing slightly proud of the well */
.knobCap {
  --a: -135deg;
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #F7F5EE 0%, #EFECE3 52%, #DEDACD 100%);
  border: 1px solid rgba(23, 33, 58, 0.62);
  box-shadow:
    inset 0 -2px 2px rgba(23, 33, 58, 0.14),
    0 1px 1px rgba(23, 33, 58, 0.32),
    0 3px 6px rgba(23, 33, 58, 0.2);
  transform: rotate(var(--a));
  transition: box-shadow 90ms var(--ease-std);
  will-change: transform;
}
/* letting go: it settles into the detent, quickly and without bounce */
.knobCap.settling { transition: transform 170ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 90ms var(--ease-std); }
/* held between the fingers it sits a hair deeper */
.knob.held .knobCap {
  box-shadow:
    inset 0 -2px 2px rgba(23, 33, 58, 0.12),
    0 1px 1px rgba(23, 33, 58, 0.36),
    0 2px 3px rgba(23, 33, 58, 0.18);
}

/* the knurled grip round the rim: fine and low-contrast, it shows the turning */
.knobCap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(23, 33, 58, 0.13) 0deg 1.6deg, transparent 1.6deg 7.5deg);
  -webkit-mask: radial-gradient(circle, transparent 72%, #000 75%);
  mask: radial-gradient(circle, transparent 72%, #000 75%);
}

/* the index: a terracotta line inlaid from the rim toward the centre */
.knobIndex {
  position: absolute;
  left: 50%;
  top: 9%;
  width: 3px;
  height: 32%;
  border-radius: 1.5px;
  background: var(--terra-deep);
  box-shadow: inset 0 1px 0 rgba(23, 33, 58, 0.25);
  transform: translateX(-50%);
  transition: background var(--dur) var(--ease-std);
}

/* the light: fixed on the cap's face, so the cap turns under it */
.knobGloss {
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: radial-gradient(ellipse 62% 48% at 36% 26%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  opacity: 0.85;
  transition: opacity var(--dur-fast) var(--ease-std);
}
.knob:hover .knobGloss { opacity: 1; }

.knobReadout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(3px * var(--ui));
  min-width: 0;
  cursor: pointer;
}
.knobReadout .tempoVal { min-width: calc(54px * var(--ui)); text-align: left; font-size: calc(24px * var(--ui)); }
.knobHint {
  font-size: calc(11.5px * var(--ui));
  line-height: 1.3;
  color: var(--ink-3);
  max-width: calc(110px * var(--ui));
}
/* with the timer on the hint fades out but keeps its place: taking it out of the
   layout would narrow the column and shift the whole strip sideways */
.knobHint { transition: opacity var(--dur-fast) var(--ease-std), visibility 0s linear 0s; }
.knobRow:not(.isIdle) .knobHint {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease-std), visibility 0s linear var(--dur-fast);
}

/* no timer: the scale and readout go quiet, the cap stays crisp - it is still the way in */
.knobRow.isIdle .knobArc { opacity: 0.3; }
.knobRow.isIdle .knobTick.on { stroke: var(--ink-4); }
.knobRow.isIdle .knobIndex { background: var(--ink-4); }
.knobRow.isIdle .tempoVal { opacity: 0.42; }
.knobRow.isIdle:hover .tempoVal { opacity: 0.7; }

/* ---------------------------------------------------------------- phones */

/* small tablets and phones: the timer instruments fill their column instead of keeping the desktop width */
@media (max-width: 760px) {
  .fieldTimer .segmented { width: 100%; }
  /* too narrow for the timer's row of two: its positions stack again */
  .fieldTimer .segmented.isRow { flex-direction: column; }
  .fieldTimer .segmented.isRow .segmentBtn { flex: 0 0 auto; height: calc(34px * var(--ui)); justify-content: flex-start; }
  .fieldTimer .segmented.isRow .segmentBtn + .segmentBtn { border-left: 0; border-top: 1px solid var(--rule); }
  .fieldTimer .segmented.isRow .segmentThumb {
    width: 100%;
    height: 50%;
    border-left: 3px solid var(--terra-deep);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 1px rgba(23, 33, 58, 0.22), 0 1px 2px rgba(23, 33, 58, 0.18);
  }
  .fieldTimer .segmented.isRow[data-active="1"] .segmentThumb { transform: translateY(100%); }
  .fieldTimer .segmented.isRow .segmentBtn:active { transform: translateX(1px); }
  .fieldTimer .fieldBody { min-width: 0; }
  .fieldTimer .tempo { width: 100%; }
  .fieldTimer .tempoRuler { min-width: 0; }
}

@media (max-width: 640px) {
  .segmented { min-width: 0; width: 100%; }
  .radiusControls { flex: 1 1 auto; width: auto; }
  .radiusInstrument { gap: calc(8px * var(--ui)); }
  .counterKey { width: calc(40px * var(--ui)); }
}

/* narrow phones: the counter's keys, window and quick picks tighten to fit half the strip */
@media (max-width: 400px) {
  .counter { gap: 4px; }
  .counterKey { width: 34px; }
  .counterWin { width: 58px; }
  .pill { min-width: 30px; padding: 0 4px; }
}

@media (max-width: 340px) {
  .counterKey { width: 30px; }
  .counterWin { width: 52px; }
}
