* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: #0f1115;
  color: #e8eaed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

header {
  padding: 14px 16px 8px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #b8bcc4;
}

.header-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #3a3f4a;
  border-radius: 10px;
  background: #1a1d24;
  color: #e8eaed;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.header-btn:active { background: #2a2e38; }

.header-spacer { width: 36px; height: 36px; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 16px;
  padding: 16px 20px;
  min-height: 0;
}

.display {
  font-size: clamp(72px, 22vw, 128px);
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  line-height: 1;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.display.done {
  color: #ef4444;
  animation: pulse 0.9s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.preset-btn {
  padding: 12px 18px;
  border: 1px solid #3a3f4a;
  border-radius: 12px;
  background: #1a1d24;
  color: #e8eaed;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s ease;
}

.preset-btn:active { background: #2a2e38; }

.adjusters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.adjust-group {
  display: flex;
  gap: 6px;
}

.adjust-btn {
  min-width: 64px;
  padding: 10px 12px;
  border: 1px solid #3a3f4a;
  border-radius: 10px;
  background: #1a1d24;
  color: #e8eaed;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s ease;
}

.adjust-btn:active { background: #2a2e38; }

.action-btn {
  width: 100%;
  max-width: 320px;
  padding: 22px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(180deg, #1e8e3e, #16a34a);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.1s ease, opacity 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.action-btn:active { transform: scale(0.97); }

.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.action-btn.pause {
  background: linear-gradient(180deg, #d97706, #f59e0b);
}

.action-btn.stop {
  background: linear-gradient(180deg, #dc2626, #ef4444);
}

/* Adjuster + Presets ausblenden, solange Timer läuft oder Alarm aktiv ist */
body.running .presets,
body.running .adjusters,
body.done .presets,
body.done .adjusters {
  visibility: hidden;
  pointer-events: none;
}
