/* Morning Fill-Up Show — v1 styles. Mobile-first, navy + gold. */

:root {
  --navy: #0b1b33;
  --navy-2: #0e2240;
  --card: #13294d;
  --card-2: #1a3463;
  --gold: #d4a017;
  --gold-2: #f2c230;
  --text: #f4f6fb;
  --muted: #9fb0cc;
  --line: rgba(212, 160, 23, 0.25);
  --radius: 16px;
  --tabbar-h: 68px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; width: 100%; max-width: 100%; overflow-x: hidden; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  background: radial-gradient(120% 60% at 50% -10%, #16305c 0%, var(--navy) 55%) fixed, var(--navy);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

img, video, iframe { max-width: 100%; }

/* ---------- Header / wordmark ---------- */
.app-header {
  padding: 22px 16px 6px;
  text-align: center;
}
.wordmark { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wordmark-top {
  font-size: 11px; letter-spacing: 6px; color: var(--muted); font-weight: 600;
}
.wordmark-main {
  font-size: 34px; font-weight: 800; letter-spacing: 1px; line-height: 1.05;
}
.wordmark-main .gold, .gold { color: var(--gold-2); }
.wordmark-host { font-size: 13px; color: var(--muted); font-style: italic; }

/* ---------- Screens ---------- */
.screen { display: none; animation: fade .25s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--navy-2) 100%);
  border: 1px solid rgba(212, 160, 23, 0.18);
  border-radius: var(--radius);
  padding: 18px;
  margin: 12px 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.card h2 { margin: 6px 0 8px; font-size: 21px; }
.eyebrow {
  margin: 0; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--gold-2); font-weight: 700;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }

.live-card { border-color: var(--gold); }
.next-show-line { text-align: center; color: var(--muted); font-size: 13px; margin: 2px 4px 14px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #a4161a; color: #fff; font-weight: 800; font-size: 12px;
  letter-spacing: 1.5px; padding: 6px 12px; border-radius: 999px; margin-bottom: 10px;
}
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.ritual-card .quote { font-size: 17px; line-height: 1.55; font-style: italic; margin: 4px 0; }
.chip-card .big-line { font-size: 19px; font-weight: 700; line-height: 1.45; margin: 8px 0 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; border: none; border-radius: 12px;
  padding: 13px 20px; font-size: 16px; font-weight: 700; cursor: pointer;
  text-decoration: none; text-align: center;
}
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1a1206; }
.btn-gold:active { transform: scale(0.98); }
.btn-big { display: block; width: 100%; font-size: 17px; }
.btn-outline {
  background: transparent; color: var(--gold-2);
  border: 1.5px solid var(--gold);
}

/* ---------- Check-in form ---------- */
.field-label { display: block; font-size: 14px; font-weight: 700; margin: 18px 0 8px; color: var(--text); }

.slider { width: 100%; appearance: none; -webkit-appearance: none; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold) var(--fill, 66%), #2a3f66 var(--fill, 66%)); outline: none; }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-2); border: 3px solid #0b1b33; box-shadow: 0 2px 8px rgba(0,0,0,.5); cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold-2); border: 3px solid #0b1b33; cursor: pointer;
}

.streak-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.streak-num { font-size: 34px; font-weight: 800; margin: 0; }
.pill {
  font-size: 12px; font-weight: 700; color: #0b1b33; background: var(--gold-2);
  padding: 6px 12px; border-radius: 999px;
}
.hidden { display: none !important; }

.seg { display: flex; background: #0a1729; border-radius: 12px; padding: 4px; gap: 4px; }
.seg-btn {
  flex: 1; border: none; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 700; padding: 11px 6px; border-radius: 9px; cursor: pointer;
}
.seg-btn.on { background: var(--gold); color: #1a1206; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1.5px solid var(--line); background: transparent; color: var(--text);
  border-radius: 999px; padding: 9px 15px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.chips button.on { background: var(--gold); border-color: var(--gold); color: #1a1206; }

textarea, input[type="date"], input[type="email"], input[type="text"], select {
  width: 100%; background: #0a1729; border: 1.5px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 12px; font-size: 15px; font-family: inherit;
}
textarea:focus, input[type="date"]:focus, input[type="email"]:focus, input[type="text"]:focus, select:focus { outline: none; border-color: var(--gold); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.switch {
  flex: none; width: 54px; height: 31px; border-radius: 999px; border: none; cursor: pointer;
  background: #2a3f66; position: relative; transition: background .2s; padding: 0;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 25px; height: 25px; border-radius: 50%;
  background: #fff; transition: left .2s;
}
.switch[aria-checked="true"] { background: var(--gold); }
.switch[aria-checked="true"] .knob { left: 26px; }

/* ---------- Episodes ---------- */
.episode {
  display: flex; gap: 12px; align-items: center;
  background: linear-gradient(180deg, var(--card) 0%, var(--navy-2) 100%);
  border: 1px solid rgba(212, 160, 23, 0.18); border-radius: var(--radius);
  padding: 12px; margin: 10px 14px; cursor: pointer;
}
.episode:active { transform: scale(0.99); }
.ep-thumb {
  flex: none; width: 76px; height: 76px; border-radius: 12px;
  background: linear-gradient(135deg, #1a3463, #0b1b33);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.ep-thumb svg { width: 30px; height: 30px; fill: var(--gold-2); }
.ep-thumb-play svg { width: 44px; height: 44px; }
.ep-thumb .play-circle { fill: var(--gold-2); }
.ep-thumb .play-tri { fill: #0b1b33; }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; }
/* Featured episode card thumbnail (Home tab) */
.featured-thumb { margin: 10px 0 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.featured-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.season-head {
  margin: 18px 14px 2px; font-size: 13px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold-2);
}
.ep-title { margin: 0 0 3px; font-size: 15.5px; font-weight: 700; }
.ep-sub { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------- Dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat {
  background: #0a1729; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 10px; text-align: center;
}
.stat-num { display: block; font-size: 30px; font-weight: 800; }
.stat-label { font-size: 11.5px; color: var(--muted); letter-spacing: .5px; }

.week-dots { display: flex; gap: 8px; margin-top: 10px; }
.day-dot { flex: 1; text-align: center; }
.day-dot .dot {
  width: 100%; aspect-ratio: 1; max-width: 44px; margin: 0 auto; border-radius: 50%;
  background: #0a1729; border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.day-dot.hit .dot { background: var(--gold); border-color: var(--gold); color: #1a1206; }
.day-dot.today .dot { border-color: var(--gold-2); border-style: dashed; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(8, 18, 36, 0.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  display: flex; max-width: 520px; margin: 0 auto; z-index: 50;
}
.tabbar button {
  flex: 1; min-width: 0; background: none; border: none; cursor: pointer; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; font-weight: 600; font-family: inherit;
}
.tabbar button span { white-space: nowrap; }
.tabbar button svg { width: 22px; height: 22px; fill: currentColor; }
.tabbar button svg.stroke-icon { fill: none; stroke: currentColor; }
.tabbar button.active { color: var(--gold-2); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px);
  background: var(--gold-2); color: #1a1206; font-weight: 700; font-size: 14px;
  padding: 12px 20px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 99; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- in-app video player ---------------- */
.player-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 12, 26, .97);
  display: flex; flex-direction: column;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 14px 34px;
}
.player-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.player-head h3 { margin: 2px 0 0; font-size: 1.05rem; color: #fff; }
.player-close {
  background: none; border: 1px solid rgba(255, 255, 255, .3); color: #fff;
  width: 48px; height: 48px; min-width: 48px; min-height: 48px; border-radius: 50%; font-size: 1.6rem; line-height: 1;
  flex-shrink: 0; margin: 6px; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.player-back {
  margin: 14px auto 0; padding: 12px 22px; min-height: 48px;
  background: none; border: 1px solid #d4af5f; color: #d4af5f; border-radius: 999px;
  font-size: 1rem; font-weight: 600;
}
#player-video { width: 100%; border-radius: 12px; background: #000; max-height: 62vh; }

/* ---------------- encouragement player (v25) ---------------- */
.encourage-frame-wrap {
  position: relative; width: 100%; padding-top: 56.25%;
  border-radius: 12px; overflow: hidden; background: #000;
}
.encourage-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------------- music player (v26) ---------------- */
.music-player {
  position: fixed; left: 12px; right: 12px; max-width: 496px; margin: 0 auto;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 55; display: flex; align-items: center; gap: 10px;
  background: rgba(11, 27, 51, .97); color: #fff;
  border: 1px solid rgba(212, 175, 55, .55); border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.mp-btn {
  background: none; border: none; color: var(--gold-2); cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%; flex: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.mp-btn svg { width: 22px; height: 22px; fill: currentColor; }
.mp-btn svg.stroke-icon { fill: none; stroke: currentColor; }
.mp-play {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1a1206;
  width: 46px; height: 46px;
}
.mp-play svg { width: 24px; height: 24px; }
.mp-main { flex: 1; min-width: 0; }
.mp-title {
  margin: 0 0 6px; font-size: .85rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-progress {
  height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .15); cursor: pointer;
}
.mp-progress-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}
.episode.playing .ep-title { color: var(--gold-2); }

/* ---------------- VIP paywall ---------------- */
.vip-badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .06em;
  color: #1a1206; background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 2px;
}
.vip-card {
  background: #fff; color: #1a1206; border-radius: 16px;
  padding: 22px 18px; margin-top: 6px;
}
.vip-pitch { font-size: 1.05rem; margin: 0 0 12px; }
.vip-list { margin: 0 0 18px 18px; padding: 0; font-size: .95rem; }
.vip-list li { margin-bottom: 8px; }
.vip-join { text-decoration: none; margin-bottom: 4px; }
.vip-unlock {
  display: block; width: 100%; background: none; border: none;
  color: #0b1b33; font-size: .9rem; text-decoration: underline;
  margin-top: 10px; padding: 8px;
}
.vip-verify { margin-top: 14px; border-top: 1px solid rgba(11,27,51,.15); padding-top: 14px; }
.vip-verify-label { font-size: .9rem; margin: 0 0 8px; font-weight: 600; }
#vip-email {
  width: 100%; box-sizing: border-box; font-size: 1rem; padding: 10px 12px;
  border: 1px solid rgba(11,27,51,.3); border-radius: 8px; margin-bottom: 10px;
}
#vip-verify { width: 100%; }
.vip-msg { font-size: .88rem; margin: 10px 0 0; min-height: 1.2em; }

/* ---------- iPhone install banner (v10) ---------- */
#install-banner {
  position: fixed; left: 12px; right: 12px; max-width: 496px; margin: 0 auto;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 60; display: flex; align-items: center; gap: 10px;
  background: #0b1b33; color: #fff;
  border: 1px solid rgba(212, 175, 55, .55); border-radius: 14px;
  padding: 12px 10px 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
#install-banner .ib-text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
#install-banner .ib-text strong { color: var(--gold-2); font-size: 14px; }
#install-banner .ib-close {
  background: none; border: none; color: #fff; opacity: .8;
  font-size: 24px; line-height: 1; padding: 4px 8px; cursor: pointer;
}

/* Goal photo upload (v13) */
.goal-photo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 4px; }
.photo-btn {
  display: inline-block; background: var(--gold); color: var(--navy);
  font-weight: 700; padding: 10px 18px; border-radius: 12px; cursor: pointer;
}
.photo-btn:active { transform: scale(.97); }
#goalphoto-preview {
  width: 112px; height: 112px; object-fit: cover; border-radius: 12px;
  border: 2px solid var(--gold);
}

/* ---------------- Question of the Day (v16) ---------------- */
.qotd-streak {
  text-align: center;
  font-weight: 800;
  font-size: 17px;
  color: var(--gold-2);
  margin: 2px 0 10px;
}
.qotd-card { border-color: var(--gold); }
.qotd-q { font-size: 18px; line-height: 1.45; margin: 8px 0 14px; }
.qotd-opts { display: flex; flex-direction: column; gap: 10px; }
.qotd-opt {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  font-size: 16px;
  min-height: 52px;
  white-space: normal;
  line-height: 1.4;
}
.qotd-verdict { font-weight: 800; font-size: 17px; margin: 10px 0 6px; }
.qotd-verdict.good { color: var(--gold-2); }
.qotd-take {
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  border-left: 3px solid var(--gold);
  padding: 10px 12px;
  margin: 8px 0 14px;
  background: rgba(212, 160, 23, 0.08);
  border-radius: 0 8px 8px 0;
}
.qotd-bars { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 6px; }
.qotd-bar-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.qotd-bar-label {
  flex: 0 0 38%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted);
}
.qotd-bar { flex: 1; height: 10px; background: rgba(255, 255, 255, 0.12); border-radius: 6px; overflow: hidden; }
.qotd-bar span { display: block; height: 100%; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-radius: 6px; }
.qotd-pct { flex: 0 0 44px; text-align: right; font-weight: 700; }
.qotd-linewrap { margin-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 14px; }
.qotd-line-label { font-weight: 700; font-size: 16px; margin: 0 0 8px; }
.qotd-linewrap textarea {
  width: 100%;
  background: var(--navy-2); color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 10px;
  padding: 12px; font-size: 16px; font-family: inherit; resize: vertical;
}
.qotd-line-actions { display: flex; gap: 10px; margin-top: 10px; }
.qotd-done { font-size: 17px; font-weight: 700; text-align: center; padding: 18px 0 6px; }

/* ---------------- Achievement modal (v16) ---------------- */
.achv-overlay { justify-content: center; align-items: center; }
.achv-box {
  background: linear-gradient(180deg, var(--card) 0%, var(--navy) 100%);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 28px 24px;
  margin: 0 24px;
  text-align: center;
  max-width: 380px;
  width: 100%;
}
.achv-box .eyebrow { margin-top: 0; }
.achv-badge { font-size: 64px; margin: 6px 0; }
.achv-box h2 { color: var(--gold-2); margin: 6px 0 8px; font-size: 24px; }
.achv-box .btn { width: 100%; margin-top: 12px; }

/* v23: recovery code display */
.code-big {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
  color: var(--gold-2);
  background: #0a1729;
  border: 1.5px dashed var(--gold);
  border-radius: 12px;
  padding: 14px 8px;
  margin: 6px 0 4px;
}
.divider {
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

/* ---------- Streak leaderboard (v27) ---------- */
.board-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.board-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
}
.board-row.first {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-color: transparent; color: #101c33;
}
.board-row.first .board-days { color: #101c33; }
.board-rank { font-size: 17px; font-weight: 800; width: 30px; text-align: center; color: var(--gold-2); }
.board-row.first .board-rank { color: #101c33; }
.board-name { flex: 1; font-weight: 700; font-size: 15px; }
.board-days { font-weight: 800; font-size: 14px; color: var(--gold-2); }
.board-empty {
  border: 1px dashed var(--line); border-radius: 12px;
  padding: 14px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.5;
}
.board-empty strong { color: var(--gold-2); }
.board-updated { font-size: 11px; color: var(--muted); text-align: center; margin-top: 10px; }
