:root {
  --bg: linear-gradient(135deg, #C33764 0%, #1D2671 100%);
  --card-bg: rgba(255,255,255,0.08);
  --card-border: rgba(255,255,255,0.12);
  --accent: #00f5c8;
  --danger: #ef4444;
  --text: #fff;
  --muted: rgba(255,255,255,0.55);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
}

/* ===================== STARS ===================== */
.stars {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: twinkle 20s infinite linear;
}
@keyframes twinkle { 0%,100%{opacity:0.4;} 50%{opacity:0.9;} }

/* ===================== ONBOARDING ===================== */
.onboarding {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  z-index: 1000;
  transition: opacity 0.5s ease;
}

.slides-container {
  width: 88%; max-width: 400px;
  height: 65vh; max-height: 460px;
  overflow: hidden; position: relative;
  touch-action: pan-y;
  border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
}

.slide {
  position: absolute; inset: 0;
  padding: 40px 28px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  opacity: 0; transform: translateX(100%);
  transition: all 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.slide.active { opacity: 1; transform: translateX(0); }
.slide.prev { transform: translateX(-100%); }

.slide-icon { font-size: 48px; margin-bottom: 20px; }
.slide h2 { font-size: 26px; font-weight: 700; margin-bottom: 14px; line-height: 1.3; }
.slide p { font-size: 16px; color: var(--muted); line-height: 1.6; }

.btn-start {
  margin-top: 28px;
  padding: 14px 32px;
  border-radius: 50px;
  border: none;
  background: var(--accent);
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: auto;
  transition: transform 0.15s ease;
}
.btn-start:active { transform: scale(0.97); }

.dots { display: flex; gap: 10px; margin-top: 24px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  cursor: pointer; transition: all 0.3s ease;
}
.dot.active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transform: scale(1.3);
}

/* ===================== APP ===================== */
.app { position: relative; z-index: 1; }
.app-inner {
  max-width: 430px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  min-height: 100vh;
  display: flex; flex-direction: column;
  gap: 20px;
}

header { text-align: center; padding-top: 12px; }
header h1 { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.subtitle { font-size: 15px; color: var(--muted); margin-bottom: 14px; }

.streak-badge {
  display: inline-block;
  background: rgba(0, 245, 200, 0.15);
  border: 1px solid rgba(0, 245, 200, 0.35);
  color: var(--accent);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
}

/* ===================== HOME SCREEN ===================== */
.prompt {
  text-align: center;
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 16px;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 18px;
  padding: 20px 12px;
  font-size: 14px;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  transition: background 0.2s ease, transform 0.15s ease;
  width: 100%;
}
.choice-btn:active { transform: scale(0.97); background: rgba(255,255,255,0.14); }

.choice-icon { font-size: 28px; }
.choice-label { font-weight: 600; font-size: 14px; }

.panic {
  width: 100%;
  background: rgba(239, 68, 68, 0.2);
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  padding: 16px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.panic:active { background: rgba(239, 68, 68, 0.35); }

/* ===================== STRATEGIES ===================== */
.back-btn {
  background: none !important;
  border: none !important;
  color: var(--muted) !important;
  font-size: 15px !important;
  cursor: pointer !important;
  padding: 0 0 12px !important;
  text-align: left !important;
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.back-btn:hover, .back-btn:active { color: white !important; }

#strategy-title {
  font-size: 20px; font-weight: 700;
  margin-bottom: 16px;
}

.strategy-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.strategy-card:active { transform: scale(0.98); background: rgba(255,255,255,0.12); }

.strategy-icon { font-size: 28px; flex-shrink: 0; }
.strategy-body { flex: 1; }
.strategy-body strong { font-size: 15px; font-weight: 600; display: block; margin-bottom: 3px; }
.strategy-body p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.strategy-arrow { font-size: 18px; color: var(--muted); flex-shrink: 0; }

/* ===================== TIMER / RESPIRATION ===================== */
#timer-screen { text-align: center; }
#timer-screen h2 { font-size: 20px; font-weight: 700; margin-bottom: 24px; }

.breath-container {
  display: flex; justify-content: center;
  margin: 0 auto 20px;
}

.breath-svg {
  width: 200px; height: 200px;
}

.breath-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-dasharray: 377;
  stroke-dashoffset: 0;
  transform-origin: center;
  transform: rotate(-90deg);
  transition: r 2s ease, stroke 1s ease;
  r: 55;
}

.breath-ring.breath-expand {
  animation: expand 4s ease-in-out forwards;
  stroke: var(--accent);
}
.breath-ring.breath-hold {
  animation: none;
  stroke: #facc15;
  r: 70;
}
.breath-ring.breath-contract {
  animation: contract 6s ease-in-out forwards;
  stroke: #a78bfa;
}

@keyframes expand {
  from { r: 40; }
  to { r: 70; }
}
@keyframes contract {
  from { r: 70; }
  to { r: 40; }
}

.breath-count {
  font-size: 36px;
  font-weight: 800;
  fill: white;
  text-anchor: middle;
  dominant-baseline: middle;
}
.breath-phase {
  font-size: 14px;
  fill: rgba(255,255,255,0.7);
  text-anchor: middle;
}

.timer-instruction {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  padding: 0 16px;
  margin-bottom: 24px;
}

/* ===================== SUCCÈS ===================== */
#success-screen { text-align: center; padding-top: 20px; }

.success-anim {
  font-size: 72px;
  margin-bottom: 16px;
  display: block;
}
@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.success-pop { animation: pop 0.6s ease; }

#success-screen h2 { font-size: 28px; font-weight: 800; margin-bottom: 10px; }
#success-screen p { font-size: 16px; color: var(--muted); margin-bottom: 20px; }

.badge-earned {
  background: rgba(0, 245, 200, 0.15);
  border: 1px solid rgba(0, 245, 200, 0.4);
  color: var(--accent);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  animation: pop 0.6s ease;
}

/* ===================== BOUTONS GÉNÉRIQUES ===================== */
.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  border-radius: 50px;
  border: none;
  background: var(--accent);
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.btn-primary:active { transform: scale(0.98); }

.btn-success {
  display: block;
  width: 100%;
  padding: 15px;
  border-radius: 50px;
  border: none;
  background: var(--accent);
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 20px;
  transition: transform 0.15s ease;
}
.btn-success:active { transform: scale(0.98); }

/* ===================== PROGRESS ===================== */
.progress-section { margin-top: 4px; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--muted);
  margin-bottom: 6px;
}
.progress {
  background: rgba(255,255,255,0.1);
  height: 6px; border-radius: 3px; overflow: hidden;
}
#progbar {
  height: 100%;
  background: var(--accent);
  width: 0%; transition: width 0.5s ease;
  border-radius: 3px;
}

/* ===================== BADGES ===================== */
#badges-section h3 {
  font-size: 15px; font-weight: 600;
  margin-bottom: 10px; color: var(--muted);
}
#badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  background: rgba(0,245,200,0.12);
  border: 1px solid rgba(0,245,200,0.25);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* ===================== FOOTER ===================== */
.lw-footer {
  background: rgba(0,0,0,0.25);
  border-top: 1px solid var(--card-border);
  padding: 28px 20px;
  margin-top: 12px;
}
.lw-footer-container {
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lw-footer-brand h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.lw-footer-brand p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.lw-footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lw-footer-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.lw-footer-links a:hover { opacity: 1; }

.lw-footer-legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--card-border);
  padding-top: 16px;
}
.lw-footer-legal p {
  font-size: 12px;
  color: var(--muted);
}
.btn-replay {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  color: var(--text) !important;
  font-size: 13px !important;
  padding: 8px 14px !important;
  border-radius: 20px !important;
  cursor: pointer !important;
  width: auto !important;
  display: inline-block !important;
  transition: background 0.2s;
}
.btn-replay:hover { background: rgba(255,255,255,0.14) !important; }

/* ===================== UTILS ===================== */
.hidden { display: none !important; }
