/* Respiración guiada: capa de refinamiento visual y accesible. */
.special-breath-container {
  margin-bottom: 20px;
}

.special-breath-btn {
  position: relative;
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid rgba(45, 212, 191, 0.34);
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 20%, rgba(94, 234, 212, 0.13), transparent 30%),
    linear-gradient(135deg, rgba(45, 212, 191, 0.11), rgba(45, 212, 191, 0.025));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.special-breath-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, 0.65);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24), 0 0 24px rgba(45, 212, 191, 0.08);
}

.special-breath-btn:active {
  transform: translateY(0) scale(0.995);
}

.special-breath-btn:focus-visible,
.breath-overlay button:focus-visible {
  outline: 3px solid rgba(94, 234, 212, 0.8);
  outline-offset: 3px;
}

.special-breath-visual {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(94, 234, 212, 0.24);
}

.special-breath-visual::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  border: 1px solid rgba(94, 234, 212, 0.36);
  animation: breathEntryPulse 3.8s ease-in-out infinite;
}

.special-breath-bubble {
  position: relative;
  z-index: 1;
  font-size: 1.45rem;
  line-height: 1;
}

.special-breath-copy {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.special-breath-copy strong {
  color: var(--teal);
  font-family: "Syne", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
}

.special-breath-copy > span {
  overflow: hidden;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 0.76rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-breath-cta {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 6px 18px rgba(45, 212, 191, 0.2);
  color: #02110f;
  font-family: "Syne", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
}

@keyframes breathEntryPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1.13); }
}

.breath-overlay {
  padding:
    max(22px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

.breath-overlay[aria-hidden="true"] {
  visibility: hidden;
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.6s;
}

.breath-overlay.show {
  visibility: visible;
  transition-delay: 0s;
}

.breath-title {
  margin: 0 0 16px;
  color: var(--text);
  font-family: "Syne", sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  letter-spacing: 0.02em;
}

.breath-top {
  width: min(100%, 620px);
  margin-top: 0;
}

.breath-tabs {
  max-width: 100%;
}

.breath-tab {
  min-height: 42px;
}

.breath-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.breath-desc {
  max-width: 540px;
  min-height: 44px;
}

.breath-center {
  min-height: 0;
}

.breath-sphere-wrap {
  width: min(40vh, 300px);
  height: min(40vh, 300px);
  min-width: 210px;
  min-height: 210px;
  margin-bottom: clamp(20px, 4vh, 40px);
}

.breath-sphere {
  will-change: transform;
}

.breath-sphere.inhale,
.breath-sphere.exhale {
  transition-duration: var(--phase-duration, 5s);
}

.breath-sphere.paused {
  transition: none !important;
}

.breath-sphere.hold {
  transform: scale(2.5);
  background: radial-gradient(135deg, #fde68a, #b45309);
  box-shadow: 0 0 46px rgba(245, 158, 11, 0.4);
}

.breath-sphere.hold2 {
  transform: scale(1);
  background: radial-gradient(135deg, #c4b5fd, #6d28d9);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.38);
}

.breath-phase {
  min-height: 28px;
  color: var(--teal);
  font-family: "Syne", sans-serif;
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: center;
}

.breath-phase.holding,
.breath-phase.holding2 {
  color: #fbbf24;
}

.breath-count {
  min-height: 58px;
  margin-top: 2px;
  color: var(--text);
  font-family: "Syne", sans-serif;
  font-size: clamp(2rem, 7vw, 3.25rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.1;
}

.breath-cycles {
  min-height: 22px;
  margin-top: 5px;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 0.78rem;
}

.breath-controls {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.breath-controls button {
  min-width: 116px;
  min-height: 44px;
}

.breath-btn-pause {
  padding: 10px 22px;
  border: 1px solid rgba(45, 212, 191, 0.32);
  border-radius: 50px;
  background: rgba(45, 212, 191, 0.1);
  color: var(--teal);
  cursor: pointer;
  font-family: "Syne", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.22s ease, border-color 0.22s ease;
}

.breath-btn-pause:hover {
  border-color: rgba(45, 212, 191, 0.58);
  background: rgba(45, 212, 191, 0.17);
}

.breath-btn-start,
.breath-btn-stop {
  min-height: 44px;
}

.breath-voice-toggle,
.breath-close {
  top: max(16px, env(safe-area-inset-top));
}

.breath-voice-toggle {
  left: max(16px, env(safe-area-inset-left));
}

.breath-close {
  right: max(16px, env(safe-area-inset-right));
}

@media (max-width: 600px) {
  .special-breath-btn {
    gap: 11px;
    padding: 12px;
  }

  .special-breath-visual {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .special-breath-cta {
    min-height: 32px;
    padding: 0 12px;
  }

  .breath-overlay {
    justify-content: flex-start;
    gap: 10px;
  }

  .breath-top {
    padding-top: 52px;
  }

  .breath-title {
    margin-bottom: 12px;
  }

  .breath-tabs {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    margin-bottom: 12px;
    border-radius: 16px;
    scrollbar-width: none;
  }

  .breath-tabs::-webkit-scrollbar {
    display: none;
  }

  .breath-tab {
    flex: 0 0 auto;
    padding: 8px 13px;
    white-space: nowrap;
  }

  .breath-desc {
    min-height: 52px;
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .breath-center {
    flex: 1;
  }

  .breath-sphere-wrap {
    width: min(34vh, 230px);
    height: min(34vh, 230px);
    min-width: 175px;
    min-height: 175px;
    margin-bottom: 18px;
  }

  .breath-controls {
    width: 100%;
    margin-top: 12px;
  }

  .breath-controls button {
    min-width: 0;
    flex: 1;
    max-width: 180px;
  }
}

@media (max-width: 380px) {
  .special-breath-copy > span {
    max-width: 145px;
  }

  .special-breath-cta {
    padding: 0 10px;
    font-size: 0.68rem;
  }

  .breath-title {
    font-size: 1rem;
  }
}

@media (max-width: 600px) and (max-height: 650px) {
  .breath-overlay {
    gap: 4px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .breath-top {
    padding-top: 42px;
  }

  .breath-title {
    margin-bottom: 6px;
  }

  .breath-tabs {
    margin-bottom: 6px;
  }

  .breath-tab {
    min-height: 38px;
    padding-block: 6px;
  }

  .breath-desc {
    min-height: 36px;
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .breath-sphere-wrap {
    width: 180px;
    height: 180px;
    min-width: 180px;
    min-height: 180px;
    margin-bottom: 8px;
  }

  .breath-count {
    min-height: 45px;
    font-size: 2.25rem;
  }

  .breath-controls {
    min-height: 44px;
    margin-top: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .special-breath-visual::before,
  .breath-halo,
  .breath-ring,
  .breath-pulse {
    animation: none !important;
  }

  .special-breath-btn,
  .breath-overlay,
  .breath-sphere,
  .breath-close,
  .breath-voice-toggle {
    transition-duration: 0.01ms !important;
  }
}
