:root {
  --bg: #100e0c;
  --surface: #17140f;
  --text: #ede9e3;
  --text-muted: #8c8780;
  --fast-color: #7c83fd;
  --eat-color: #f2a65a;
  --accent: var(--fast-color);
  --ring-track: #232019;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body[data-phase="fasting"] { --accent: var(--fast-color); }
body[data-phase="eating"] { --accent: var(--eat-color); }

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
  overflow: hidden;
}

.app {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.6s ease;
}

.phase-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transition: background 0.6s ease;
}

.ring-wrap {
  position: relative;
  width: 264px;
  height: 264px;
}

.ring-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 14;
}

.ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.6s ease;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.ring-percent {
  font-size: 52px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.ring-phase-label {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 6px;
}

.countdown {
  text-align: center;
}

.countdown__label {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 2px;
}

.countdown__value {
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.schedule-line {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

.notif-btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.3s ease, opacity 0.3s ease;
  width: 100%;
}

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

.notif-btn[data-state="on"] {
  color: var(--text-muted);
}

.notif-btn[data-state="unsupported"],
.notif-btn[data-state="denied"] {
  opacity: 0.55;
  cursor: default;
}

.notif-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.install-hint {
  display: none;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
}

.install-hint.visible {
  display: block;
}

.install-hint strong {
  color: var(--text);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .ring-progress {
    transition: none;
  }
}
