/* Assured 心安 — senior-friendly, Chinese-first, high contrast, big targets */
:root {
  --bg: #0e2a30;          /* deep calm teal */
  --bg2: #123840;
  --card: #1a4750;
  --card2: #21555f;
  --ink: #fdf6e3;         /* warm cream text */
  --ink-dim: #cfd8cf;
  --accent: #ffd97a;      /* warm gold */
  --accent2: #8fd0c2;
  --reader-size: 26px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 20px; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: 110px; /* room for bottom nav */
  line-height: 1.6;
}

/* ---------- header ---------- */
.topbar { text-align: center; padding: 26px 16px 10px; }
.brand { font-size: 3rem; font-weight: 700; letter-spacing: 0.35em; text-indent: 0.35em; color: var(--ink); }
.brand-line { font-size: 1.05rem; color: var(--accent); margin-top: 2px; letter-spacing: 0.06em; }
.tagline { font-size: 1.1rem; color: var(--ink-dim); margin-top: 6px; }
.tagline span { display: block; font-size: 0.85rem; opacity: 0.85; }

/* ---------- layout / views ---------- */
main { max-width: 720px; margin: 0 auto; padding: 10px 16px 20px; }
.view { display: none; }
.view.active { display: block; }
h2 { font-size: 1.7rem; text-align: center; margin: 12px 0 18px; font-weight: 700; }
h2 span { display: block; font-size: 0.95rem; color: var(--ink-dim); font-weight: 400; }
h3 { font-size: 1.5rem; margin: 10px 0 2px; }
.hidden { display: none !important; }

/* ---------- home ---------- */
.date-line { text-align: center; font-size: 1.25rem; color: var(--accent2); margin: 6px 0 16px; }
.quote-card {
  background: var(--card); border-radius: 20px; padding: 26px 22px; text-align: center;
  border: 2px solid rgba(255,217,122,0.35);
}
.card-label { color: var(--accent); font-size: 1.05rem; margin-bottom: 12px; }
.card-label span { font-size: 0.85rem; color: var(--ink-dim); margin-left: 6px; }
.quote-zh { font-size: 1.6rem; line-height: 1.7; font-weight: 600; }
.quote-en { font-size: 1rem; color: var(--ink-dim); margin-top: 12px; font-style: italic; }
.quote-src { font-size: 0.9rem; color: var(--accent2); margin-top: 8px; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.big-nav-card {
  background: var(--card2); color: var(--ink); border: none; border-radius: 18px;
  font-size: 1.35rem; padding: 24px 10px; cursor: pointer; min-height: 104px;
  font-family: inherit; font-weight: 600;
}
.big-nav-card span { display: block; font-size: 0.9rem; color: var(--ink-dim); font-weight: 400; margin-top: 4px; }
.big-nav-card:active { background: var(--accent); color: #14333a; }
.home-note { text-align: center; margin-top: 22px; font-size: 1.1rem; color: var(--ink-dim); }
.home-note span { font-size: 0.9rem; }

/* ---------- choice buttons ---------- */
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; }
.choice-btn {
  background: var(--card); color: var(--ink); border: 3px solid transparent; border-radius: 14px;
  font-size: 1.15rem; padding: 14px 18px; cursor: pointer; min-height: 64px; font-family: inherit; font-weight: 600;
}
.choice-btn span { display: block; font-size: 0.8rem; color: var(--ink-dim); font-weight: 400; }
.choice-btn.selected { border-color: var(--accent); background: var(--card2); }

/* ---------- breathing ---------- */
.breath-stage { display: flex; justify-content: center; padding: 26px 0 10px; }
.breath-circle {
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #3f7d8c, #1d4a56);
  border: 4px solid var(--accent2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: scale(1); will-change: transform;
}
.breath-phase { font-size: 2.2rem; font-weight: 700; color: var(--ink); }
.breath-count { font-size: 1.1rem; color: var(--accent); margin-top: 4px; }
.status-line { text-align: center; font-size: 1.15rem; margin: 10px 0 4px; }
.status-en { display: block; font-size: 0.85rem; color: var(--ink-dim); }
.hint { text-align: center; color: var(--ink-dim); font-size: 1rem; margin-top: 16px; }
.hint span { display: block; font-size: 0.85rem; }

/* ---------- controls ---------- */
.control-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 16px; }
.primary-btn, .secondary-btn {
  border-radius: 14px; font-family: inherit; cursor: pointer; font-weight: 700;
  min-height: 64px; padding: 14px 26px;
}
.primary-btn { background: var(--accent); color: #14333a; border: none; font-size: 1.3rem; }
.primary-btn span { font-size: 0.9rem; font-weight: 400; margin-left: 4px; }
.secondary-btn { background: transparent; color: var(--ink); border: 3px solid var(--accent2); font-size: 1.1rem; }
.secondary-btn span { font-size: 0.85rem; font-weight: 400; margin-left: 4px; }

/* ---------- meditation ---------- */
.med-timer { font-size: 4.2rem; text-align: center; font-weight: 700; letter-spacing: 0.05em; margin: 14px 0 2px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- story / guided cards ---------- */
.card-list { display: flex; flex-direction: column; gap: 14px; }
.item-card {
  background: var(--card); border-radius: 18px; padding: 22px; text-align: left; width: 100%;
  border: 2px solid rgba(143,208,194,0.3); color: var(--ink); cursor: pointer; font-family: inherit;
}
.item-card .item-title { font-size: 1.45rem; font-weight: 700; }
.item-card .item-en { font-size: 1rem; color: var(--accent); display: block; margin-top: 2px; }
.item-card .item-desc { font-size: 1rem; color: var(--ink-dim); display: block; margin-top: 8px; }

/* ---------- reader ---------- */
.reader { margin-top: 8px; }
.back-btn { margin-bottom: 14px; }
.reader-en { color: var(--accent); font-size: 1.05rem; margin-bottom: 10px; }
.font-controls { display: flex; align-items: center; gap: 10px; margin: 12px 0 18px; flex-wrap: wrap; font-size: 1.05rem; }
.font-controls span span { font-size: 0.85rem; color: var(--ink-dim); }
.font-btn {
  background: var(--card2); color: var(--ink); border: 2px solid var(--accent2); border-radius: 10px;
  font-size: 1.05rem; padding: 10px 18px; min-height: 52px; cursor: pointer; font-family: inherit; font-weight: 600;
}
.reader-body { font-size: var(--reader-size); line-height: 1.95; }
.reader-body p { margin-bottom: 1em; }
.reader-end { text-align: center; color: var(--ink-dim); margin-top: 24px; font-size: 1.1rem; }
.reader-end span { display: block; font-size: 0.9rem; }
.audio-box { background: var(--card); border-radius: 16px; padding: 18px; text-align: center; margin: 8px 0 6px; }
.audio-box .hint { margin-top: 10px; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: #0a2127; border-top: 2px solid rgba(143,208,194,0.4);
  display: flex; justify-content: space-around; padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav-btn {
  background: none; border: none; color: var(--ink-dim); cursor: pointer; font-family: inherit;
  font-size: 1.45rem; padding: 8px 6px; min-width: 62px; min-height: 62px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.nav-btn .nav-zh { font-size: 1rem; font-weight: 600; }
.nav-btn .nav-en { font-size: 0.7rem; }
.nav-btn.selected { color: var(--accent); background: rgba(255,217,122,0.12); }

@media (max-width: 420px) {
  .brand { font-size: 2.5rem; }
  .breath-circle { width: 210px; height: 210px; }
  .med-timer { font-size: 3.4rem; }
  .home-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- 佳悅堂 brand mark ---------- */
.brand-house {
  font-size: 1.5rem; font-weight: 700; color: var(--accent);
  letter-spacing: 0.5em; text-indent: 0.5em; margin-bottom: 2px;
}

/* ---------- group labels ---------- */
.group-label { text-align: center; font-size: 1.15rem; font-weight: 600; margin: 20px 0 10px; color: var(--accent2); }
.group-label span { font-size: 0.85rem; color: var(--ink-dim); font-weight: 400; margin-left: 6px; }

/* ---------- background sounds ---------- */
.sound-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.sound-btn {
  background: var(--card); color: var(--ink); border: 3px solid rgba(143,208,194,0.3); border-radius: 18px;
  font-size: 1.3rem; padding: 22px 10px; cursor: pointer; min-height: 96px; font-family: inherit; font-weight: 600;
}
.sound-btn span { display: block; font-size: 0.9rem; color: var(--ink-dim); font-weight: 400; margin-top: 4px; }
.sound-btn.playing { border-color: var(--accent); background: var(--card2); }
.volume-row { display: flex; align-items: center; gap: 14px; margin: 22px 4px 4px; }
.volume-label { font-size: 1.15rem; font-weight: 600; white-space: nowrap; }
.volume-label span { font-size: 0.85rem; color: var(--ink-dim); font-weight: 400; }
.volume-row input[type="range"] { flex: 1; height: 44px; accent-color: var(--accent); cursor: pointer; }

/* ---------- six-item bottom nav ---------- */
.nav-btn { min-width: 52px; }
@media (max-width: 420px) {
  .nav-btn { min-width: 46px; font-size: 1.25rem; padding: 8px 2px; }
  .nav-btn .nav-zh { font-size: 0.9rem; }
  .sound-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- scrollable bottom nav (9 sections) ---------- */
.bottom-nav { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
.bottom-nav::-webkit-scrollbar { display: none; }
.nav-btn { flex: 0 0 auto; }

/* ---------- music ---------- */
.mood-btn.playing { border-color: var(--accent); background: var(--card2); }

/* ---------- games ---------- */
.game-block { margin-bottom: 34px; }
.game-title { font-size: 1.4rem; margin-bottom: 4px; }
.game-title span { font-size: 0.95rem; color: var(--ink-dim); font-weight: 400; }
#sand-canvas {
  width: 100%; height: auto; display: block; border-radius: 16px;
  border: 3px solid #8a6d3b; touch-action: none; cursor: crosshair; background: #e9dcbc;
}
#bubble-field {
  position: relative; height: 360px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #17434e 0%, #0f3038 100%);
  border: 2px solid rgba(143,208,194,0.35);
}
.bubble {
  position: absolute; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,0.85), rgba(160,220,235,0.25) 55%, rgba(120,190,215,0.35));
  border: 2px solid rgba(255,255,255,0.5);
  will-change: transform, opacity;
}

/* ---------- recipes ---------- */
.recipe-section-title { font-size: 1.25em; font-weight: 700; color: var(--accent); margin: 0.9em 0 0.3em; }
.reader-body ul, .reader-body ol { margin: 0 0 1em 1.2em; }
.reader-body li { margin-bottom: 0.35em; }
.benefit-box {
  background: var(--card); border-left: 6px solid var(--accent); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 1em; font-size: 0.92em;
}

/* ---------- home heroes / daily / call strip ---------- */
.daily-card {
  background: var(--card); border-radius: 20px; padding: 24px 22px; text-align: center;
  border: 2px solid rgba(143,208,194,0.45); margin-top: 16px;
}
.daily-title { font-size: 1.55rem; font-weight: 700; }
.daily-en { color: var(--accent); font-size: 1rem; margin-top: 2px; }
.daily-desc { color: var(--ink-dim); font-size: 1.05rem; margin: 10px 0 16px; }
.daily-note { color: var(--ink-dim); font-size: 0.95rem; margin-top: 14px; }
.daily-note span { display: block; font-size: 0.82rem; }
.hero-row { display: flex; gap: 16px; margin-top: 18px; align-items: stretch; }
.hero-bubble {
  flex: 0 0 158px; width: 158px; height: 158px; border-radius: 50%; align-self: center;
  background: radial-gradient(circle at 50% 38%, #3f7d8c, #1d4a56);
  border: 4px solid var(--accent); color: var(--ink); cursor: pointer;
  font-family: inherit; font-size: 1.7rem; font-weight: 700; line-height: 1.3;
}
.hero-bubble span { display: block; font-size: 0.85rem; font-weight: 400; color: var(--accent); margin-top: 4px; }
.hero-bubble:active { transform: scale(0.96); }
.hero-calm { flex: 1; background: var(--card); border-radius: 20px; padding: 20px; border: 2px solid rgba(255,217,122,0.35); }
.hero-calm-title { font-size: 1.45rem; font-weight: 700; }
.hero-calm-title span { font-size: 0.9rem; color: var(--ink-dim); font-weight: 400; margin-left: 6px; }
.hero-calm-desc { color: var(--ink-dim); font-size: 1.05rem; margin: 8px 0 14px; }
.proto-note { color: var(--accent2); font-size: 0.9rem; margin-top: 10px; text-align: center; }
.proto-note span { display: block; font-size: 0.78rem; opacity: 0.85; }
.emergency-line { font-size: 1rem; margin-top: 10px; color: var(--ink); }
.emergency-line strong { color: var(--accent); }
.emergency-line span { display: block; font-size: 0.82rem; color: var(--ink-dim); }
.call-strip {
  display: block; margin-top: 18px; background: var(--accent); color: #14333a; text-decoration: none;
  border-radius: 18px; padding: 20px; text-align: center; font-size: 1.5rem; font-weight: 700;
}
.call-strip .call-num { letter-spacing: 0.04em; }
.call-strip .call-en { display: block; font-size: 0.9rem; font-weight: 400; margin-top: 4px; }
.home-group { margin-top: 26px; }
.quiet-card { opacity: 0.92; }
.disclaimer-box {
  margin-top: 26px; background: rgba(10,33,39,0.65); border: 2px solid rgba(207,216,207,0.35);
  border-radius: 16px; padding: 18px 20px; font-size: 1.02rem;
}
.disclaimer-en { color: var(--ink-dim); font-size: 0.88rem; margin-top: 8px; }

/* ---------- mixer ---------- */
#mix-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.mix-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px; padding: 10px 14px; }
.mix-name { font-size: 1.1rem; font-weight: 600; white-space: nowrap; }
.mix-name span { font-size: 0.8rem; color: var(--ink-dim); font-weight: 400; }
.mix-row input[type="range"] { flex: 1; height: 40px; accent-color: var(--accent); cursor: pointer; }
.mix-off {
  background: transparent; color: var(--ink); border: 2px solid var(--accent2); border-radius: 10px;
  font-size: 1rem; padding: 8px 12px; min-height: 48px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.item-scene { display: block; color: var(--accent2); font-size: 0.95rem; margin-top: 2px; }

/* ---------- sleep + guide ---------- */
.sleep-goal { font-size: 1.3rem; font-weight: 700; margin: 22px 0 10px; color: var(--accent); }
.sleep-goal span { font-size: 0.9rem; color: var(--ink-dim); font-weight: 400; margin-left: 6px; }
.guide-block { background: var(--card); border-radius: 18px; padding: 22px; margin-bottom: 18px; }
.guide-sub { font-size: 1.15rem; font-weight: 700; margin: 14px 0 6px; color: var(--accent2); }
.guide-steps { margin: 0 0 8px 1.3em; font-size: 1.12rem; line-height: 1.8; }
.guide-steps li { margin-bottom: 6px; }

@media (max-width: 480px) {
  .hero-row { flex-direction: column; align-items: center; }
  .hero-calm { width: 100%; }
}
