/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 40px;
  background: var(--primary);
  color: var(--white);
  border-radius: 100px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 6px 24px rgba(107,127,71,.28);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary:active {
  transform: scale(.96);
  box-shadow: 0 2px 12px rgba(107,127,71,.18);
}
.btn-primary.btn-danger { background: #b85c5c; box-shadow: 0 6px 24px rgba(184,92,92,.28); }
.btn-primary.btn-outline {
  background: transparent;
  color: var(--primary);
  box-shadow: inset 0 0 0 2px var(--primary);
}
.btn-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform .2s ease;
}
.btn-icon:active { transform: scale(.93); }
.btn-icon svg { width: 22px; height: 22px; }

/* ── Range slider ── */
input[type="range"] {
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(107,127,71,.3);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--white);
  padding: 12px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 500;
  white-space: nowrap;
  max-width: 90vw;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Achievement badge ── */
.achievement-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  transition: opacity .3s;
}
.achievement-card.locked { opacity: .45; }
.achievement-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  background: var(--surface);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.achievement-card:not(.locked) .achievement-icon {
  background: linear-gradient(135deg, #e8f0d8, #d4e6b5);
}
.achievement-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.achievement-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Stats ── */
.stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}
.stat-card {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-number {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 600;
  color: var(--primary-dark);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Week dots ── */
.week-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}
.week-dot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.week-dot-day {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.week-dot-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid transparent;
  transition: background .3s, border-color .3s;
}
.week-dot-circle.active {
  background: var(--primary);
  border-color: var(--primary-dark);
}
.week-dot-circle.today {
  border-color: var(--primary);
}

/* ── Sounds grid ── */
.sounds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.sound-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .2s ease, background .3s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}
.sound-card:active { transform: scale(.96); }
.sound-card.playing {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  box-shadow: 0 8px 28px rgba(107,127,71,.3);
}
.sound-card-icon { font-size: 32px; line-height: 1; }
.sound-card-name {
  font-size: 13px;
  font-weight: 600;
}
.sound-card-waves {
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,.3);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s ease;
}
.sound-card.playing .sound-card-waves {
  animation: waveAnim 2s ease-in-out infinite alternate;
}
@keyframes waveAnim {
  from { transform: scaleX(.2); }
  to   { transform: scaleX(1); }
}

/* ── Volume control ── */
.volume-control {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.volume-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
  display: block;
}

/* ── Duration selector ── */
.duration-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.duration-btn {
  padding: 10px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-muted);
  transition: background .25s, color .25s;
}
.duration-btn.active {
  background: var(--primary);
  color: var(--white);
}

/* ── Breath pattern tabs ── */
.pattern-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.pattern-tab {
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-muted);
  transition: background .25s, color .25s;
}
.pattern-tab.active {
  background: var(--primary);
  color: var(--white);
}

/* ── Pattern info card ── */
.pattern-info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 24px;
  box-shadow: var(--shadow);
}
.pattern-info-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.pattern-info-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.pattern-info-ratios {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.pattern-ratio-pill {
  padding: 4px 12px;
  background: var(--surface);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* ── Auth overlay ── */
#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.auth-logo {
  font-size: 56px;
  line-height: 1;
}

.auth-title {
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

.auth-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 8px;
}

.auth-error {
  font-size: 13px;
  color: #c0392b;
  min-height: 18px;
  margin: 0;
}

/* ── User chip (home header) ── */
.home-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: none;
  border-radius: 100px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background var(--transition);
}

.user-chip:hover { background: var(--surface-2); }

.user-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-chip-name {
  color: var(--text-muted);
}
