:root {
  --bg: #0F1B2D;
  --card: #182841;
  --border: #2A3D58;
  --selected: #2F4566;
  --text: #EAF2F5;
  --secondary: #9FB2C2;
  --accent: #7FD1C7;
  --rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button, select, input { font: inherit; color: inherit; }

.app {
  height: 100vh;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 20px 4px;
}

/* Kopf */

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--secondary);
}

h1 {
  margin: 2px 0 0;
  font-family: var(--rounded);
  font-size: 30px;
  font-weight: 700;
}

/* Atemkreis */

.circle {
  position: relative;
  height: 220px;
  display: grid;
  place-items: center;
}

.circle > * { grid-area: 1 / 1; }

.ring { width: 214px; height: 214px; }

.ring circle {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.ball {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.9;
  transform: scale(0.72);
  will-change: transform;
}

.circle-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--bg);
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.phase { font-family: var(--rounded); font-size: 20px; font-weight: 600; }
.half { font-size: 13px; font-weight: 500; }

/* Dauer */

.duration {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip[aria-pressed="true"] {
  background: var(--selected);
  border-color: var(--accent);
  color: var(--text);
}

.time {
  min-width: 60px;
  text-align: right;
  font-family: var(--rounded);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Einstellungen */

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.block { display: flex; flex-direction: column; gap: 6px; }

.label { font-size: 15px; font-weight: 600; }

.bpm-head { display: flex; align-items: baseline; gap: 6px; }
.spacer { flex: 1; }
.bpm-value { font-family: var(--rounded); font-size: 18px; font-weight: 600; }
.unit { font-size: 13px; font-weight: 500; color: var(--secondary); }

.ends {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--secondary);
}

.divider { height: 1px; background: var(--border); }

.select { position: relative; margin-top: 2px; }

.select select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 48px;
  padding: 0 40px 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.select svg {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  fill: none;
  stroke: var(--text);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.volumes { gap: 12px; }

.volume { display: flex; align-items: center; gap: 12px; }

.volume .icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: var(--secondary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.volume-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.volume-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
}

.percent {
  font-weight: 400;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

/* Schieberegler */

input[type="range"] {
  --fill: 50%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--fill), var(--border) var(--fill));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -11px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}

input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* Start */

.bottom {
  padding: 12px 20px calc(8px + env(safe-area-inset-bottom));
}

.play {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 18px;
  background: var(--accent);
  color: var(--bg);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

.play svg { width: 20px; height: 20px; fill: currentColor; }

.play:active, .chip:active { filter: brightness(0.92); }

button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 360px) {
  .content { padding-left: 16px; padding-right: 16px; }
  .bottom { padding-left: 16px; padding-right: 16px; }
  .duration { gap: 6px; }
  .chip { font-size: 13px; }
  .time { min-width: 52px; font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .ball { will-change: auto; }
}
