* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: system-ui, sans-serif;
}

/* ---- display stage ---- */
#stage {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4vmin;
  background: #000f;
  color: #bbb;
}
#stageText {
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: normal;
  text-align: center;
  line-height: 1.1;
  cursor: text;
  outline: none;
  border-radius: 0.2em;
}
#stageText:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}
.timer {
  font-variant-numeric: tabular-nums;
  font-weight: bold;
  color: white;
}
.almost-up #stage {
  background: white;
  color: #443c3cff;
  & .timer {
    color: black;
  }
}
.time-up #stage {
  background: hsl(0 100% 20% / 100%);
}

/* ---- floating timer controls ---- */
#floatingControls {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: calc(100vw - 20px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: right;
  gap: 0.2rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
#progressFill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.15);
  transition: width 0.2s linear;
  z-index: 0;
}
#floatingControls button,
#endClock {
  position: relative;
  z-index: 1;
}
#floatingControls button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
#floatingControls button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}
#floatingControls button:disabled {
  opacity: 0.35;
  cursor: default;
  display: none;
}
#endClock {
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 0.5rem 0 0.1rem;
  white-space: nowrap;
}
#almostUpDebug {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  padding: 0 0.3rem;
  white-space: nowrap;
}
#help {
  position: fixed;
  font-size: 200%;
  padding: 1ex;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  color: white;
  background: hsl(0 0% 10% / 70%);
  backdrop-filter: blur(1em);
  box-shadow: 1em 1em 5em black;
  border-radius: 0.5em;
}

#help dl {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1ex;
}

#help dt,
#help dd {
  margin: 0;
  padding: 0.5ex 0;
}
dt {
  font-weight: bold;
  text-align: center;
}
