/* the play strip stands above the planner's and the editor's, and the pad above it; it ends
   short of the corner's widgets, by their own margin, and where its line and its controls do not
   fit one row the controls go below the line as one, wrapping among themselves in their turn */
#play {
  bottom: calc(var(--corner-foot) + var(--under-h, 0px) + var(--course-h, 0px));
  max-width: calc(100% - 24px - var(--corner-w) - 12px);
}
#play .line {
  flex: 1 1 auto;
  min-width: 0;
}
#play .controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* the HUD stands at the top of the map in the level line's place while the ball is on the level,
   and lies over the view as the pad does, so the framing stands clear of the strip alone */
.hud {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  padding: 3px 14px 4px;
  background: var(--surface-float);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12.5px;
  min-width: 264px;
}
.hud .title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 14px;
  letter-spacing: 0.02em;
}
/* the row's two sides share its width equally, so the clock keeps the middle as the figures
   beside it grow */
.hud .row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  align-self: stretch;
  column-gap: 18px;
}
.hud #playPoints {
  justify-self: start;
}
.hud #playKeys {
  justify-self: end;
}
.hud .figure {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hud .figure > :empty {
  display: none;
}
.hud .figure b {
  font-weight: 600;
  font-size: 15px;
}
.hud #playClock b {
  font-size: 26px;
  line-height: 30px;
}
.hud .figure small {
  color: var(--dim);
  font-size: 11px;
}
.hud .figure .icon {
  align-self: center;
}
.hud .sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 16px;
}
.hud .sub:not(:has(:not([hidden]))) {
  display: none;
}
body.playing .chip {
  display: none;
}

/* the pad's arrows at the bottom left, the roll a bar over the two turns, and the jump on a round
   button at the bottom right, level with the pad, so one thumb holds the roll while the other taps
   the jump; both lie over the view */
.pad,
.jump {
  position: absolute;
  bottom: calc(
    var(--corner-foot) + var(--under-h, 0px) + var(--course-h, 0px) + var(--play-h, 0px)
  );
  z-index: 15;
  background: var(--surface-float);
  border: 1px solid var(--line);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.pad {
  left: 12px;
  display: grid;
  grid-template-columns: repeat(2, 58px);
  grid-auto-rows: 58px;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
}
.jump {
  right: 12px;
  width: var(--jump-h);
  height: var(--jump-h);
  padding: 7px;
  border-radius: 50%;
}
.pad button,
.jump button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.pad button {
  border-radius: 10px;
  font-size: 20px;
}
.jump button {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.pad button:focus-visible,
.jump button:focus-visible {
  border-color: var(--accent-dim);
}
@media (hover: hover) {
  .pad button:hover,
  .jump button:hover {
    border-color: var(--accent-dim);
  }
}
.pad button:active,
.jump button:active {
  background: var(--accent);
  color: #06222f;
  border-color: var(--accent);
}
.pad [data-pad="up"] {
  grid-area: 1 / 1 / 2 / 3;
}
.pad [data-pad="left"] {
  grid-area: 2 / 1;
}
.pad [data-pad="right"] {
  grid-area: 2 / 2;
}
/* while the pad shows the corner's widgets stand left of the jump, the strip still ends short of
   them and the panel ends above the jump */
body.padded #corner {
  right: calc(12px + var(--jump-h) + 8px);
}
body.padded #play {
  max-width: calc(100% - 24px - var(--corner-w) - 12px - var(--jump-h) - 8px);
}
body.padded .detail {
  max-height: calc(
    100% - 20px - var(--corner-foot) - var(--under-h, 0px) - var(--course-h, 0px) -
      var(--play-h, 0px) - var(--jump-h)
  );
}
