/* ─────────────────────────────────────────────────
   Bell Meditation — Web
   Palette mirrors iOS AppTheme (calm indigo → violet)
   ───────────────────────────────────────────────── */
:root {
  --accent:      #6147c7;
  --accent-2:    #8c66eb;
  --gold:        #edba48;
  --destructive: #e64034;
  --bg:          #f5f5f8;
  --bg-soft:     #ffffff;
  --bg-tinted:   rgba(97, 71, 199, 0.08);
  --border:      rgba(97, 71, 199, 0.18);
  --text:        #1b1b24;
  --text-sec:    #5c5c6b;
  --text-tri:    #9090a0;
  --radius:      16px;
  --shadow-sm:   0 2px 10px rgba(20, 20, 40, 0.05);
  --shadow-md:   0 6px 22px rgba(20, 20, 40, 0.08);
  --shadow-lg:   0 14px 44px rgba(20, 20, 40, 0.12);
  --grad: linear-gradient(90deg, var(--accent), var(--accent-2));
  --grad-v: linear-gradient(180deg, var(--accent), var(--accent-2));
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

img { max-width: 100%; display: block; }

/* ─────────────── Nav ─────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 245, 248, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.brand-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--grad-v);
  box-shadow: 0 0 0 3px rgba(97, 71, 199, 0.12);
}
.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: 0 2px 6px rgba(20, 20, 40, 0.15);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  color: var(--text-sec);
}
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  background: var(--grad);
  color: #fff !important;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(97, 71, 199, 0.35);
}
.nav-cta:hover { color: #fff !important; }

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .lang-picker .lang-picker-btn span { display: none; }
}

/* Language picker */
.lang-picker {
  position: relative;
}
.lang-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 7px 11px;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.lang-picker-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--bg-tinted); }
.lang-picker-btn svg { width: 16px; height: 16px; }

.lang-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  max-height: 340px;
  overflow-y: auto;
  z-index: 30;
  animation: fadeIn .15s ease;
}
[dir="rtl"] .lang-picker-menu { right: auto; left: 0; }
.lang-picker-menu li {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  transition: background .12s, color .12s;
}
.lang-picker-menu li:hover { background: var(--bg-tinted); color: var(--accent); }
.lang-picker-menu li.active {
  background: var(--grad);
  color: #fff;
  font-weight: 600;
}

/* RTL adjustments */
[dir="rtl"] .hero-ctas,
[dir="rtl"] .eyebrow { flex-direction: row-reverse; }
[dir="rtl"] .level-bar-fill,
[dir="rtl"] .level-progress,
[dir="rtl"] .stats-grid { text-align: right; }
[dir="rtl"] .phone-stack .phone-back { right: auto; left: -30px; }
[dir="rtl"] .phone-stack .phone-front { right: auto; left: 60px; }
[dir="rtl"] .hero-icon { left: auto; right: 12%; }

/* ─────────────── Hero ─────────────── */
.hero {
  padding: 64px 24px 32px;
  background: radial-gradient(circle at 80% 20%, rgba(140, 102, 235, 0.18), transparent 55%),
              radial-gradient(circle at 15% 80%, rgba(237, 186, 72, 0.1), transparent 55%),
              var(--bg);
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.eyebrow.center { display: block; text-align: center; }
.eyebrow.light { color: rgba(255, 255, 255, 0.7); }
.eyebrow .rating { color: var(--gold); letter-spacing: 1px; }
.eyebrow .dot { opacity: 0.4; }
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-sec);
  max-width: 520px;
  margin: 0 0 24px;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.hero-credit {
  margin: 24px 0 0;
  font-size: 13px;
  color: var(--text-tri);
}

.app-store-badge {
  display: inline-block;
  transition: transform .15s, filter .2s;
  line-height: 0;
}
.app-store-badge img { height: 56px; width: auto; display: block; }
.app-store-badge:hover { transform: translateY(-1px); filter: brightness(1.08); }
.app-store-badge-large img { height: 72px; }

/* Hero art — app icon + phone screenshots */
.hero-art {
  position: relative;
  width: 100%;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
}
.hero-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 102, 235, 0.35), rgba(140, 102, 235, 0) 65%);
  filter: blur(20px);
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.08); opacity: 1; }
}
.hero-icon {
  position: absolute;
  width: 132px;
  height: 132px;
  border-radius: 30px;
  box-shadow: 0 24px 64px rgba(57, 47, 99, 0.45),
              0 6px 16px rgba(20, 20, 40, 0.2);
  top: 8%;
  left: 12%;
  z-index: 3;
  animation: floatIcon 5s ease-in-out infinite;
}
@keyframes floatIcon {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-10px) rotate(-6deg); }
}

.phone-stack {
  position: relative;
  width: 260px;
  height: 420px;
}
.phone {
  position: absolute;
  border-radius: 32px;
  overflow: hidden;
  background: #1c1a28;
  box-shadow: 0 30px 60px rgba(15, 15, 30, 0.35),
              0 8px 20px rgba(15, 15, 30, 0.2),
              0 0 0 1.5px rgba(0, 0, 0, 0.3);
  transition: transform .3s;
}
.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.phone-back {
  width: 220px;
  height: 460px;
  top: 0;
  right: -30px;
  transform: rotate(6deg);
  opacity: 0.92;
}
.phone-front {
  width: 240px;
  height: 500px;
  top: 20px;
  right: 60px;
  transform: rotate(-4deg);
  z-index: 2;
}
.phone-stack:hover .phone-front { transform: rotate(-4deg) translateY(-6px); }
.phone-stack:hover .phone-back  { transform: rotate(6deg) translateY(-2px); }

@media (max-width: 860px) {
  .hero-art { min-height: 420px; margin-top: 20px; }
  .hero-icon { top: 0; left: 4%; width: 104px; height: 104px; border-radius: 24px; }
  .phone-stack { width: 220px; height: 380px; }
  .phone-back  { width: 190px; height: 400px; right: -10px; }
  .phone-front { width: 210px; height: 440px; right: 40px; top: 14px; }
}
@media (max-width: 520px) {
  .hero-icon { display: none; }
  .hero-art { min-height: 380px; }
}

/* ─────────────── Buttons ─────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s, background .2s;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(97, 71, 199, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(97, 71, 199, 0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-tinted); }
.btn-large { padding: 18px 36px; font-size: 17px; }

/* ─────────────── Demo section ─────────────── */
.demo-section {
  padding: 80px 20px;
  background: linear-gradient(180deg, var(--bg), #ececf2);
}
.demo-footnote {
  max-width: 560px;
  margin: 30px auto 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-tri);
  line-height: 1.6;
}

.section-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }

/* ─────────────── App card ─────────────── */
.app-shell {
  padding: 40px 20px 80px;
  background: linear-gradient(180deg, var(--bg), #ececf2);
}
.app-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-soft);
  border-radius: 24px;
  padding: 24px 22px 22px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

/* Hero row in app */
.hero-row {
  display: flex;
  gap: 16px;
  align-items: center;
}
.hero-bell {
  width: 88px; height: 88px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-tinted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  background-image:
    linear-gradient(var(--bg-tinted), var(--bg-tinted));
}
.hero-bell svg {
  width: 40px; height: 40px;
  fill: url(#bellGrad);
}
/* fallback — use gradient via CSS since inline svg gradient is tricky */
.hero-bell {
  background: var(--bg-tinted);
}
.hero-bell svg {
  color: var(--accent);
  fill: var(--accent);
}
.quote {
  font-style: italic;
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.5;
  margin: 0;
  white-space: pre-line;
}

/* Picker row */
.picker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.picker-card {
  position: relative;
  background: #f7f7fb;
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: var(--radius);
  padding: 14px 14px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.picker-card:hover:not(.disabled) { border-color: var(--border); background: #fff; }
.picker-card.disabled { opacity: 0.45; cursor: not-allowed; }
.picker-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-sec);
}
.picker-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-align: center;
  padding: 8px 0 0;
}
.picker-card select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px; /* prevents iOS zoom */
}
.picker-card.disabled select { pointer-events: none; }

/* Button row */
.button-row {
  display: flex;
  gap: 10px;
}
.btn-play {
  flex: 1;
  min-height: 56px;
  border-radius: var(--radius);
  border: 0;
  background: var(--grad);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(97, 71, 199, 0.35);
  transition: background .2s, transform .1s, box-shadow .2s;
}
.btn-play:active { transform: translateY(1px); }
.btn-play.playing {
  background: var(--destructive);
  box-shadow: 0 6px 20px rgba(230, 64, 52, 0.35);
}
.btn-play svg { width: 20px; height: 20px; }
.btn-play .ico-stop { display: none; }
.btn-play.playing .ico-play { display: none; }
.btn-play.playing .ico-stop { display: inline-block; }

.btn-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  border: 0;
  background: var(--bg-tinted);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.btn-icon:hover { background: rgba(97, 71, 199, 0.14); }
.btn-icon svg { width: 22px; height: 22px; }

/* Progress */
.progress-section {
  text-align: center;
  min-height: 40px;
}
.progress-primary {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-sec);
  min-height: 18px;
}
.progress-secondary {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-tri);
}

/* Instruction card */
.instruction-card {
  background: #f7f7fb;
  border-radius: var(--radius);
  padding: 20px 16px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  animation: fadeIn .35s ease;
}
.instruction-text {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  text-align: center;
  line-height: 1.5;
}
.waveform {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

/* Stats card */
.stats-card {
  background: #f7f7fb;
  border-radius: var(--radius);
  padding: 16px 0 14px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn .35s ease;
}
.level-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}
.level-code {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--grad);
  border-radius: 10px;
  padding: 5px 10px;
  min-width: 36px;
  text-align: center;
  letter-spacing: 0.5px;
}
.level-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}
.level-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  margin: 14px 16px 0;
  overflow: hidden;
}
.level-bar-fill {
  height: 100%;
  background: var(--grad);
  width: 0%;
  border-radius: 4px;
  transition: width .6s ease;
}
.level-progress {
  margin: 8px 16px 0;
  font-size: 12px;
  color: var(--text-sec);
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding: 14px 8px 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 14px;
}
.stat-tile {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-tile strong {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.stat-tile span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sec);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ─────────────── Sections ─────────────── */
.section {
  padding: 80px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.section-dark {
  background: #1c1a28;
  color: #e6e6ef;
  max-width: none;
  margin: 0;
  padding: 80px 24px;
}
.section-dark .section-title,
.section-dark .section-lede { color: inherit; }
.section-title {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 12px;
}
.section-lede {
  font-size: 16px;
  color: var(--text-sec);
  text-align: center;
  max-width: 620px;
  margin: 0 auto 48px;
  line-height: 1.6;
}
.section-dark .section-lede { color: #b6b6c7; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.feature {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-ico {
  font-size: 28px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bg-tinted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.feature p {
  margin: 0;
  color: var(--text-sec);
  font-size: 14px;
  line-height: 1.55;
}

/* Sound grid (in dark section) */
.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  max-width: 920px;
  margin: 0 auto;
}
.sound-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 18px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.sound-card:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.2); }
.sound-card.active {
  background: var(--grad);
  border-color: transparent;
}
.sound-card-ico {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.sound-card.active .sound-card-ico {
  background: rgba(255, 255, 255, 0.25);
}
.sound-card-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}

/* Level grid */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.level-card {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 22px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.level-card .level-code {
  align-self: flex-start;
  font-size: 12px;
  padding: 6px 12px;
}
.level-card h3 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 700;
}
.level-card p {
  margin: 0;
  color: var(--text-sec);
  font-size: 13px;
}

/* Showcase (phones) */
.showcase {
  padding: 80px 24px 100px;
  background: linear-gradient(180deg, #1c1a28, #0f0e18);
  color: #e6e6ef;
  text-align: center;
}
.showcase .eyebrow { color: rgba(255, 255, 255, 0.7); }
.showcase .section-title { color: #fff; }
.showcase .section-lede { color: #b6b6c7; }
.showcase-stage {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-top: 40px;
}
.showcase-phone {
  width: clamp(200px, 28vw, 320px);
  border-radius: 36px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.45),
              0 8px 20px rgba(0, 0, 0, 0.3),
              0 0 0 1.5px rgba(255, 255, 255, 0.05);
  transition: transform .3s;
}
.showcase-phone:nth-child(1) { transform: rotate(-3deg); }
.showcase-phone:nth-child(2) { transform: rotate(3deg); }
.showcase-phone:hover { transform: rotate(0deg) translateY(-6px); }

/* CTA */
.cta {
  padding: 96px 24px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(97, 71, 199, 0.15), transparent 65%);
}
.cta-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 16px 48px rgba(57, 47, 99, 0.4);
  margin: 0 auto 24px;
  display: block;
}
.cta h2 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.15;
}
.cta p {
  color: var(--text-sec);
  font-size: 17px;
  margin: 0 0 32px;
}

.footer {
  padding: 40px 24px 36px;
  color: var(--text-tri);
  font-size: 13px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--bg);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand .brand-icon { width: 36px; height: 36px; border-radius: 9px; }
.footer-brand strong { display: block; color: var(--text); font-size: 14px; }
.footer-brand span { font-size: 12px; color: var(--text-tri); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { transition: color .15s; }
.footer-links a:hover { color: var(--accent); }
.footer-small {
  max-width: 1100px;
  margin: 20px auto 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-tri);
}

/* ─────────────── Modal ─────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn .2s ease;
}
@media (min-width: 680px) {
  .modal { align-items: center; }
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 30, 0.5);
  backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative;
  background: var(--bg-soft);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp .25s ease;
}
@media (min-width: 680px) {
  .modal-panel { border-radius: 24px; }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.modal-close {
  background: transparent;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-tri);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--bg-tinted); color: var(--accent); }
.modal-close svg { width: 20px; height: 20px; }
.modal-body { padding: 24px 22px 26px; overflow-y: auto; }

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-sec);
  margin: 4px 0 12px;
}
.section-label:not(:first-child) { margin-top: 22px; }

.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.preset-btn {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.preset-btn:hover { border-color: var(--accent); }
.preset-btn.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}
.slider-min, .slider-max { font-size: 11px; color: var(--text-tri); }
.slider-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  min-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.hint {
  font-size: 11px;
  color: var(--text-tri);
  margin: 8px 0 0;
  line-height: 1.5;
}

/* Sound list inside modal */
.sound-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.sound-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-radius: 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.sound-item:last-child { border-bottom: 0; }
.sound-item:hover { background: var(--bg-tinted); }
.sound-item.active .sound-check { opacity: 1; }
.sound-name { flex: 1; font-size: 15px; font-weight: 500; }
.sound-check {
  width: 22px; height: 22px;
  color: var(--accent);
  opacity: 0;
  transition: opacity .15s;
}
.sound-check svg { width: 22px; height: 22px; }

/* ─────────────── Overlay (level up / session complete) ─────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 30, 0.92);
  backdrop-filter: blur(10px);
  animation: fadeIn .3s ease;
}
.overlay-inner {
  text-align: center;
  padding: 40px 28px;
  color: #fff;
  max-width: 400px;
  position: relative;
}
.overlay h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 20px 0 6px;
}
.overlay p { margin: 0; line-height: 1.5; }
.confetti-ring, .session-ring {
  width: 120px; height: 120px;
  border-radius: 50%;
  margin: 0 auto;
  background: var(--grad-v);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 0 10px rgba(97, 71, 199, 0.2);
  animation: bounceIn .6s cubic-bezier(.2,1.4,.4,1);
}
.levelup-badge {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}
.session-ring::after {
  content: "";
  width: 48px;
  height: 48px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>") center/contain no-repeat;
}
@keyframes bounceIn {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.levelup-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-2);
  margin: 4px 0 16px;
}
.levelup-sub {
  color: rgba(255,255,255,0.78);
  font-size: 15px;
  margin: 0 0 28px;
}
.session-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.65);
  margin-top: 28px;
}
.session-count {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 18px;
}
.session-message {
  font-style: italic;
  color: rgba(255,255,255,0.75);
  font-size: 17px;
  margin: 0 0 32px;
}

/* ─────────────── Greeting toast ─────────────── */
.greeting-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--grad);
  color: #fff;
  padding: 12px 20px;
  border-radius: 16px;
  font-weight: 500;
  font-size: 15px;
  box-shadow: 0 8px 28px rgba(97, 71, 199, 0.4);
  animation: toastIn .4s cubic-bezier(.2,1.4,.4,1);
}
.greeting-toast.hide { animation: toastOut .3s ease forwards; }
@keyframes toastIn {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translate(-50%, 0); opacity: 1; }
  to   { transform: translate(-50%, -20px); opacity: 0; }
}

/* ─────────────── Goal screen (mirrors iOS GoalView) ─────────────── */
.goal-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background:
    linear-gradient(180deg, rgba(97, 71, 199, 0), rgba(140, 102, 235, 0.1)),
    var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  animation: fadeIn .4s ease;
}
.goal-screen.closing { animation: fadeOut .4s ease forwards; }
@keyframes fadeOut { to { opacity: 0; pointer-events: none; } }

.goal-inner {
  max-width: 440px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.goal-bell {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.goal-bell-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(97, 71, 199, 0.3);
  animation: goalPulse 2.2s ease-out infinite;
}
@keyframes goalPulse {
  0%   { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.2);  opacity: 0; }
}
.goal-bell-glow {
  position: absolute;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: var(--bg-tinted);
}
.goal-bell-icon {
  position: relative;
  width: 64px; height: 64px;
  color: var(--accent);
  fill: var(--accent);
  animation: goalIn .8s .2s ease-out backwards;
}

.goal-eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 20px;
  animation: goalIn .8s .3s ease-out backwards;
}
.goal-message {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 24px;
  padding: 0 20px;
  animation: goalIn .8s .5s ease-out backwards;
}
.goal-divider {
  width: 40px;
  height: 2px;
  border-radius: 1px;
  background: var(--grad);
  margin-bottom: 56px;
  animation: goalIn .8s .7s ease-out backwards;
}
@keyframes goalIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.goal-begin {
  width: 100%;
  max-width: 360px;
  justify-content: center;
  animation: goalIn .8s .9s ease-out backwards;
}

/* ─────────────── Reduced motion ─────────────── */
@media (prefers-reduced-motion: reduce) {
  .ring, .instruction-card, .stats-card, .modal, .modal-panel,
  .overlay, .greeting-toast, .confetti-ring, .session-ring {
    animation: none !important;
  }
}
