:root {
  --animation-speed: 1s;
  --font: -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue",
    sans-serif;
}

* {
  margin: 0;
  padding: 0;
}

.hide {
  display: none;
}

.pause-animation {
  animation-play-state: paused !important;
  -o-animation-play-state: paused !important;
  -moz-animation-play-state: paused !important;
  -webkit-animation-play-state: paused !important;
}

body {
  top: 50%;
  left: 50%;
  text-align: center;
  position: absolute;
  font-family: var(--font);
  transform: translate(-50%, -50%);
}

.heart {
  position: relative;
  user-select: none;
  display: inline-block;
}

.heart img {
  width: 250px;
}

.bpm {
  top: 50%;
  left: 50%;
  color: #fff;
  font-size: 100px;
  position: absolute;
  transform: translate(-50%, -50%);
}

button {
  color: #fff;
  margin: 10px;
  outline: none;
  cursor: pointer;
  font-size: 30px;
  background: #444;
  padding: 10px 20px;
  border-color: #444;
  border-radius: 1vh;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.app-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #222;
  margin-bottom: 20px;
  text-align: center;
}

.connect-ui p {
  margin-bottom: 12px;
  max-width: 480px;
  text-align: left;
  line-height: 1.65;
  font-size: 14px;
  color: #555;
}

.error {
  margin-top: 10px;
}

.controls {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 16px 0 8px;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.control-group label {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.control-group select,
.control-group input {
  font-size: 16px;
  font-family: var(--font);
  padding: 6px 10px;
  border: 2px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #222;
  outline: none;
  cursor: pointer;
  min-width: 120px;
}

.control-group select:focus,
.control-group input:focus {
  border-color: #444;
}

.control-group input {
  cursor: text;
  width: 96px;
}

/* Hide the native number input spinners */
.control-group input::-webkit-inner-spin-button,
.control-group input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.control-group input[type="number"] {
  -moz-appearance: textfield;
}

.buttons {
  margin-top: 4px;
}

.export-history {
  background: #3b5aa6;
  border-color: #3b5aa6;
}

.disconnect {
  background: #9b2335;
  border-color: #9b2335;
}

.session-picker {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.export {
  background: #2a7d4f;
  border-color: #2a7d4f;
  font-size: 20px;
  margin-top: 4px;
}

.export:hover {
  background: #235e3b;
  border-color: #235e3b;
}

@keyframes heartbeat {
  0% {
    transform: scale(0.75);
  }
  20% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.75);
  }
  60% {
    transform: scale(1);
  }
  80% {
    transform: scale(0.75);
  }
  100% {
    transform: scale(0.75);
  }
}

/* Simple view: show only the heart and hide controls/title for distraction-free display */
body.simple-view .app-title {
  display: none;
}

body.simple-view .connect-ui,
body.simple-view .controls,
body.simple-view .buttons,
body.simple-view .export,
body.simple-view .error,
body.simple-view .session-picker {
  display: none !important;
}

body.simple-view .heart img {
  width: 340px;
}

body.simple-view .bpm {
  font-size: 120px;
}

.battery-level {
  margin-top: 8px;
  color: #666;
  font-size: 14px;
}
