/* ── Respiration carrée (box breathing) ── */

.boxbreath-note {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
  background: rgba(0, 130, 160, 0.08);
  border: 1px solid rgba(0, 130, 160, 0.2);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.9rem;
}

.boxbreath-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.boxbreath-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.boxbreath-input {
  width: 100%;
  background: var(--tool-surface-1);
  border: 1px solid var(--tool-border-1);
  border-radius: 8px;
  color: var(--deep);
  padding: 0.5rem 0.6rem;
  font-size: 0.86rem;
}

.boxbreath-input:focus {
  outline: none;
  border-color: rgba(160, 80, 255, 0.5);
}

/* ── Zone live ── */
.boxbreath-live {
  margin-top: 0.8rem;
  background: var(--tool-surface-2);
  border: 1px solid var(--tool-violet-soft);
  border-radius: 16px;
  padding: 1rem 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

/* Label de phase (↑ Inspiration, etc.) */
.boxbreath-phase {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tool-violet-text);
  min-height: 1.1em;
  text-align: center;
  transition: color 0.5s ease;
}

/* Conteneur du cercle — espace fixe pour éviter les sauts de layout */
.boxbreath-circle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  position: relative;
}

/* Halo de fond (pulsation douce en permanence) */
.boxbreath-circle-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(120, 60, 255, 0.06);
  animation: bbHaloPulse 4s ease-in-out infinite;
}
@keyframes bbHaloPulse {
  0%, 100% { transform: scale(0.88); opacity: 0.5; }
  50%       { transform: scale(1.08); opacity: 1;   }
}

/* ── Le cercle lui-même ── */
.boxbreath-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;

  /* Couleur/fond initiale (violet neutre) */
  background: radial-gradient(circle at 35% 28%, rgba(160, 120, 255, 0.92), rgba(70, 40, 170, 0.88));
  box-shadow:
    0 0 32px rgba(140, 80, 255, 0.28),
    inset 0 0 26px rgba(255, 255, 255, 0.09);

  /* Taille initiale : petit (état expiration/pause basse) */
  transform: scale(0.5);

  /* La transition-duration est pilotée par JS selon la phase */
  transition-property: transform, background, box-shadow;
  transition-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
  transition-duration: 0.9s;

  /* Pour centrer le compteur à l'intérieur */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Anneau externe subtil */
.boxbreath-circle::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.10);
  pointer-events: none;
}

/* Compteur de secondes à l'intérieur du cercle */
.boxbreath-count {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  user-select: none;
  pointer-events: none;
  /* Ne grossit/rétrécit pas avec le cercle (compense le scale) */
  position: absolute;
}

/* Méta (cycle X / Y) */
.boxbreath-meta {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.05em;
  min-height: 1.1em;
}

/* ── Contrôles ── */
.boxbreath-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.boxbreath-btn {
  flex: 1;
  padding: 0.55rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--tool-border-2);
  background: var(--tool-surface-1);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.boxbreath-btn:hover:not(:disabled) {
  border-color: rgba(0, 210, 245, 0.4);
  color: var(--cyan);
}

.boxbreath-btn-primary {
  background: var(--tool-violet-gradient);
  border-color: var(--tool-violet-soft);
  color: var(--tool-violet-btn-text);
}

.boxbreath-btn:disabled {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}

/* ── Avertissement ── */
.boxbreath-warning {
  margin-top: 0.65rem;
  font-size: 0.67rem;
  color: var(--tool-soft-warning-text);
  line-height: 1.55;
}

.boxbreath-audio-options {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.boxbreath-audio-block .boxbreath-music {
  margin-top: 0;
}

.boxbreath-music {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.boxbreath-volume {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0.4rem 0 0 1.45rem;
  max-width: calc(100% - 1.45rem);
}

.boxbreath-volume-cap {
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.boxbreath-voice-hint {
  font-size: 0.65rem;
  color: var(--muted);
  margin: 0.25rem 0 0 1.45rem;
  opacity: 0.72;
  font-style: italic;
}

.boxbreath-volume-range {
  width: 100%;
  height: 0.45rem;
  accent-color: rgba(140, 90, 255, 0.95);
  cursor: pointer;
}

.boxbreath-volume-range:focus {
  outline: none;
}

.boxbreath-volume-range:focus-visible {
  outline: 2px solid rgba(160, 100, 255, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}
