:root {
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.86);
  --ink-faint: rgba(255, 255, 255, 0.62);
  --accent: #ffcf6b;        /* warm honey gold */
  --done: #9fe0a6;          /* soft fresh green */
  --plan: #ffc07a;          /* warm amber */
  --card-max: 640px;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #1a1712;
}
body { display: flex; flex-direction: column; height: 100vh; }

/* Background image with a slow ken-burns drift */
.bg {
  position: fixed;
  inset: -2%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: linear-gradient(140deg, #f0c98a 0%, #c98f5a 45%, #6b4f2a 100%);
  transform: scale(1.06);
  transition: opacity 1.1s ease;
  opacity: 0;
  animation: drift 60s ease-in-out infinite alternate;
  will-change: transform;
}
.bg.ready { opacity: 1; }
@keyframes drift {
  from { transform: scale(1.06) translate(0, 0); }
  to   { transform: scale(1.12) translate(-1.5%, -1%); }
}

/* golden shimmer for a rare "bonus" card */
.bg.bonus::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 60% at 30% 45%, rgba(255,214,120,0.28) 0%, rgba(255,214,120,0) 60%);
  animation: shimmer 3.5s ease-in-out infinite alternate;
}
@keyframes shimmer { from { opacity: 0.35; } to { opacity: 0.9; } }

.scrim {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 58% 74% at 24% 50%, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.28) 40%, rgba(0,0,0,0) 70%),
    linear-gradient(90deg, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0) 55%),
    linear-gradient(0deg, rgba(0,0,0,0.14) 0%, rgba(0,0,0,0) 26%);
  pointer-events: none;
}

/* ---------- header ---------- */
.topbar {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 34px;
  z-index: 4;
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.5), 1px -1px 1px rgba(0,0,0,0.5),
    -1px  1px 1px rgba(0,0,0,0.5), 1px  1px 1px rgba(0,0,0,0.5),
     0 1px 6px rgba(0,0,0,0.55);
}
.brand {
  font-size: 14px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 700;
}
.top-right { display: flex; align-items: center; gap: 16px; }
.clock {
  font-size: 15px; color: var(--ink-soft); letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.stats-pill {
  font: inherit; font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(0,0,0,0.32); border: 1px solid rgba(255,255,255,0.28);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background 0.2s ease, transform 0.1s ease;
  text-shadow: none;
}
.stats-pill:hover { background: rgba(0,0,0,0.5); }
.stats-pill:active { transform: scale(0.96); }
.pill-dot { opacity: 0.5; }
.pill-level { color: var(--accent); }

/* adaptive header (light image top) */
body.bg-top-light .topbar {
  text-shadow:
    -1px -1px 1px rgba(255,255,255,0.75), 1px -1px 1px rgba(255,255,255,0.75),
    -1px  1px 1px rgba(255,255,255,0.75), 1px  1px 1px rgba(255,255,255,0.75),
     0 1px 4px rgba(255,255,255,0.6);
}
body.bg-top-light .brand,
body.bg-top-light .clock { color: #1a1712; }
body.bg-top-light .stats-pill {
  background: rgba(255,255,255,0.5); color: #1a1712; border-color: rgba(0,0,0,0.15);
}
body.bg-top-light .pill-level { color: #9a6b12; }

/* ---------- stage / card ---------- */
.stage {
  flex: 1 1 auto; min-height: 0; position: relative; z-index: 2;
  display: flex; align-items: center; overflow: hidden;
  padding: clamp(36px, 6vh, 92px) clamp(28px, 7vw, 110px);
}
.card {
  max-width: var(--card-max);
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.55), 1px -1px 1px rgba(0,0,0,0.55),
    -1px  1px 1px rgba(0,0,0,0.55), 1px  1px 1px rgba(0,0,0,0.55),
     0 2px 8px rgba(0,0,0,0.5);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kicker {
  display: inline-block; margin-bottom: 16px;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  font-weight: 700; color: var(--accent);
}

.quote {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 1.75vw, 26px);
  line-height: 1.4;
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.62), 1px -1px 1px rgba(0,0,0,0.62),
    -1px  1px 1px rgba(0,0,0,0.62), 1px  1px 1px rgba(0,0,0,0.62),
     0 2px 16px rgba(0,0,0,0.55);
}
.quote.q--long  { font-size: clamp(17px, 1.5vw, 22px); line-height: 1.38; }
.quote.q--xlong { font-size: clamp(15px, 1.3vw, 19px); line-height: 1.36; }

.source {
  display: inline; margin-left: 0.5em; font-style: normal;
  font-size: 0.62em; letter-spacing: 0.02em; color: var(--accent);
  font-weight: 600;
}

.divider { width: 64px; height: 2px; background: rgba(255,255,255,0.35); margin: 18px 0; }

.label {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 700; margin-bottom: 6px;
}
.label--do { color: var(--accent); }
.today {
  font-size: clamp(16px, 1.35vw, 20px); line-height: 1.5; color: var(--ink-soft);
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.55), 1px -1px 1px rgba(0,0,0,0.55),
    -1px  1px 1px rgba(0,0,0,0.55), 1px  1px 1px rgba(0,0,0,0.55),
     0 1px 10px rgba(0,0,0,0.5);
  max-width: 54ch;
}

/* intention -> practice nudge */
.nudge {
  margin-top: 14px; font-size: 13px; color: #1a1712; font-weight: 600;
  background: var(--accent); display: inline-block; padding: 7px 13px;
  border-radius: 999px; text-shadow: none;
  animation: rise 0.5s ease both;
}

/* toggles */
.toggles { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.toggle {
  font: inherit; font-size: 13.5px; font-weight: 600; color: #fff;
  background: rgba(0,0,0,0.34); border: 1px solid rgba(255,255,255,0.32);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.18s ease, transform 0.1s ease, color 0.18s ease, border-color 0.18s ease;
  text-shadow: none;
}
.toggle:hover { background: rgba(0,0,0,0.5); }
.toggle:active { transform: scale(0.96); }
.toggle-ico { font-size: 15px; line-height: 1; }
.toggle--done[aria-pressed="true"] {
  background: var(--done); color: #123016; border-color: var(--done); font-weight: 700;
}
.toggle--plan[aria-pressed="true"] {
  background: var(--plan); color: #3a2408; border-color: var(--plan); font-weight: 700;
}

/* ---------- footer ---------- */
.footer {
  flex: 0 0 auto; position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 34px;
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.5), 1px -1px 1px rgba(0,0,0,0.5),
    -1px  1px 1px rgba(0,0,0,0.5), 1px  1px 1px rgba(0,0,0,0.5),
     0 1px 6px rgba(0,0,0,0.55);
}
.foot-left { display: flex; gap: 18px; }
.mini-score { font-size: 13px; color: var(--ink-soft); letter-spacing: 0.02em; }
.mini-score b, .mini-score span { font-variant-numeric: tabular-nums; }
.mini-ico { margin-right: 4px; }
.foot-right { display: flex; align-items: center; gap: 16px; }
.another {
  font: inherit; font-size: 13px; color: #fff; background: rgba(0,0,0,0.34);
  border: 1px solid rgba(255,255,255,0.3);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.another:hover { background: rgba(0,0,0,0.5); }
.another:active { transform: scale(0.96); }
.counter { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.05em; }

body.bg-top-light .footer {
  text-shadow:
    -1px -1px 1px rgba(255,255,255,0.7), 1px -1px 1px rgba(255,255,255,0.7),
    -1px  1px 1px rgba(255,255,255,0.7), 1px  1px 1px rgba(255,255,255,0.7),
     0 1px 4px rgba(255,255,255,0.6);
}
body.bg-top-light .mini-score,
body.bg-top-light .counter { color: #2b2318; }

/* ---------- Your Gratitude panel ---------- */
.panel-scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,0.5); }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 21;
  width: min(410px, 92vw); background: #fdf7ec; color: #2b2318;
  box-shadow: -14px 0 50px rgba(0,0,0,0.4); overflow-y: auto;
  padding: 24px 26px 32px; text-shadow: none;
  animation: slidein 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel-head h2 { font-size: 21px; color: #3a2c17; }
.panel-x {
  font: inherit; font-size: 15px; color: #6b4f2a; background: #f0e7d5;
  border: none; border-radius: 999px; width: 34px; height: 34px; cursor: pointer;
}
.panel-x:hover { background: #e7dcc6; }

.level-box { background: #fff; border: 1px solid #ece0c6; border-radius: 16px; padding: 16px 18px; margin-bottom: 18px; }
.level-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.level-name { font-size: 19px; font-weight: 800; color: #b5811f; }
.level-num { font-size: 12px; color: #a08a63; font-weight: 700; letter-spacing: 0.04em; }
.level-bar { height: 10px; background: #f0e7d5; border-radius: 999px; overflow: hidden; }
.level-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #ffcf6b, #f7a072); border-radius: 999px; transition: width 0.6s cubic-bezier(0.16,1,0.3,1); }
.level-hint { font-size: 12px; color: #8a7a5c; margin-top: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid #ece0c6; border-radius: 14px; padding: 12px 6px; text-align: center; }
.stat-big { font-size: 26px; font-weight: 800; color: #3a2c17; font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 10.5px; color: #a08a63; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.25; margin-top: 3px; }

.panel-rows { background: #fff; border: 1px solid #ece0c6; border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.prow { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: 14px; color: #5c4d33; border-bottom: 1px solid #f4ecda; }
.prow:last-child { border-bottom: none; }
.prow b { color: #3a2c17; }

.plan-list-wrap { margin-bottom: 18px; }
.plan-list-head { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: #a08a63; font-weight: 700; margin-bottom: 8px; }
.plan-list { list-style: none; }
.plan-list li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #ece0c6; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; color: #4a3d28; }
.plan-list li .pl-title { flex: 1; }
.plan-list li .pl-do { font: inherit; font-size: 12px; font-weight: 700; color: #123016; background: var(--done); border: none; border-radius: 999px; padding: 6px 12px; cursor: pointer; }

.panel-note { font-size: 12px; color: #a08a63; margin-bottom: 14px; line-height: 1.5; }
.panel-reset { font: inherit; font-size: 13px; color: #a05a3a; background: #fbeee7; border: 1px solid #f0d6c8; border-radius: 10px; padding: 10px 16px; cursor: pointer; }
.panel-reset:hover { background: #f6e0d5; }

/* ---------- toast + burst ---------- */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(10px);
  z-index: 30; background: rgba(26,23,18,0.94); color: #fff;
  padding: 13px 22px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35); text-shadow: none;
  opacity: 0; transition: opacity 0.35s ease, transform 0.35s ease;
  border: 1px solid rgba(255,207,107,0.4); max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .toast-em { color: var(--accent); }

.burst { position: fixed; inset: 0; z-index: 29; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; width: 9px; height: 14px; border-radius: 2px; top: -20px; will-change: transform; }

/* ---------- home page prompt (web only) ---------- */
.hp-prompt { position: fixed; left: 22px; bottom: 20px; z-index: 16; display: flex; align-items: center; gap: 6px; animation: rise 0.6s ease both; }
.hp-open { font: inherit; font-size: 13px; font-weight: 600; color: #1a1712; background: var(--accent); border: none; border-radius: 999px; padding: 10px 16px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.35); }
.hp-open:hover { filter: brightness(1.05); }
.hp-x { font: inherit; font-size: 13px; color: #fff; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.3); border-radius: 999px; width: 30px; height: 30px; cursor: pointer; }
.hp-x:hover { background: rgba(0,0,0,0.6); }
.hp-modal { position: fixed; inset: 0; z-index: 22; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.hp-card { background: #fdf7ec; color: #2b2318; border-radius: 18px; padding: 28px 30px; max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.4); text-align: left; text-shadow: none; }
.hp-card h2 { font-size: 20px; margin: 0 0 10px; color: #3a2c17; }
.hp-card p { font-size: 15px; line-height: 1.55; margin: 0 0 14px; }
.hp-url { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e7dcc6; border-radius: 10px; padding: 8px 8px 8px 14px; margin-bottom: 14px; }
#hp-url-text { flex: 1; font-family: Menlo, Consolas, monospace; font-size: 14px; color: #3a2c17; }
#hp-copy { font: inherit; font-size: 13px; font-weight: 600; color: #1a1712; background: var(--accent); border: none; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.hp-steps { font-size: 14px; color: #5c4d33; }
.hp-actions { display: flex; gap: 10px; margin-top: 8px; }
.hp-primary { font: inherit; font-size: 14px; font-weight: 600; color: #fff; background: #6b4f2a; border: none; border-radius: 10px; padding: 11px 16px; cursor: pointer; }
.hp-secondary { font: inherit; font-size: 14px; color: #6b4f2a; background: transparent; border: 1px solid #d8c7a4; border-radius: 10px; padding: 11px 16px; cursor: pointer; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .topbar { padding: 14px 18px; }
  .top-right { gap: 10px; }
  .clock { display: none; }
  .stage { padding: 30px 20px; }
  .footer { padding: 12px 18px; flex-wrap: wrap; gap: 10px; }
  .foot-left { gap: 14px; }
  .another { font-size: 15px; padding: 11px 18px; }
  .brand { font-size: 12px; letter-spacing: 0.14em; }
  .toggle { font-size: 13px; padding: 11px 15px; }
  .hp-prompt { left: 12px; right: 12px; bottom: 74px; justify-content: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
