:root {
  --bg: #0f1226;
  --card: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f2f4ff;
  --muted: #9aa0c3;
  --a: #2de2c4;
  --b: #8a6bff;
}

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

html, body { margin: 0; }

body {
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", "Heebo", "Arial Hebrew", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(138, 107, 255, 0.35), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(45, 226, 196, 0.25), transparent 60%),
    var(--bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.app {
  max-width: 460px;
  margin: 0 auto;
  padding: 18px 18px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { font-size: 1.25rem; margin: 0; font-weight: 700; letter-spacing: 0.2px; }
h2 { font-size: 1rem; margin: 0 0 14px; color: var(--muted); font-weight: 600; }

.chip {
  font: inherit; font-size: 0.78rem; color: var(--muted);
  background: var(--card); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.chip.on { color: var(--a); border-color: rgba(45, 226, 196, 0.45); }

/* ---------- Dial ---------- */
.dial {
  position: relative;
  width: min(78vw, 330px);
  aspect-ratio: 1;
  margin: 4px auto 0;
  border-radius: 50%;
  filter: drop-shadow(0 18px 40px rgba(138, 107, 255, 0.28));
}
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.track { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.09); stroke-width: 14; }
.progress {
  fill: none; stroke: url(#grad); stroke-width: 14; stroke-linecap: round;
  stroke-dasharray: 691.15; stroke-dashoffset: 0;
}
.dial-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-align: center;
}
.label { font-size: 0.85rem; color: var(--muted); letter-spacing: 1px; }
.count {
  font-size: clamp(3.4rem, 19vw, 5.4rem); font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--a), var(--b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.time { font-size: 1.35rem; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 6px; opacity: 0.9; }

.dial.pulse { animation: pulse 0.6s ease-out; }
@keyframes pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

/* ---------- Controls ---------- */
.controls { display: flex; gap: 12px; }
.btn {
  flex: 1; font: inherit; font-size: 1rem; font-weight: 600;
  padding: 14px 16px; border-radius: 16px; cursor: pointer;
  color: var(--text); background: var(--card); border: 1px solid var(--line);
  transition: transform 0.08s ease, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  border: none; color: #0b0e20;
  background: linear-gradient(135deg, var(--a), var(--b));
  box-shadow: 0 8px 24px rgba(138, 107, 255, 0.35);
}
.btn.ghost { background: transparent; }

/* ---------- Settings ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 18px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.field-title { font-size: 0.9rem; }

.dur { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dur label { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dur small { color: var(--muted); font-size: 0.72rem; }

input[type="number"] {
  width: 100%; font: inherit; font-size: 1.3rem; text-align: center;
  color: var(--text); background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px;
  outline: none; font-variant-numeric: tabular-nums;
}
input[type="number"]:focus { border-color: var(--a); }

.switch { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; margin: 4px 0 16px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--a); }

.row { display: flex; gap: 12px; }
.hint { margin: 12px 0 0; font-size: 0.78rem; color: var(--muted); min-height: 1.1em; }
