*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0b0b0f;
  color: #f0f0f0;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 6vh;
}

.counter {
  font-size: clamp(7rem, 20vw, 16rem);
  line-height: 1;
  color: #adacac;
  margin-bottom: 48px;
  transition: color 0.15s ease;
  user-select: none;
  letter-spacing: 10px;
}

.boxes {
  display: flex;
  gap: 20px;
}

.box {
  width: 500px;
  height: 400px;
  border-radius: 10px;
  background: #13131a;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -- Heart rate box -------------------------------------------------------- */

.hr-box {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 20px;
}

.hr-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.hr-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #2e2e45;
}

.hr-now {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

#hr-bpm {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.8rem;
  line-height: 1;
  color: #f0f0f0;
}

.hr-unit {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #555570;
}

.hr-graph-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
}

.hr-graph-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

.hr-windows {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.hr-win {
  flex: 1;
  padding: 7px 0;
  background: transparent;
  border: 1px solid #1e1e2e;
  border-radius: 6px;
  color: #2e2e45;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.hr-win.active,
.hr-win:hover {
  border-color: #ff00ea;
  color: #ff00ea;
}

/* -- Toy control box ------------------------------------------------------- */

.toy-box {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 20px;
}

.toy-label {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: #ffffff;
  margin-bottom: 14px;
  text-align: center;
}

.toy-body {
  display: flex;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.toy-slider-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 48px;
  flex-shrink: 0;
}

.slider-track {
  flex: 1;
  width: 10px;
  background: #1a1a28;
  border-radius: 5px;
  position: relative;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}

.slider-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: #ff00ea;
  border-radius: 5px;
}

.slider-handle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ff00ea;
  cursor: grab;
  touch-action: none;
}

.slider-handle:active { cursor: grabbing; }

.slider-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: #333350;
}

.graph-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}

.graph-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 6px;
}
