<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Daily Motivational Quotes App – Boost Positivity | Lumemeduck</title>
  <meta name="title" content="Daily Motivational Quotes App – Boost Positivity | Lumemeduck">
  <meta name="description" content="Access powerful daily motivational quotes to uplift your mindset, stay inspired, and grow daily with the Lumemeduck quotes app.">
  <meta name="keywords" content="daily quotes, inspirational quotes, success quotes, positive habits, motivational quotes, quotes about life, quotes for today">
  <meta name="author" content="Lumemeduck Network">
  <meta name="robots" content="index, follow">
  <meta property="og:title" content="Daily Motivational Quotes App – Boost Positivity | Lumemeduck">
  <meta property="og:description" content="Access powerful daily motivational quotes to uplift your mindset, stay inspired, and grow daily with the Lumemeduck quotes app.">
  <meta property="og:type" content="website">
  <meta property="og:url" content="https://app.lumemeduck.xyz/">
  <meta property="og:image" content="icons/icon-512.png">
  <script type="application/ld+json">
    {
    "@context": "https://schema.org",
    "@type": "WebApplication",
    "name": "LMD Quotes",
    "url": "https://app.lumemeduck.xyz",
    "description": "Access powerful daily motivational quotes to uplift your mindset, stay inspired, and grow daily with the Lumemeduck quotes app.",
    "applicationCategory": "Entertainment",
    "operatingSystem": "All"
    }
  </script>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
  <meta name="color-scheme" content="light dark">
  <meta name="theme-color" content="#0f0b1a">
  <meta name="theme-color" content="#f1f4ff" media="(prefers-color-scheme: light)">
  <meta name="theme-color" content="#0f0b1a" media="(prefers-color-scheme: dark)">
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="application-name" content="LMD Quotes">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-title" content="LMD Quotes">
  <meta name="apple-mobile-web-app-status-bar-style" content="default">
  <link rel="canonical" href="https://app.lumemeduck.xyz/">
  <link rel="manifest" href="/manifest.json">
  <link rel="apple-touch-icon" sizes="512x512" href="icons/icon-512.png">
  <link rel="icon" type="image/png" href="icons/icon-512.png">
  <link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
  <link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/webfonts/fa-solid-900.woff2" as="font" type="font/woff2" crossorigin>
  <link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/webfonts/fa-regular-400.woff2" as="font" type="font/woff2" crossorigin>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
  <style>
/* Fullscreen overlay */
  #loader {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  height: 100%;
  width: 100%;
  overflow: visible;
  background: #f1f4ff url('icons/icon-100.png') no-repeat center center;
  background-size: 200px;
  }
    
/* Main body */
  :root{
    --bg:#f1f4ff;
	--bg1:#eef1ff;
    --card:#ffffff;
    --muted: rgba(0,45,93,0.8);
    --text:#002d5d;
    --accent:#8e08a6;
    --accent-2:#6366f1;
    --warn:#f59e0b;
    --ok:#22c55e;
    --ring: rgba(99,102,241,0.08);
    --shadow: 0 10px 35px rgba(0,0,0,.1);
    --radius: 30px;
  }

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

  ::-webkit-scrollbar{
	display: none;
  }
	  
  html,body {
	height:100%;
	min-height: 100vh;
    background-color: #f1f4ff;
    background-attachment: fixed;
	scroll-behavior: smooth;
	overscroll-behavior: none;
	user-select: none;
	overflow-x: hidden;
	scrollbar-width: none;
  }
	  
  body {
    margin:0;
    display: flex;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
    animation: fadeInBg 0.3s ease forwards;
  }

  body::-webkit-scrollbar{
	display: none;
  }
	  
  container {
  width: 100%;
  max-width: 900px;
  min-height: 100vh;
  background: #f1f4ff;
  display: block;
  flex-direction: column;
  box-shadow: 0px 0px 20px rgba(142,8,166,0.8);
  position: relative;
  margin: auto;
  }

  /* Header */
  header{
  position:sticky;
  top: env(safe-area-inset-top);
  top: 0;
  left: 0;
  width: 100%;
  z-index:10;
  backdrop-filter:saturate(120%) blur(8px);
  background: #f1f4ff;
  borde-bottom:1px solid rgba(99,102,241,0.50);
  box-shadow: 0px 0px 4px 2px rgba(99,102,241,0.20);
  border-bottom-left-radius: 0px;
  border-bottom-right-radius: 0px;
  }
  .nav{
    max-width:900px;
    margin:0 auto;
    display:flex;
	align-items:center;
	justify-content:space-between;
    padding:16px 14px;
    gap:10px;
  }
  .brand{
    display:flex;
	align-items:center;
	gap:8px;
  }
  .logo{
    width:20px; height:20px; border-radius:50%;
    background: conic-gradient(from 210deg, #ffdd55, #ff8a00, #ffd86b, #fff2a1, #ffdd55);
    box-shadow: 0 0 0 3px rgba(255, 221, 85, .15), inset 0 3px 12px rgba(0,0,0,.25);
    position:relative;
  }
  .logo::after{
    content:"";
    position:absolute; inset:6px;
    border-radius:50%;
    background: radial-gradient(circle at 40% 30%, rgba(255,255,255,.8), rgba(255,255,255,0) 60%);
    mix-blend-mode:screen;
  }
  .title{
    font-weight:600; letter-spacing:.2px; font-size:22px;
    display:flex; align-items:baseline; gap:8px;
  }
  .title small{ color:var(--muted); font-weight:600; font-size:12px; }

  .actions{display:flex; gap:8px; align-items:center;}
  .btn{
  appearance:none; border:none; cursor:pointer;
  padding:8px 10px; border-radius:10px;
  background:linear-gradient(180deg, #e8eafa, #f5f7ff);
  color:var(--text); font-weight:700; letter-spacing:.2px;
  box-shadow:inset 0px 0px 2px 1px rgba(99,102,241,.10);
  transition:.2s transform ease, .2s border-color ease, .2s background ease, .2s box-shadow ease;
  borde:1px solid rgb(99,102,241,0.25);
}
 .btn:hover{ transform: translateY(-1px); border-color: var(--ring); box-shadow: 0 12px 40px rgba(99,102,241,.14); }
 .btn:active{ transform: translateY(0); }
 .btn-accent{ background: linear-gradient(180deg, #8e08a6, #9b2daf); color:#fff; }
 .btn-warn{ background: linear-gradient(180deg, #f59e0b, #d97706); color:#fff; }
  main{ max-width:800px; margin:25px auto; padding:0 18px 40px; }
  .grid{ 
    display:grid; grid-template-columns: 1fr; gap:25px;
  }
  @media (min-width: 900px){
    .grid{ grid-template-columns: 1fr; gap:25px; }
  }

  .card{
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(248,250,252,0.8));
  borde:1px solid rgba(99,102,241,0.50);
  border-radius: var(--radius);
  padding:17px; 
  box-shadow: inset 0px 0px 4px 2px rgba(99,102,241,0.20);
  animation: fadeInCard 0.3s ease forwards;
  transition: transform .25s ease, box-shadow .25s ease;
  }
  .card:active {
  transform: scale(1.98);
  }
  .card:hover {
  transform: translateY(-2px);
  }
  .card h2{
    margin:0 0 12px; font-size:18px; letter-spacing:.3px;
    display:flex; align-items:center; gap:10px;
  }
  .muted{ color:var(--muted); }
  .pill{
    display:inline-flex; align-items:center; gap:8px;
    padding:6px 10px; border-radius:999px;
    background:rgba(153,167,255,.08); color:rgba(0,45,93,0.8); font-size:11px; font-weight:600;
    borde:1px solid rgba(153,167,255,.10);
  }

  .quote{
    font-size:16px; line-height:1.4; font-weight:700; margin:8px 0 14px;
  }
  .author{ color:rgba(0,45,93,0.8); font-size:12px; font-weight:400; margin-bottom:22px; }

  .row{ display:flex; gap:10px; flex-wrap:wrap; }
  .row .btn{ flex: 0 0 auto; }

  .challenge{
    font-size:16px; line-height:1.4; font-weight:700; margin:8px 0 14px;
  }
  .status{
    display:hidden; align-items:center; gap:8px; margin-top:10px; color:var(--ok); font-size:12px; font-weight:600;
  }

  /* Tabs (views) */
  .view{ display:none; }
  .view.active{ display:block; }

  /* Calendar */
  .cal-wrap{ overflow:hidden; animation: fadeInCard 0.3s ease forwards; }
  .cal-head{
    display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px;
  }
  .cal-title{ font-weight:800; letter-spacing:.3px; }
  .cal-nav{ display:flex; gap:8px; }
  .cal-btn{ appearance:none; border:none; cursor:pointer;
  padding:8px 10px; border-radius:10px;
  background:linear-gradient(180deg, #e8eafa, #f5f7ff);
  color:var(--text); font-weight:700; letter-spacing:.2px;
  box-shadow:inset 0px 0px 2px 1px rgba(99,102,241,.12);
  transition:.2s transform ease, .2s border-color ease, .2s background ease, .2s box-shadow ease;
  borde:1px solid rgb(99,102,241,0.25);
}
 .btn:hover{ transform: translateY(-1px); border-color: var(--ring); box-shadow: 0 12px 40px rgba(99,102,241,.14); }
 .btn:active{ transform: translateY(0); }
   .calendar{
    display:grid; grid-template-columns: repeat(7, 1fr); gap:8px; padding:8px; border-radius:14px;
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.00));
    border:1px solid rgba(255,255,255,.07);
  }
  .dow, .day{
    text-align:center; padding:10px 0; border-radius:12px;
    border:1px dashed rgba(0,45,93,0.4);
  }
  .dow{ color:var(--muted); font-weight:800; border:none; padding:6px 0; }
  .day{ min-height:38px; display:flex; align-items:center; justify-content:center; position:relative; }
  .day.muted{ opacity:.35; }
  .day .n{ position:absolute; top:6px; left:8px; font-size:12px; color:var(--muted); }
  .day.done{
  background:
    radial-gradient(220px 60px at 50% -10%, rgba(34,197,94,.20), transparent 60%),
    linear-gradient(180deg, rgba(34,197,94,.16), rgba(34,197,94,.02));
  border:1px solid rgba(34,197,94,.45);
  box-shadow: inset 0 0 30px rgba(34,197,94,.08);
   }
  .day.today{ outline: 2px dashed rgba(139,92,246,.55); outline-offset:2px; }
  .legend{ display:flex; gap:10px; align-items:center; margin-top:12px; color:var(--muted); font-size:12px; }
  .dot{ width:12px; height:12px; border-radius:3px; border:1px dashed rgba(196,181,253,.55); }
  .ok{ width:12px; height:12px; border-radius:3px; background:rgba(102,229,181,.35); border:1px solid rgba(102,229,181,.55); }
  .mark{ width:12px; height:12px; border-radius:3px; border:1px dashed rgba(139,92,246,.55); }

  /* Footer note */
  .footnote{ text-align:center; color:var(--muted); font-size:7px; margin-top:15px; position:relative; animation:fadeInCard 0.3s ease forwards; }

  /* Pretty reset-modal */
   .reset-modal {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  animation: fadeInBg 0.3s ease forwards;
}
   .reset-box {
  background: #eef1ff; border: 1px solid rgba(0,0,0,.1);
  color: #002d5d; font-family:system-ui; border-radius: 15px;
  padding: 24px 28px; text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  max-width: 300px;
  animation: fadeInCard 0.3s ease forwards;
}
   .reset-box button {
  appearance:none; border:none; cursor:pointer; margin:16px 12px 0;
  padding:8px 10px; border-radius:10px;
  color:var(--card); font-weight:700; letter-spacing:.2px;
  box-shadow:0 2px 4px rgba(0,0,0,.05);
  borde:1px solid rgba(0,0,0,.05);
  transition:.2s transform ease, .2s border-color ease, .2s background ease, .2s box-shadow ease;
   }
   .btn-ok {
  appearance:none; border:none; cursor:pointer;
  padding:8px 10px; border-radius:10px;
  background: linear-gradient(180deg, #8e08a6, #9b2daf); color:#fff;
  color:var(--card); font-weight:700; letter-spacing:.2px;
  box-shadow:0 2px 4px rgba(0,0,0,.05);
  border:1px solid rgba(0,0,0,.05);
  transition:.2s transform ease, .2s border-color ease, .2s background ease, .2s box-shadow ease;
   }
   .btn-cancel {
  appearance:none; border:none; cursor:pointer;
  padding:8px 10px; border-radius:10px;
  background: linear-gradient(180deg, #f59e0b, #d97706); color:#fff;
  color:var(--card); font-weight:700; letter-spacing:.2px;
  box-shadow:0 2px 4px rgba(0,0,0,.05);
  border:1px solid rgba(0,0,0,.05);
  transition:.2s transform ease, .2s border-color ease, .2s background ease, .2s box-shadow ease;
   }
   .btn-ok:hover { transform: translateY(-1px); border-color: var(--ring); box-shadow: 0 12px 40px rgba(99,102,241,.14); }
   .btn-cancel:hover{ transform: translateY(-1px); border-color: var(--ring); box-shadow: 0 12px 40px rgba(99,102,241,.14); }
    
 .menu-button {
  background: none;
  border: none;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
}

 .menu-button i {
  color: #8e08a6;
  font-size: 1.5rem;
  pointer-events: none;
}
  .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: auto;
  width: 100%;
  max-width: 900px;
  backdrop-filter:saturate(120%) blur(5px);
  background-color: rgba(255,255,255,0.01);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeInBg 0.3s ease forwards;
}

.sidebar-content {
  background-color: #eef1ff;
  borde: 1px solid rgb(0,0,0,.1);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeInCard 0.3s ease forwards;
}

.sidebar-content a {
  display: block;
  margin: 0 0 18px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  color: #8e08a6;
  font-size: 18px;
  font-weight: 700;
}

.bottom-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  width: 100%;
  max-width: 900px;
  backdrop-filter:saturate(120%) blur(8px);
  box-shadow: 0px 0px 4px 2px rgba(99,102,241,0.20);
  borde-top:1px solid rgba(99,102,241,0.50);
  background-color: #f1f4ff;
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  z-index: 10;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.menu-item {
  background: none;
  border: none;
  color: #002d5d;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px;
  width: 25%;
}

.menu-item i {
  font-size: 22px;
}

.menu-item span {
  font-size: 10px;
  margin-bottom: 10px;
}

.menu-item.active {
  color: #8e08a6;
  transform: scale(1.15);
  transition: transform .2s ease;
  transform: translateY(-2px);
}

.menu-item.active i {
  text-shadow: 0 0 14px rgba(142,8,166,0.35);
}

.i-frame {
  width: 100%;
  height: 470px;
  border: none;
  padding: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(248,250,252,.8));
  borde:1px solid rgba(99,102,241,0.50);
  border-radius: 30px;
  box-shadow: inset 0px 0px 4px 2px rgba(99,102,241,0.25);
  display: block;
}

@keyframes fadeInBg {
        from { opacity: 0; }
        to { opacity: 1; }
      }
@keyframes fadeInCard {
        from { opacity: 0; transform: scale(0.9); }
        to { opacity: 1; transform: scale(1); }
      }

.ad-container {
    width: 100%;
	height: auto;
    max-width: 900px;
    margin: 20px auto;
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fefefe;
	overflow: hidden;
    border: none;
	animation: fadeInCard 0.3s ease forwards;
  }

  .ad-slot {
    max-width: 100%;
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .ad-slot img {
    max-width: 100%;
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
	overflow: hidden;
  }

  .tomorrow-hook{
	display:hidden;
    margin-top:10px;
    font-size:10px;
    font-weight:600;
    color:var(--muted);
    text-align:center;
  }

  @keyframes glow{
  0%{opacity:.4;}
  50%{opacity:1;}
  100%{opacity:.4;}
  }

  .tomorrow-hook::before{
    content:"✓ Challenge Completed!";
    animation: glow 2s ease-in-out infinite;
	color:var(--ok);
	font-size:12px;
  }

@media (prefers-color-scheme: dark) {

:root{
  --bg:#0f0b1a;
  --bg1:#1b1430;
  --card:#f3f0ff;
  --muted: rgba(196,181,253,0.8);
  --text:#f3f0ff;
  --accent:#a855f7;
  --accent-2:#8b5cf6;
  --warn:#fbbf24;
  --ok:#22c55e;
  --ring: rgba(139,92,246,0.15);
  --shadow: 0 15px 40px rgba(0,0,0,.6);
}

/* Body */
html,body{
  background-color:#0f0b1a;
}

body::before {
  background: var(--bg);
}

container{
  background:#0f0b1a;
  box-shadow:0 0 30px rgba(168,85,247,.25);
}

/* Header */
header{
  background:#0f0b1a;
  borde-bottom:1px solid rgba(139,92,246,.35);
  box-shadow:0px 0px 4px 2px rgba(139,92,246,.20);
}

.menu-button i {
  color: #a855f7;
}

/* Buttons */
.btn{
  background:linear-gradient(180deg,#1e1b3a,#16132b);
  borde:1px solid rgba(139,92,246,.35);
  box-shadow:inset 0px 0px 2px 1px rgba(139,92,246,.10);
  color:#f3f0ff;
}

.btn:hover{
  box-shadow:0 12px 40px rgba(139,92,246,.25);
}

.btn-accent{
  background:linear-gradient(180deg,#9333ea,#7c3aed);
}

.btn-ok{
  background:linear-gradient(180deg,#9333ea,#7c3aed);
}

.btn-warn{
  background:linear-gradient(180deg,#fbbf24,#d97706);
}

.btn-cancel{
  background:linear-gradient(180deg,#fbbf24,#d97706);
}

.cal-btn{
  background:linear-gradient(180deg,#1e1b3a,#16132b);
  borde:1px solid rgba(139,92,246,.35);
  box-shadow:inset 0px 0px 2px 1px rgba(139,92,246,.10);
  color:#f3f0ff;
}

.cal-btn:hover{
  box-shadow:0 12px 40px rgba(139,92,246,.25);
}

/* Cards */
.card{
  background:linear-gradient(180deg,#1b1430,#151028);
  borde:1px solid rgba(139,92,246,.35);
  box-shadow:inset 0px 0px 4px 2px rgba(139,92,246,.20);
}

/* Quote + Challenge */
.quote,
.challenge{
  color:#f3f0ff;
}

.author{
  color:#c4b5fd;
}

/* Pills */
.pill{
  background:rgba(139,92,246,.15);
  color:#c4b5fd;
  borde:1px solid rgba(139,92,246,.25);
}

/* Calendar */
.calendar{
  border:1px solid rgba(139,92,246,.25);
}

.dow{
  color:#c4b5fd;
}

.day{
  border:1px dashed rgba(196,181,253,.25);
}

.day.today{
  outline:2px dashed rgba(139,92,246,.55);
}

/* Sidebar */
.sidebar-content{
  background:#1b1430;
  borde:1px solid rgba(255,255,255,.08);
}

.sidebar-content a{
  color:#9333ea;
}

/* Bottom menu */
.bottom-menu{
  background:#0f0b1a;
  borde-top:1px solid rgba(139,92,246,.35);
  box-shadow:0px 0px 4px 2px rgba(139,92,246,.20);
}

.menu-item{
  color:#f3f0ff;
}

.menu-item.active{
  color:#a855f7;
}

/* iframe card */
.i-frame{
  background:linear-gradient(180deg,#1b1430,#151028);
  borde:1px solid rgba(139,92,246,.35);
  box-shadow:inset 0px 0px 4px 2px rgba(139,92,246,.20);
}

/* reset modal */
.reset-modal{
  background:rgba(0,0,0,.6);
}

.reset-box{
  background:#1b1430;
  color:#f3f0ff;
  borde:1px solid rgba(255,255,255,.08);
}

/* ads container */
.ad-container{
  background:#151028;
}

	}
</style>
   <!-- Firebase SDK -->
  <script src="https://www.gstatic.com/firebasejs/10.12.2/firebase-app-compat.js"></script>
  <script src="https://www.gstatic.com/firebasejs/10.12.2/firebase-messaging-compat.js"></script>
  <!-- Gtag Manager -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=G-V1C5DZTRMJ"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'G-V1C5DZTRMJ');
  </script>
</head>
<!-- Preloader -->
<body onload="myFunction()">
<div id="loader"></div>
	
<!-- Static fallback text for bots & no-JS browsers -->
<noscript>
  <div style="padding:1rem;text-align:center;font-size:1rem;max-width:600px;margin:auto;">
    <p><strong>LMD Quotes</strong> delivers daily inspirational quotes and simple exercises challenge to
    help you stay positive. Enable JavaScript to experience full features like streak tracking and
    image creation.</p>
  </div>
</noscript>

<container>
  <!-- Pretty share-modal -->
<div id="shareModal" style="display:none;position:fixed;inset:0;background:rgba(255,255,255,.4);z-index:999;align-items:center;justify-content:center;animation: fadeInBg 0.3s ease forwards;">
  <div style="background:var(--bg1);border:1px solid rgba(0,0,0,.1);border-radius:18px;padding:18px 24px;box-shadow:0 4px 15px rgba(0, 0, 0, 0.4);max-width:280px;text-align:center;color:var(--text);font-family:system-ui;animation:fadeInCard 0.3s ease forwards;">
    <h3 style="margin:0 0 12px;font-size:16px;">Share Quote Texts</h3>
    <p id="shareText" style="margin:0 0 18px;font-size:15px;line-height:1.4;"></p>
    <button type="button" class="btn btn-warn" onclick="closeShare()" style="margin-right:23px;">Close</button>
    <button type="button" class="btn btn-accent" onclick="copyShare()">Copy</button>
  </div>
</div>
    <!-- Notify Permission Modal -->
<div id="notifyPrompt"
     style="
        display:none;
        position:fixed;
        top:240px;
        left:50%;
        transform:translateX(-50%);
        z-index:999;
        background:var(--bg1);
        border:1px solid rgba(255,255,255,.1);
        border-radius:18px;
        padding:18px;
        max-width:320px;
        width:90%;
	    flex-direction:column;
	    align-items:center;
	    justify-content:center;
        text-align:center;
	    gap:10px;
        color:var(--text);
        font-family:system-ui;
        box-shadow:0 4px 15px rgba(0, 0, 0, 0.4);
        animation:fadeInBg 1s ease forwards;
     ">     
    <h3 style="margin:0 0 12px;font-size:16px;">
        Stay Motivated Daily!
    </h3>
    <p style="margin:0 0 18px;font-size:15px;line-height:1.4;">
        Enable daily reminders so you never miss your daily dose of inspiration!
    </p>
	<div style="display:flex;align-items:center;justify-content:space-between;gap:30px;">
    <button type="button" class="btn btn-warn" id="cancelNotifyBtn">Later</button>
    <button type="button" class="btn btn-accent" id="enableNotifyBtn">Enable</button>
	</div>
  </div>
  <!-- Sidebar menu -->
  <div id="sidebar" class="sidebar" style="display:none;">
  <div class="sidebar-content">
    <a href="#" onclick="showSection('about'); closeSidebar();">About</a>
    <a href="#" onclick="showSection('user-terms'); closeSidebar();">User terms</a>
    <a href="#" onclick="showSection('privacy-policy'); closeSidebar();">Privacy policy</a>
    <button type="button" class="btn btn-warn" onclick="closeSidebar()">Close</button>
  </div>
  </div>
  <!-- Notify unsupported Modal -->
  <div id="notifyModal" style="
    display:none;
    position:fixed;top:0;left:0;width:100%;height:100%;
    background:rgba(255,255,255,.1);
    align-items:center;justify-content:center;
    z-index:999;
    animation: fadeInBg 0.3s ease forwards;
  ">
  <div style="
    background:var(--bg1);
    padding:18px;
    box-shadow:0 4px 15px rgba(0, 0, 0, 0.4);
    border:1px solid rgba(255,255,255,.1);
    border-radius:18px;
    width:80%;
    max-width:280px;
    text-align:center;
    font-family:system-ui;
    color:var(--text);
    animation: fadeInCard 0.3s ease forwards;
  ">
  <p id="notifyMessage" style="margin-bottom:20px;font-size:16px;">
      <!-- Message goes here -->
  </p>
  <button type="button" class="btn btn-accent" onclick="closeNotifyModal()">OK</button>
  </div>
</div>
  <!-- Bottom Menu -->
<div class="bottom-menu">
  <button type="button" class="menu-item active" onclick="showSection('home')">
    <i class="fas fa-home"></i>
    <span>Home</span>
  </button>
  <button type="button" class="menu-item" onclick="showSection('streak')">
    <i class="fa-solid fa-calendar-check"></i>
    <span>Streak</span>
  </button>
  <button type="button" class="menu-item" onclick="showSection('trivia')">
    <i class="fas fa-question-circle"></i>
    <span>Trivia</span>
  </button>
  <button type="button" class="menu-item" onclick="showSection('game')">
    <i class="fas fa-gamepad"></i>
    <span>Game</span>
  </button>
</div>

  <header>
    <div class="nav">
      <button type="button" class="menu-button" id="menuButton" title="Menu">
        <i class="fas fa-bars"></i>
      </button>
      <div class="brand" role="button" onclick="Router.go('#home')" title="Go Home">
        <img src="icons/img1.png" alt="logo" height= "27px" width= "27px">
        <div class="title">LMD Quotes</div>
      </div>
      <div class="actions">
        <div type="" class="" id="btnProgress" tittle="View Streak Progress"></div>
        <div type="" id="notifyBell" style="background:none;border:none;cursor:none;"><i id="bellIcon"></i></div>
		<button type="button" id="btnReset" title="Reset all data" style="background:none;border:none;cursor:none;">
        <i class="fa fa-refresh" style="font-size:24px;color:#f59e0b;"></i></button>
      </div>
    </div>
  </header>
  
   <main style="background-attachment:fixed;">
    <!-- HOME VIEW -->
    <section id="home" class="view active" aria-labelledby="home-title" style="background-attachment:fixed;">
      <div class="grid">
        <!-- Quotes column -->
        <article class="card" aria-live="polite">
          <h2 id="home-title" style="align-items:center; justify-content:space-between; position:relative;"><i class="fa fa-wand-magic-sparkles" style="font-size:20px;color:#9333ea;"></i> Today's Inspiration <span class="pill" id="quoteTag" style="align-items:center; justify-content:center; position:relative;">Today</span></h2>
          <div id="quoteText" class="quote" style="text-align:center; justify-content:center; position:relative;">Loading…</div>
          <div id="quoteAuthor" class="author" style="text-align:right; margin-right:30px"></div>
          <div class="row" style="align-items:center; justify-content:space-between; position:relative;">
            <button type="button" class="btn" id="btnNewQuote" title="Shuffle today's quote">More Quotes</button>
            <button type="button" class="btn" onclick="shareQuote()" title="Share quote text">Share</button>
            <button type="button" class="btn" id="btnSaveQuote" title="Save quote as image">Create image</button>
          </div>
          <div class=""></div>
        </article>

        <!-- Exercise column -->
        <article class="card" aria-live="polite">
          <h2 style="align-items:center; justify-content:space-between; position:relative;"><i class="fa fa-bolt" style="opacity:0.9;font-size:24px;color:#f59e0b;"></i> Today's Challenge <span class="pill" id="challengeTag" style="align-items:center; justify-content:center; position:relative;">Today</span></h2>
          <div id="challengeText" class="challenge" style="text-align:center; justify-content:center; position:relative;">Loading…</div>
          <div class="row" style="align-items:center; justify-content:space-between; position:relative;">
            <button type="button" class="btn" id="btnNewChallenge" title="Shuffle today’s challenge">More Challenge</button>
            <button type="button" class="btn btn-accent" id="btnComplete" title="Mark today completed">Mark Completed</button>
          </div>
          <div class="status tomorrow-hook" id="completeStatus" style="text-align:center; justify-content:center; position:relative; font-size:10px; margin-bottom:0px; margin-top:5px;" hidden="true"><br>
          ⚡ tomorrow’s challenge unlocks in ⏰ <span id="countdown"></span>
		  </div>
        </article>
      </div>
      <div class="footnote"></div>
	  <div class="ad-container" aria-live="polite">
       <div class="ad-slot">
        <!-- advert here -->
       </div>
	  </div>
    </section>

    <!-- STREAK VIEW -->
    <section id="streak" class="view" aria-labelledby="streak-title">
      <article class="card cal-wrap">
        <div class="cal-head">
          <div class="cal-title" id="streak-title">🗓️ Streak Progress</div>
          <div class="cal-nav">
            <button type="button" class="cal-btn" id="prevMonth" aria-label="Previous Month"><<</button>
            <button type="button" class="cal-btn" id="todayBtn" aria-label="Jump to Current Month">Today</button>
            <button type="button" class="cal-btn" id="nextMonth" aria-label="Next Month">>></button>
          </div>
        </div>
        <div id="calMeta" class="muted" style="margin:0 0 10px;"></div>
        <div class="calendar" id="calendar" role="grid"></div>
        <div class="legend" style="align-items:center; justify-content:space-between; position:relative;">
          <span class="dot"></span> Missed
          <span class="ok"></span> Completed
          <span style="margin-left:8px;" class="mark"></span> marks <strong>today</strong>
        </div>
    </article>
     <div class="footnote"></div>
      <div class="ad-container" aria-live="polite">
       <div class="ad-slot">
        <!-- advert here -->
       </div>
     </div>
    </section>

    <!-- Trivia Section -->
  <section id="trivia" class="view" aria-labelledby="trivia-title">
   <article aria-live="polite" style="animation:fadeInCard 0.3s ease forwards;">
    <h3 id="trivia-title"></h3>
    <iframe class="i-frame" seamless="seamless" allowtransparency="true" allowfullscreen="true" frameborder="0" src="https://quiz.lumemeduck.xyz"></iframe>
  </article>
   <div class="footnote"></div>
    <div class="ad-container" aria-live="polite">
      <div class="ad-slot">
        <!-- advert here -->
      </div>
    </div>
  </section>

   <!-- Game Section -->
  <section id="game" class="view" aria-labelledby="game-title">
   <article aria-live="polite" style="animation:fadeInCard 0.3s ease forwards;">
    <h3 id="game-title"></h3>
    <iframe class="i-frame" seamless="seamless" allowtransparency="true" allowfullscreen="true" frameborder="0" src="https://game.lumemeduck.xyz"></iframe>
   </article>
   <div class="footnote"></div>
     <div class="ad-container">
       <div class="ad-slot">
        <!-- advert here -->
      </div>
    </div>
  </section>

<!-- About Section -->
<section id="about" class="view" aria-labelledby="about-title" style="display:none;">
 <article aria-live="polite" style="animation:fadeInCard 0.3s ease forwards;">
  <h4 id="about-title" style="text-align:center;">ABOUT LMD QUOTES</h4>
<p><strong>LMD Quotes</strong> is a dedicated platform for daily inspiration, positive thinking, and habit-building. Our mission is simple; to help you start each day with clarity, motivation, and a mindset built for growth.</p>
<p>Every day, we provide carefully selected inspirational quotes, affirmations, and simple activity challenges designed to uplift your mind and encourage consistent self-improvement. Whether you're seeking motivation, confidence, or inner peace, LMD Quotes is here to support your journey one day at a time.</p>
<p><strong>What You’ll Find on LMD Quotes</strong></p>
<ul>
  <li><strong>Daily Inspiration:</strong> Thought-provoking quotes and affirmations to keep your mindset positive and focused.</li>
  <li><strong>Daily Challenges:</strong> Simple actions to help you build productive and healthy habits.</li>
  <li><strong>Progress Tracking:</strong> Stay consistent with your goals using a structured streak system.</li>
  <li><strong>Shareable Content:</strong> Create and share beautifully styled quote images with friends and social platforms.</li>
</ul>
<p><strong>Our Purpose</strong></p>
<p>In a fast-moving digital world filled with distractions, LMD Quotes was created to be a calm and reliable space for personal growth. We believe that small daily actions, combined with the right mindset, can lead to meaningful life changes.</p>
<p><strong>Why Choose LMD Quotes?</strong></p>
<ul>
  <li>Encourages consistency through daily engagement</li>
  <li>Supports mental wellness and positive thinking</li>
  <li>Combines inspiration with practical habit-building tools</li>
  <li>Designed for simplicity, clarity, and daily use</li>
</ul>
<p>LMD Quotes is more than just a collection of quotes, it is a growing platform focused on helping individuals build better habits, develop a stronger mindset, and live with purpose.</p>
<p>Start your journey today and take one step closer to a more positive and focused life.</p><br><p></p>
</article>
</section>

<!-- User Terms Section -->
<section id="user-terms" class="view" aria-labelledby="user-terms-title" style="display:none;">
 <article aria-live="polite" style="animation:fadeInCard 0.3s ease forwards;">
  <h4 id="user-terms-title" style="text-align:center;">TERMS OF USE</h4>
<p>Welcome to LMD Quotes (“the site”, “we”, “our”, or “us”). By accessing or using this website, you agree to be bound by these Terms of Use. If you do not agree with any part of these terms, please do not use the site.</p>
<p><strong>Purpose of the Website</strong></p>
<p>LMD Quotes is designed to provide daily inspirational quotes and simple activity challenges to support positive habits and mindset development.</p>
<p>The content on this website is for <strong>informational and motivational purposes only</strong> and does <strong>not constitute professional medical, fitness, or mental health advice</strong>.</p>
<p><strong>User Eligibility</strong></p>
<p>You must be at least 13 years old (or the minimum legal age in your country) to use this website. By using LMD Quotes, you confirm that you meet this requirement.</p>
<p><strong>User Responsibilities</strong></p>
<p>By using this website, you agree to:</p>
<ul>
  <li>Use the website only for lawful purposes.</li>
  <li>Not misuse, disrupt, or interfere with the functionality or security of the website.</li>
  <li>Take full responsibility for your actions based on the content provided.</li>
</ul>
<p><strong>Intellectual Property</strong></p>
<p>All content on this website, including text, graphics, logos, and design elements, is the property of Lumemeduck (LMD) or its licensors and is protected by applicable intellectual property laws.</p>
<p>You may not reproduce, distribute, or modify any content without prior written permission.</p>
<p><strong>Health Disclaimer</strong></p>
<p>LMD Quotes may include activity suggestions and motivational content. <strong>We are not licensed health professionals</strong>.</p>
<p>Always consult a qualified professional before making decisions related to your physical or mental well-being. Your use of the website is at your own risk.</p>
<p><strong>Limitation of Liability</strong></p>
<p>LMD Quotes and its team shall not be held liable for any direct, indirect, incidental, or consequential damages arising from your use of the website.</p>
<p>The website is provided on an “as is” and “as available” basis without warranties of any kind.</p>
<p><strong>Changes to These Terms</strong></p>
<p>We may update these Terms of Use from time to time. Continued use of the website after any changes means you accept the revised terms.</p>
<p><strong>Termination of Access</strong></p>
<p>We reserve the right to suspend or terminate access to the website at our discretion, without prior notice, if these terms are violated.</p>
<p><strong>Contact Us</strong></p>
<p>If you have any questions regarding these Terms of Use, you can contact us at:
<a href="mailto:info@lumemeduck.xyz" style="text-decoration:none;color:#a855f7;cursor:pointer;">info@lumemeduck.xyz</a>.</p>
<p>These Terms of Use were last updated on March 12, 2026.</p><br><p></p>
</article>
</section>

<!-- Privacy Policy Section -->
<section id="privacy-policy" class="view" aria-labelledby="privacy-policy-title" style="display:none;">
 <article aria-live="polite" style="animation:fadeInCard 0.3s ease forwards;">
  <h4 id="privacy-policy-title" style="text-align:center;">PRIVACY POLICY</h4>
<p>LMD Quotes (“the site”, “we”, “our”, or “us”) values your privacy. This Privacy Policy explains how we collect, use, and protect your information when you use our website and related services.</p>
<p><strong>Information We Collect</strong></p>
<p>We may collect the following types of information when you use our site:</p>
<ul>
  <li><strong>Personal Information (if provided):</strong> such as your name or email address when you contact us directly.</li>
  <li><strong>Usage Data:</strong> non-personal information such as device type, browser type, pages visited, and interactions within the site.</li>
  <li><strong>Local Data:</strong> certain features (such as streak tracking or reminders) may store data locally on your device.</li>
</ul>
<p><strong>How We Use Your Information</strong></p>
<ul>
  <li>To provide, operate, and improve our website and services.</li>
  <li>To personalize user experience and maintain site functionality.</li>
  <li>To respond to inquiries and provide support.</li>
  <li>To monitor usage and ensure security.</li>
</ul>
<p><strong>Data Storage & Security</strong></p>
<p>Some data (such as streak progress or reminders) may be stored locally on your device and is not transmitted to our servers.</p>
<p>If you contact us directly, we may store your information securely and use reasonable measures to protect it. However, no method of transmission over the internet is completely secure.</p>
<p><strong>Sharing of Information</strong></p>
<p>We do not sell, trade, or rent users’ personal information. We may share limited data only in the following situations:</p>
<ul>
  <li>With trusted service providers that help us operate our website.</li>
  <li>When required by law or legal process.</li>
  <li>To protect our rights, users, or the public.</li>
</ul>
<p><strong>Advertising & Cookies</strong></p>
<p>We use third-party advertising services such as Google AdSense to display ads.</p>
<p>Google and its partners may use cookies to serve ads based on your prior visits to this website or other websites. These cookies enable the display of personalized advertisements.</p>
<p>You can opt out of personalized advertising by visiting Google Ads Settings: 
<a href="https://adssettings.google.com" target="_blank" style="text-decoration:none;color:#a855f7;">https://adssettings.google.com</a>.</p>
<p>You may also choose to disable cookies through your individual browser settings. Please note that disabling cookies may affect how certain features of the site function.</p>
<p><strong>Third-Party Services</strong></p>
<p>We may use third-party services such as analytics tools or advertising networks. These services may collect information in accordance with their own privacy policies. We encourage users to review those policies.</p>
<p><strong>Children’s Privacy</strong></p>
<p>LMD Quotes is not intended for children under the age of 13. We do not knowingly collect personal information from children. If you believe a child has provided us with personal information, please contact us and we will promptly remove such data.</p>
<p><strong>Your Choices</strong></p>
<p>You can choose to disable notifications or permissions through your device or browser settings at any time. You may also stop using the site at your discretion.</p>
<p><strong>Changes to This Privacy Policy</strong></p>
<p>We may update this Privacy Policy from time to time. Any changes will be posted on this page with an updated revision date.</p>
<p><strong>Contact Us</strong></p>
<p>If you have any questions about this Privacy Policy, you can contact us at: 
<a href="mailto:info@lumemeduck.xyz" style="text-decoration:none;color:#a855f7;cursor:pointer;">info@lumemeduck.xyz</a></p>
<p>This Privacy Policy was last updated on March 12, 2026.</p><br><p></p>
</article>
</section>

<!-- Generated Image Section -->
<section id="generated" class="view" aria-labelledby="generated-title">
  <article class="card" aria-live="polite" style="">
    <!-- Spinner -->
    <div id="loading-container" style="display:none;flex-direction:column;align-items:center;justify-content:center;gap:20px;height:57.5vh;">
      <div class="spinner" style="width:40px;height:40px;border:4px solid rgba(0,0,0,.1);border-top:4px solid #8e08a6;border-radius:50%;animation:spin 1s linear infinite;"></div>
      <p style="font-size:16px;color:var(--text);">Generating image...</p>
    </div>

    <!-- Content -->
    <div id="result-container" style="display:none;flex-direction:column;gap:30px;align-items:center;justify-content:center;text-align:center;animation:fadeInCard 0.3s ease forwards;">
      <img id="generatedImage" alt="Generated Quote" style="width:100%;box-shadow:0 0 10px rgba(0,0,0,0.05);border-top-left-radius:15px;border-top-right-radius:15px;" />     
      <div class="row" style="display:flex;width:90%;align-items:center;justify-content:space-between;">
        <button class="btn" id="download-button"><i class="fas fa-download"></i> Save</button>
        <button class="btn" id="share-button"><i class="fas fa-share"></i> Share</button>
      </div>
      <p style="width:100%;margin-bottom:0px;font-size:14px;color:var(--text)">💖 <b>save</b> to device or <b>share</b> to socials 💝</p>
    </div>
  </article>
  <div class="footnote"></div>
  <div class="ad-container" aria-live="polite">
    <div class="ad-slot">
	<!-- advert here -->
    </div>
  </div>
</section>
<style>
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
</style>
</main>
              
  <!-- Hidden canvas for image export -->
  <canvas id="exportCanvas" width="1080" height="1080" style="display:none;"></canvas>
</container>
              
<script>
var myVar;
function myFunction() {  
  myVar = setTimeout(showPage, 0);
}
function showPage() { 
  document.getElementById("loader").style.display = "none"; 
}
 </script>
	
 <script>
/* ---------- Utilities & Storage ---------- */
const STORAGE = {
  dailyKey: (prefix, date=new Date()) => {
    const y = date.getFullYear(), m = String(date.getMonth()+1).padStart(2,'0'), d = String(date.getDate()).padStart(2,'0');
    return `${prefix}_${y}-${m}-${d}`;
  },
  set(k, v){ localStorage.setItem(k, JSON.stringify(v)); },
  get(k, fallback=null){
    try { const v = localStorage.getItem(k); return v ? JSON.parse(v) : fallback; }
    catch{ return fallback; }
  },
  remove(k){ localStorage.removeItem(k); },
  clearAll(){
    localStorage.removeItem('completedDays');
    // Keep other keys generic wipe:
    Object.keys(localStorage).forEach(k=>{
      if(/^quote_\d{4}-\d{2}-\d{2}$/.test(k) || /^challenge_\d{4}-\d{2}-\d{2}$/.test(k)) localStorage.removeItem(k);
    });
  }
};

const DateUtil = {
  ymd(d=new Date()){ return d.toISOString().slice(0,10); },
  monthKey(y,m){ return `${y}-${String(m+1).padStart(2,'0')}`; }, // m 0-based
  startOfMonth(y,m){ return new Date(y,m,1); },
  daysInMonth(y,m){ return new Date(y, m+1, 0).getDate(); },
  isToday(y,m,day){ const t=new Date(); return t.getFullYear()===y && t.getMonth()===m && t.getDate()===day; }
};
                   
/* ---------- Datasets ---------- */
const QUOTES = [
  {t:"The beauty of life is that it keeps giving you new chances to grow every sunrise is proof that grace never runs out", a:"Lumemeduck"},
  {t:"You become unstoppable when you learn to rest without quitting and believe without seeing", a:"Lumemeduck"},
  {t:"Your journey is not about proving others wrong it is about proving to yourself that you can rise above doubt", a:"Lumemeduck"},
  {t:"Every ending you face is an introduction to something better life rarely subtracts without preparing to multiply", a:"Lumemeduck"},
  {t:"Strength is not built by avoiding pain it is built by facing it and discovering that you were always stronger than you thought", a:"Lumemeduck"},
  {t:"The most peaceful people are not those who escape chaos but those who remain calm while standing in the middle of it", a:"Lumemeduck"},
  {t:"You do not need to rush your healing peace grows quietly one honest breath at a time", a:"Lumemeduck"},
  {t:"Sometimes you are not starting over you are starting wiser and that makes all the difference", a:"Lumemeduck"},
  {t:"When gratitude becomes your habit miracles become your lifestyle appreciation multiplies everything good", a:"Lumemeduck"},
  {t:"The storm may bend you but it cannot break you roots that grow in struggle are the hardest to pull out", a:"Lumemeduck"},
  {t:"Every time you choose peace instead of reaction you take back control of your energy and your story", a:"Lumemeduck"},
  {t:"You were not created to blend in you were designed to shine in your own way even softly lit souls can guide others", a:"Lumemeduck"},
  {t:"True freedom is not doing whatever you want it is mastering your mind so that your choices serve your peace", a:"Lumemeduck"},
  {t:"Every dream requires patience faith and discomfort that is how destiny filters those who truly desire it", a:"Lumemeduck"},
  {t:"You are not late you are aligned life is unfolding according to a rhythm that knows your readiness better than you do", a:"Lumemeduck"},
  {t:"When you begin to trust the process instead of fearing it the unknown turns into your greatest ally", a:"Lumemeduck"},
  {t:"Do not shrink yourself to make others comfortable your light was meant to inspire not to dim", a:"Lumemeduck"},
  {t:"Happiness does not come from getting everything you want it comes from loving the life you are creating every day", a:"Lumemeduck"},
  {t:"What you think repeatedly you become guard your thoughts as carefully as you guard your dreams", a:"Lumemeduck"},
  {t:"And when you finally look back you will realize that every detour was actually divine direction", a:"Lumemeduck"},
  {t:"You owe it to yourself to keep believing not because the road is easy but because your purpose is worth every mile", a:"Lumemeduck"},
  {t:"The weight you carry today is shaping the strength you will rely on tomorrow trust the process even when it feels heavy", a:"Lumemeduck"},
  {t:"Do not mistake rest for weakness even the sun sets to gather strength for another brilliant rise", a:"Lumemeduck"},
  {t:"Sometimes life delays your plans because it is preparing you for blessings greater than you imagined", a:"Lumemeduck"},
  {t:"The peace you are looking for begins when you stop fighting what already is and start embracing what can be", a:"Lumemeduck"},
  {t:"You were never meant to fit into everything your uniqueness is the very thing that will open the right doors", a:"Lumemeduck"},
  {t:"Patience is not passive it is quiet strength that trusts timing more than impulse", a:"Lumemeduck"},
  {t:"Do not chase perfection pursue authenticity because being real will always outlast being flawless", a:"Lumemeduck"},
  {t:"Your pain is not punishment it is preparation every hardship carries a lesson your peace will one day thank you for", a:"Lumemeduck"},
  {t:"Even when progress feels invisible your persistence is silently building momentum behind the scenes", a:"Lumemeduck"},
  {t:"Sometimes the bravest thing you can do is choose hope when everything else tells you not to", a:"Lumemeduck"},
  {t:"You are allowed to outgrow people places and habits that no longer align with your peace", a:"Lumemeduck"},
  {t:"Success without peace is still failure nurture your spirit while you chase your dreams", a:"Lumemeduck"},
  {t:"The most powerful thing you can do in chaos is stay kind calm hearts often change the loudest rooms", a:"Lumemeduck"},
  {t:"Never underestimate the quiet power of consistency it turns ordinary moments into extraordinary transformations", a:"Lumemeduck"},
  {t:"When you stop doubting your worth you stop settling for less than what you deserve", a:"Lumemeduck"},
  {t:"Growth feels uncomfortable because you are shedding parts of yourself that no longer serve your next level", a:"Lumemeduck"},
  {t:"If you can find gratitude in struggle you have already won joy born from hardship never fades", a:"Lumemeduck"},
  {t:"Every time you choose love over fear you rewrite your future with light instead of limitation", a:"Lumemeduck"},
  {t:"Keep your faith steady not because it is easy but because you have already survived harder days than this", a:"Lumemeduck"},
  {t:"When you stop waiting for motivation and start acting from discipline your life transforms from wishful to purposeful", a:"Lumemeduck"},
  {t:"The hardest chapters often turn into the most powerful testimonies keep going the pain you endure today will strengthen tomorrow’s peace", a:"Lumemeduck"},
  {t:"Do not let impatience steal the beauty of becoming greatness grows slowly nourished by persistence and faith", a:"Lumemeduck"},
  {t:"Peace begins when you stop trying to control everything and start trusting that life unfolds exactly as it should", a:"Lumemeduck"},
  {t:"No effort is wasted when done with intention even unseen work builds the foundation for visible success", a:"Lumemeduck"},
  {t:"The light you seek outside already lives within you learn to trust its glow even when the path feels uncertain", a:"Lumemeduck"},
  {t:"Kindness is a form of courage it requires strength to stay gentle in a world that often forgets compassion", a:"Lumemeduck"},
  {t:"Every setback is simply a setup for wisdom the lessons you learn in pain become your tools for progress", a:"Lumemeduck"},
  {t:"Let go of what you cannot control not because it is easy but because peace is too valuable to trade for worry", a:"Lumemeduck"},
  {t:"Your purpose does not fade when times are hard it simply hides behind the noise waiting for your faith to call it back", a:"Lumemeduck"},
  {t:"The secret to inner peace is acceptance not of defeat but of reality so that you can change it with clarity", a:"Lumemeduck"},
  {t:"You were not meant to stay the same every season asks you to evolve and growth is proof that you are alive", a:"Lumemeduck"},
  {t:"Courage is built in silence when you keep showing up without applause your consistency becomes your crown", a:"Lumemeduck"},
  {t:"Sometimes strength means not reacting peace is found in learning that not every storm deserves your attention", a:"Lumemeduck"},
  {t:"Do not chase people attract them by living in truth authenticity always draws what belongs to your spirit", a:"Lumemeduck"},
  {t:"True healing happens when you stop revisiting the pain and start nurturing the lessons it left behind", a:"Lumemeduck"},
  {t:"When you replace expectation with appreciation even the smallest moments become blessings", a:"Lumemeduck"},
  {t:"You are not your past you are the wisdom it taught you rise as proof that growth is stronger than regret", a:"Lumemeduck"},
  {t:"Hope is not pretending everything is fine it is believing that light will find you even in your darkest hour", a:"Lumemeduck"},
  {t:"Every time you choose to start again you remind the universe that your spirit was built for resilience", a:"Lumemeduck"},
  {t:"Every time you choose to rise after being knocked down you teach your heart that resilience is stronger than circumstance", a:"Lumemeduck"},
  {t:"Do not let the noise of doubt drown out the voice of faith within you the quiet belief in your own power can move mountains", a:"Lumemeduck"},
  {t:"You are not what happened to you you are what you decide to become after it transformation begins with choice", a:"Lumemeduck"},
  {t:"When you start focusing on what is within your control peace replaces worry and clarity replaces confusion", a:"Lumemeduck"},
  {t:"The people who seem the calmest are often those who learned to find light inside their own storms", a:"Lumemeduck"},
  {t:"Hope is not the denial of reality it is the decision to see possibility even in the middle of uncertainty", a:"Lumemeduck"},
  {t:"You do not need to be fearless to move forward you just need enough courage to take one more step", a:"Lumemeduck"},
  {t:"Every prayer every effort every act of kindness you give returns to you in ways you cannot yet see", a:"Lumemeduck"},
  {t:"The greatest battles are not against others but against the parts of yourself that resist change", a:"Lumemeduck"},
  {t:"When you stop chasing validation you make room for peace confidence and authentic happiness", a:"Lumemeduck"},
  {t:"The same fire that once burned you can also light your path if you choose to learn instead of resent", a:"Lumemeduck"},
  {t:"A calm mind is not found it is built one conscious breath one gentle thought one act of surrender at a time", a:"Lumemeduck"},
  {t:"Do not rush to arrive enjoy the unfolding even the pauses in your journey are sacred parts of progress", a:"Lumemeduck"},
  {t:"The strongest souls are the ones who have faced darkness and still choose to be light for others", a:"Lumemeduck"},
  {t:"Your purpose will whisper before it shouts listen closely to the quiet things that make your spirit come alive", a:"Lumemeduck"},
  {t:"It is never too late to start again beginnings are not about time they are about courage", a:"Lumemeduck"},
  {t:"Your heart already knows what peace feels like remove the noise until you can hear it again", a:"Lumemeduck"},
  {t:"Even when life bends you it is shaping you strength is often disguised as surrender", a:"Lumemeduck"},
  {t:"When gratitude becomes your lens even the ordinary days reveal their hidden beauty", a:"Lumemeduck"},
  {t:"Every act of kindness you give creates ripples that return the world softens through simple compassion", a:"Lumemeduck"},
  {t:"Do not let temporary pain convince you that permanent defeat has arrived storms only visit they never decide where your roots will stay", a:"Lumemeduck"},
  {t:"Each time you rise after a fall you rewrite your story into one of courage persistence and unwavering belief in your own resilience", a:"Lumemeduck"},
  {t:"Your dreams are valid no matter how delayed they feel the right timing is not late when it aligns with your growth", a:"Lumemeduck"},
  {t:"Peace begins when you stop arguing with how things are and start trusting that everything is unfolding for your good", a:"Lumemeduck"},
  {t:"True growth happens when you stop waiting for the world to be kinder and start being the kindness the world is waiting for", a:"Lumemeduck"},
  {t:"When life tests you it is not to expose your weakness but to reveal how strong your determination truly is", a:"Lumemeduck"},
  {t:"The key to happiness is not in having everything you want but in learning to love and value what you already have", a:"Lumemeduck"},
  {t:"Every time you forgive you free yourself from the weight that chains your peace forgiveness is strength in silence", a:"Lumemeduck"},
  {t:"The ones who move mountains are not those who rush but those who push with faith one patient step at a time", a:"Lumemeduck"},
  {t:"Sometimes progress looks like stillness because waiting in faith is also a form of moving forward", a:"Lumemeduck"},
  {t:"You are stronger than the moment that broke you because you are still here learning breathing and trying again", a:"Lumemeduck"},
  {t:"The sun will rise again not because it has to but because that is its purpose and you too were made to rise daily", a:"Lumemeduck"},
  {t:"Your light was never meant to be perfect it was meant to shine even when it flickers even when the night feels endless", a:"Lumemeduck"},
  {t:"It is not the years in your life that count it is the life in your years live each moment with purpose and gratitude", a:"Abraham Lincoln"},
  {t:"When the noise of doubt grows loud let the whisper of faith remind you that you have overcome before and you will again", a:"Lumemeduck"},
  {t:"Joy is not found in what you achieve but in who you become while learning growing and giving along the way", a:"Lumemeduck"},
  {t:"Never let failure convince you that your story is over every setback is just a new chapter waiting for your comeback", a:"Lumemeduck"},
  {t:"You may not control what happens but you can always control how you choose to respond that is where your power lives", a:"Lumemeduck"},
  {t:"Be grateful for the strength you did not know you had until life demanded you to use it that is where growth hides", a:"Lumemeduck"},
  {t:"When your heart is tired let gratitude become your rest even the smallest thanks can revive the dimmest hope", a:"Lumemeduck"},
  {t:"Every time you choose peace over anger patience over frustration and gratitude over complaint you build a stronger foundation for lasting joy.", a:"Lumemeduck"},
  {t:"You are not behind in life you are exactly where your lessons are every delay is preparing something worth the wait", a:"Lumemeduck"},
  {t:"The purpose of pain is not to punish you but to prepare you every scar holds wisdom that only perseverance can teach", a:"Lumemeduck"},
  {t:"When nothing seems to be working work on your mindset perspective is the first step toward transformation", a:"Lumemeduck"},
  {t:"Success is not found in perfection it is born in consistency in showing up on the days your motivation disappears", a:"Lumemeduck"},
  {t:"Sometimes your greatest blessing will come disguised as a disappointment stay patient while life rearranges your path", a:"Lumemeduck"},
  {t:"The moment you stop doubting your worth the world begins to respond to your energy confidence creates opportunity", a:"Lumemeduck"},
  {t:"Be proud of how quietly you have fought of how often you smiled through pain and how you kept walking when no one saw your effort", a:"Lumemeduck"},
  {t:"You cannot control the wind but you can adjust your sails resilience is the art of finding balance in motion", a:"Lumemeduck"},
  {t:"Happiness is not an end goal; it’s the daily practice of noticing the light even when clouds fill the sky", a:"Lumemeduck"},
  {t:"When your faith feels small remember that mountains are moved by seeds not forests of belief", a:"Lumemeduck"},
  {t:"Do not compare your chapter one to someone else’s chapter twenty your journey has its own divine timeline", a:"Lumemeduck"},
  {t:"Kindness is not weakness it is quiet strength that chooses love even when the world chooses indifference", a:"Lumemeduck"},
  {t:"Courage is not the absence of fear but the decision that something else is more important than fear", a:"Franklin D. Roosevelt"},
  {t:"Every ending carries a hidden beginning the key is to trust that what is leaving is clearing space for what is coming", a:"Lumemeduck"},
  {t:"When you start believing that you deserve better you naturally attract things that align with your peace", a:"Lumemeduck"},
  {t:"Healing is not linear it is messy unpredictable and beautiful because it teaches you patience with yourself", a:"Lumemeduck"},
  {t:"Never underestimate the power of persistence even the softest rain shapes stone through steady repetition", a:"Lumemeduck"},
  {t:"You were born to overcome not to give up your story is still being written with the ink of endurance and grace", a:"Lumemeduck"},
  {t:"Keep showing up with hope because one day you will realize that all the small steps you took built something extraordinary", a:"Lumemeduck"},
  {t:"When the world feels heavy remind yourself that even the strongest storms end and every sunrise begins with darkness learning how to fade", a:"Lumemeduck"},
  {t:"Do not measure your progress by speed measure it by endurance because greatness is never a sprint but a lifelong marathon of faith", a:"Lumemeduck"},
  {t:"You were not born to simply exist you were created to evolve to learn to love and to lift others with the light you find on your journey", a:"Lumemeduck"},
  {t:"Sometimes the delay is not denial it is life teaching you patience so you can handle the blessing when it finally arrives", a:"Lumemeduck"},
  {t:"When you can smile through uncertainty you have mastered one of life’s rarest forms of strength unshakable peace", a:"Lumemeduck"},
  {t:"Every challenge is an invitation a gentle push from the universe reminding you that comfort will never built the person you are meant to become", a:"Lumemeduck"},
  {t:"If you want to change your life change the story you tell yourself every morning because belief shapes destiny", a:"Lumemeduck"},
  {t:"Do not let your past guilt or pain rent space in your future you deserve to walk freely into the peace you are building now", a:"Lumemeduck"},
  {t:"Hard times do not destroy character they reveal it and once revealed it becomes your greatest armor against future storms", a:"Lumemeduck"},
  {t:"When you focus on progress instead of perfection you make room for growth peace and sustainable joy", a:"Lumemeduck"},
  {t:"The secret to peace is not in having a perfect life but in accepting that imperfections make life perfectly real", a:"Lumemeduck"},
  {t:"It is okay to pause but never give up rest as much as you need and return stronger because purpose never expires", a:"Lumemeduck"},
  {t:"The most beautiful souls are those who have known defeat pain and darkness yet still choose to love hope and rise again", a:"Lumemeduck"},
  {t:"When you align your actions with your purpose even slow progress feels like divine movement in the right direction", a:"Lumemeduck"},
  {t:"Your strength is not proven by what you can endure once but by how many times you decide to start over with faith", a:"Lumemeduck"},
  {t:"Sometimes you win sometimes you learn either way life moves you closer to wisdom when you refuse to quit", a:"John C. Maxwell"},
  {t:"You do not need to see the whole staircase just take the first step because faith is built one movement at a time", a:"Martin Luther King Jr."},
  {t:"Let hope be your habit not your last resort for every miracle begins with someone who refused to stop believing", a:"Lumemeduck"},
  {t:"Do not rush your season some flowers bloom late and still fill the world with fragrance that never fades", a:"Lumemeduck"},
  {t:"The fire within you is stronger than the fear around you feed it daily with courage gratitude and action", a:"Lumemeduck"},
  {t:"Every sunrise is a new reminder that yesterday’s struggles did not defeat you they only prepared your spirit for greater strength today", a:"Lumemeduck"},
  {t:"Do not wait for the perfect moment take the moment you have and make it perfect by acting with faith courage and determination", a:"Lumemeduck"},
  {t:"You have survived things you once thought would destroy you that strength still lives in you and it is more powerful than any fear ahead", a:"Lumemeduck"},
  {t:"Success does not arrive overnight it grows quietly through consistency self-belief and the courage to try again when things fall apart", a:"Lumemeduck"},
  {t:"What lies ahead will always be greater than what you left behind keep walking with faith even when the road feels uncertain and long", a:"Lumemeduck"},
  {t:"The true test of strength is not how much you can carry when life is light it is how you keep standing when the weight doubles", a:"Lumemeduck"},
  {t:"Every small effort is a seed when watered with patience and care it becomes the forest of success you once dreamed about", a:"Lumemeduck"},
  {t:"When you feel like giving up remember why you started the fire that lit your journey still burns you just have to breathe on it again", a:"Lumemeduck"},
  {t:"In the middle of difficulty lies opportunity and in every setback lives a seed of strength waiting to bloom when you choose to rise again", a:"Albert Einstein"},
  {t:"Sometimes peace is not the absence of noise but the quiet acceptance that you are doing your best even when life feels loud", a:"Lumemeduck"},
  {t:"If you stumble make it part of the dance Falling is only failure when you decide not to rise and continue the rhythm of persistence", a:"Lumemeduck"},
  {t:"The person who moves a mountain begins by carrying small stones never underestimate the power of small efforts made with faith", a:"Confucius"},
  {t:"Greatness does not come from comfort it comes from resilience built in silence and effort made in moments no one else sees", a:"Lumemeduck"},
  {t:"You are not behind you are simply in a different chapter of your story one that will make sense when the time is right", a:"Lumemeduck"},
  {t:"When you replace judgment with curiosity and anger with understanding peace finds a permanent home in your heart", a:"Lumemeduck"},
  {t:"It always seems impossible until it is done and once you do it the same people who doubted will call it destiny", a:"Nelson Mandela"},
  {t:"Sometimes strength means walking away from what no longer serves your peace letting go is also a form of courage", a:"Lumemeduck"},
  {t:"Be patient with your growth flowers do not bloom all at once and neither will the greatness within you give it time and light", a:"Lumemeduck"},
  {t:"You were given this life because you have the strength to live it trust that every challenge was chosen to awaken your power", a:"Lumemeduck"},
  {t:"Happiness is not something you chase it is something you grow by watering gratitude and weeding out negative thoughts daily", a:"Lumemeduck"},
  {t:"The struggle you face today is not here to break you but to build the patience, strength, and character that your future victories will depend on.", a:"Lumemeduck"},
  {t:"Happiness is not the absence of problems but the ability to deal with them while keeping faith that brighter days are on the way", a:"Lumemeduck"},
  {t:"Do not let fear of failure silence your potential every mistake you survive makes you wiser stronger and one step closer to your purpose", a:"Lumemeduck"},
  {t:"Courage does not always roar sometimes it is the quiet voice at the end of the day saying ‘I will try again tomorrow’", a:"Mary Anne Radmacher"},
  {t:"Growth happens quietly in moments of doubt and endurance keep moving your small steps today are shaping the mountain you will soon conquer", a:"Lumemeduck"},
  {t:"Success is not owned by the talented but earned by those who refuse to surrender when life demands persistence over comfort", a:"Lumemeduck"},
  {t:"You may not control every storm but you can learn to dance in the rain and still find peace within the chaos around you", a:"Lumemeduck"},
  {t:"Believe in yourself even when the world doubts you the moment you do you ignite a fire that no darkness can extinguish", a:"Lumemeduck"},
  {t:"It is during our darkest moments that we must focus to see the light", a:"Aristotle"},
  {t:"Life will test your patience before it rewards your persistence stay grounded the process is shaping you into someone stronger and wiser", a:"Lumemeduck"},
  {t:"Do not fear slow progress fear standing still because every small step you take forward is proof that your purpose is alive", a:"Lumemeduck"},
  {t:"You do not have to shine every day some days you just need to survive even endurance is a form of courage", a:"Lumemeduck"},
  {t:"Peace does not come from having a perfect life it comes from learning to stay calm even when everything feels uncertain", a:"Lumemeduck"},
  {t:"The world becomes softer when you realize everyone is fighting unseen battles choose compassion it always wins", a:"Lumemeduck"},
  {t:"Your life is a masterpiece in progress every struggle adds a stroke of depth every joy adds a hue of light", a:"Lumemeduck"},
  {t:"Let your scars remind you not of the pain but of the strength it took to heal you are living proof of survival", a:"Lumemeduck"},
  {t:"True courage is waking up after failure and trying again not because it is easy but because your purpose will not let you quit", a:"Lumemeduck"},
  {t:"Dream big but work patiently the seeds of greatness grow quietly before the world notices their bloom", a:"Lumemeduck"},
  {t:"Forgive yourself for the days you were not your best healing takes time and growth requires grace", a:"Lumemeduck"},
  {t:"Do not be afraid to outgrow the version of yourself that people are comfortable with you are meant to evolve", a:"Lumemeduck"},
  {t:"Sometimes what feels like a detour is the universe redirecting you to something far better than what you planned", a:"Lumemeduck"},
  {t:"You cannot pour from an empty cup rest is not laziness it is the maintenance of your spirit’s strength", a:"Lumemeduck"},
  {t:"The only limits that truly exist are the ones you accept break your own boundaries the world expands with belief", a:"Lumemeduck"},
  {t:"You never realize how strong you are until strength is the only choice you have left and yet you still rise", a:"Bob Marley"},
  {t:"Faith is not about knowing how things will work out it is about trusting that they will in their own time", a:"Lumemeduck"},
  {t:"Comparison steals your joy but gratitude multiplies it focus on your lane and the blessings will meet you there", a:"Lumemeduck"},
  {t:"Every morning is a gift wrapped in possibility open it with intention and use it to write a better story", a:"Lumemeduck"},
  {t:"Let your failures educate you not define you even mistakes carry lessons that success could never teach", a:"Lumemeduck"},
  {t:"No matter how heavy today feels remind yourself that even the longest nights make way for the dawn", a:"Lumemeduck"},
  {t:"Do not chase happiness create it by choosing gratitude and finding meaning in the small blessings life offers daily", a:"Lumemeduck"},
  {t:"The future belongs to those who believe in the beauty of their dreams and are willing to work for them when no one is watching", a:"Eleanor Roosevelt"},
  {t:"Your peace will multiply when you stop comparing your journey to others and start appreciating the distance you have already covered", a:"Lumemeduck"},
  {t:"Challenges are not roadblocks they are reminders that progress always demands strength patience and faith in your own resilience", a:"Lumemeduck"},
  {t:"You cannot go back and change the beginning but you can start where you are and change the ending", a:"C.S. Lewis"},
  {t:"Hope is stronger than despair because it lives quietly in the hearts of those who refuse to give up no matter how hard life gets", a:"Lumemeduck"},
  {t:"The difference between who you are and who you want to be lies in what you do daily keep showing up even when no one claps", a:"Lumemeduck"},
  {t:"When everything seems to be going against you remember that the airplane takes off against the wind not with it", a:"Henry Ford"},
  {t:"Pain is temporary but quitting makes it permanent choose to push through and watch your persistence rewrite your story", a:"Lumemeduck"},
  {t:"Do not let temporary feelings make permanent decisions patience often reveals the blessing that pain was preparing you for", a:"Lumemeduck"},
  {t:"Our greatest glory is not in never falling but in rising every time we fall", a:"Confucius"},
];

const CHALLENGES = [
  "Walk outdoors for 30 minutes.",
  "Do 2 sets of 20 sit-to-stands from a chair.",
  "Stretch arms, legs, and back for 12 minutes.",
  "Hold a gentle lunge stretch for 45s each side.",
  "Perform 20 wall push-ups, 2 rounds.",
  "March in place for 6 minutes.",
  "Do 15 calf raises, 3 times.",
  "Hold a shoulder stretch across the chest for 30s each side.",
  "Perform 2 sets of 12 seated knee extensions.",
  "Practice deep belly breathing for 10 minutes.",
  "Do 3 sets of 15 squats.",
  "Perform 3 sets of 15 alternating lunges.",
  "Hold a plank for 60s, 3 times.",
  "Do 3 rounds of 25 mountain climbers.",
  "Perform 3 sets of 15 dips on a sturdy chair.",
  "Complete 20 jump squats, repeat 3 rounds.",
  "Do 3 sets of 20 bicycle crunches.",
  "Hold a wall-sit for 90 seconds, 2 times.",
  "Perform 3 rounds of 15 donkey kicks per leg.",
  "Do 3 sets of 20 side leg lifts each side.",
  "Do 3 sets of 25 burpees.",
  "Perform 3 sets of 20 decline push-ups.",
  "Complete 3 rounds of 20 jump lunges.",
  "Hold a plank with alternating arm and leg lifts, 60s x 3.",
  "Perform 3 sets of 20 pike push-ups.",
  "Do 3 rounds of 30 mountain climbers fast-paced.",
  "Sprint in place for 90s, rest, repeat 4 times.",
  "Perform 3 sets of 20 Russian twists with weight.",
  "Do 3 rounds of 15 single-leg squats each side.",
  "Hold a handstand against a wall for 45s, 3 times.",
  "Walk briskly for 20 minutes.",
  "Do 3 sets of 15 squats.",
  "Hold a 60-second plank for 3 sections.",
  "Do 20 push-ups (break into 3 sets).",
  "Stretch your full body for 10 minutes.",
  "Do jumping jacks for 60 seconds 3 times.",
  "Do 15 burpees (any pace).",
  "Climb stairs for 10 minutes.",
  "Do slow jog for 15 minutes.",
  "Core circuit: do 20 crunches 3 times.",
  "Do 20 glute bridges 3 times.",
  "Wall-sit: do 45 seconds 3 times.",
  "Do yoga flow for 15 minutes.",
  "Do shadow boxing for 10 minutes.",
  "Balance drill: do a single-leg stand for 60 seconds.",
  "Take a 15-minute walk after meals.",
  "Do 2 sets of 12 wall push-ups.",
  "Stretch your arms and back for 8 minutes.",
  "Perform 20 seated leg raises.",
  "Hold a 30-second wall-sit, repeat 2 times.",
  "Do 15 calf raises on each leg.",
  "Practice deep breathing for 5 minutes.",
  "Do 2 sets of 10 bodyweight squats.",
  "Balance on one leg for 40 seconds each side.",
  "Walk up and down stairs for 5 minutes.",
  "Do 3 sets of 12 standard push-ups.",
  "Perform 3 sets of 15 lunges (each leg).",
  "Jump rope (or mimic rope jumps) for 3 minutes.",
  "Do 3 rounds of 20 bicycle crunches.",
  "Perform 2 sets of 10 tricep dips on a chair.",
  "Hold a plank for 45 seconds, 3 times.",
  "Do 3 sets of 12 glute bridges.",
  "Perform 20 jump squats.",
  "Shadow box with high intensity for 3 minutes.",
  "Do 3 sets of 15 mountain climbers.",
  "Perform 3 sets of 15 burpees.",
  "Do 3 rounds of 20 push-up to side planks.",
  "Hold a plank with shoulder taps for 60 seconds, 3 times.",
  "Perform 3 sets of 12 pistol squats (use support if needed).",
  "Complete 3 rounds of 25 jump lunges.",
  "Do 2 sets of 15 V-ups.",
  "Perform 3 rounds of 20 Russian twists.",
  "Sprint in place at full effort for 45 seconds, rest 30s, repeat 5 times.",
  "Hold a wall-sit for 90 seconds, repeat 3 times.",
  "Do 3 rounds of 12 dive-bomber push-ups.",
  "Walk in place for 10 minutes while listening to music.",
  "Do 2 sets of 10 chair squats.",
  "Stretch hamstrings and calves for 5 minutes.",
  "Hold a seated twist stretch for 30 seconds each side.",
  "Perform 15 standing side leg lifts each side.",
  "Do 2 rounds of 12 shoulder rolls backward and forward.",
  "March in place with high knees for 2 minutes.",
  "Stand and touch your toes 15 times slowly.",
  "Do 10 seated knee extensions per leg.",
  "Practice mindful breathing for 10 minutes.",
  "Perform 3 sets of 10 push-ups with knees or standard.",
  "Do 3 rounds of 20 standing lunges.",
  "Hold a side plank for 30 seconds each side, 3 times.",
  "Do 2 sets of 15 reverse crunches.",
  "Perform 3 sets of 12 step-ups on a chair or stair.",
  "Do 20 sumo squats.",
  "Complete 3 sets of 15 donkey kicks each leg.",
  "Perform 3 rounds of 20 standing oblique crunches.",
  "Do 2 minutes of jumping jacks, rest, repeat 2 times.",
  "Hold a forearm plank for 60 seconds.",
  "Perform 3 sets of 15 decline push-ups (feet elevated).",
  "Do 3 rounds of 12 explosive jump squats.",
  "Complete 20 burpees, rest, then repeat once.",
  "Hold a plank while alternating leg lifts, 45 seconds x 3.",
  "Perform 3 sets of 15 pike push-ups.",
  "Do 3 rounds of 20 bicycle crunches at fast pace.",
  "Sprint in place for 60 seconds, rest, repeat 3 times.",
  "Perform 3 rounds of 15 side lunges each leg.",
  "Do 3 sets of 12 single-leg glute bridges each side.",
  "Hold a handstand against the wall for 20 seconds, repeat 3 times.",
  "Walk outdoors for 20 minutes at a steady pace.",
  "Perform 2 sets of 12 sit-to-stands from a chair.",
  "Stretch your neck and shoulders for 5 minutes.",
  "Do 10 standing calf raises per leg, 3 times.",
  "Hold a standing quad stretch for 30 seconds each side.",
  "Perform 15 gentle seated twists.",
  "Climb stairs slowly for 8 minutes.",
  "Do 2 sets of 12 wall push-ups.",
  "March in place with arms swinging for 3 minutes.",
  "Practice mindful body scan meditation for 8 minutes.",
  "Perform 3 sets of 15 squats.",
  "Do 3 sets of 12 alternating step-back lunges.",
  "Hold a high plank for 45 seconds, repeat 3 times.",
  "Perform 20 mountain climbers, 3 rounds.",
  "Do 3 rounds of 12 dips on a sturdy chair.",
  "Complete 15 glute bridges, 3 times.",
  "Shadow box for 2 minutes, rest, repeat 3 rounds.",
  "Do 3 sets of 15 side leg lifts each side.",
  "Perform 20 bicycle crunches, 3 rounds.",
  "Hold a wall-sit for 1 minute, repeat twice.",
  "Perform 3 rounds of 20 burpees.",
  "Do 3 sets of 15 decline push-ups.",
  "Complete 25 jump squats, rest, repeat 2 times.",
  "Hold a plank with alternating shoulder taps, 60s x 3.",
  "Perform 3 sets of 20 jump lunges.",
  "Do 3 rounds of 15 pike push-ups.",
  "Sprint in place for 1 minute, rest, repeat 5 times.",
  "Perform 3 sets of 20 Russian twists with a water bottle.",
  "Hold a handstand against a wall for 30 seconds, 3 times.",
  "Do 3 sets of 12 single-leg squats per side.",
  "Walk outdoors for 25 minutes.",
  "Do 2 sets of 15 sit-to-stands from a chair.",
  "Stretch hamstrings and hips for 8 minutes.",
  "Perform 15 standing calf raises, 3 times.",
  "Hold a chest stretch against a wall, 30s each side.",
  "Do 20 arm circles forward and backward.",
  "March in place with high knees for 3 minutes.",
  "Do 10 step-ups on a stair, each leg.",
  "Hold a seated hamstring stretch for 45 seconds each side.",
  "Practice mindful breathing for 8 minutes.",
  "Perform 3 sets of 15 standard squats.",
  "Do 3 sets of 12 push-ups.",
  "Hold a plank for 60 seconds, 3 times.",
  "Perform 3 sets of 20 alternating lunges.",
  "Do 3 sets of 12 dips on a chair.",
  "Complete 20 jump squats, rest, repeat twice.",
  "Do 3 rounds of 15 side leg lifts each side.",
  "Perform 3 sets of 20 crunches.",
  "Do 3 sets of 15 glute bridges.",
  "Hold a wall-sit for 75 seconds.",
  "Do 3 rounds of 20 burpees.",
  "Perform 3 sets of 15 decline push-ups (feet elevated).",
  "Complete 3 sets of 20 jump lunges.",
  "Hold a plank with shoulder taps for 60s, 3 times.",
  "Perform 3 sets of 12 pike push-ups.",
  "Do 3 rounds of 25 mountain climbers.",
  "Sprint in place for 60s, rest, repeat 4 times.",
  "Do 3 rounds of 20 Russian twists holding a bottle.",
  "Perform 3 sets of 12 pistol squats each side (use support).",
  "Hold a wall handstand for 30s, 3 times.",
  "Take a 20-minute walk with deep breaths.",
  "Perform 2 sets of 15 chair squats.",
  "Stretch your shoulders and back for 10 minutes.",
  "Hold a standing hamstring stretch for 40s each leg.",
  "Do 2 sets of 12 seated knee raises.",
  "Perform 15 wall push-ups, 2 rounds.",
  "Walk in place for 5 minutes during TV breaks.",
  "Hold a calf stretch for 30s each side, repeat twice.",
  "Do 15 side leg lifts per leg.",
  "Practice guided meditation for 10 minutes.",
  "Do 3 sets of 12 regular push-ups.",
  "Perform 3 sets of 20 lunges alternating legs.",
  "Hold a side plank for 40s each side, repeat twice.",
  "Do 3 rounds of 20 mountain climbers.",
  "Perform 3 sets of 12 dips on a chair.",
  "Complete 20 jump squats, repeat twice.",
  "Do 3 sets of 15 bicycle crunches.",
  "Hold a wall-sit for 80 seconds, 2 times.",
  "Perform 3 rounds of 20 high knees.",
  "Do 3 sets of 15 donkey kicks per leg.",
  "Perform 3 sets of 20 burpees.",
  "Do 3 rounds of 15 decline push-ups (feet raised).",
  "Complete 3 sets of 20 jump lunges.",
  "Hold a plank with alternating arm reach, 60s x 3.",
  "Perform 3 sets of 15 pike push-ups.",
  "Do 3 rounds of 25 bicycle crunches fast-paced.",
  "Sprint in place for 90s, rest, repeat 3 times.",
  "Perform 3 sets of 15 Russian twists with weight.",
  "Do 3 rounds of 12 pistol squats each leg.",
  "Hold a handstand against wall for 40s, 3 times."
];

/* ---------- Daily Selection (deterministic per day unless shuffled) ---------- */
function pickDaily(keyPrefix, pool){
  const key = STORAGE.dailyKey(keyPrefix);
  let idx = STORAGE.get(key);
  if (idx == null){
    idx = Math.floor(Math.random() * pool.length);
    STORAGE.set(key, idx);
  }
  return {key, idx};
}

/* ---------- App State & Router ---------- */
const AppState = {
  quoteIndex: 0,
  challengeIndex: 0,
  completedDays: STORAGE.get('completedDays', {}), // { "YYYY-MM": { "DD": true } }
  viewMonth: (()=>{ const d=new Date(); return {y:d.getFullYear(), m:d.getMonth()}; })()
};

const Router = {
  go(hash){ location.hash = hash; },
  sync(){
    const view = location.hash === '#streak' ? 'streak' : 'home';
    document.querySelectorAll('.view').forEach(v=>v.classList.remove('active'));
    document.getElementById(view).classList.add('active');
    if (view === 'streak') renderCalendar();
  }
};

/* ---------- Rendering: Home ---------- */
function renderHome(){
  const q = QUOTES[AppState.quoteIndex];
  const c = CHALLENGES[AppState.challengeIndex];
  document.getElementById('quoteText').textContent = q.t.replace(/[“”]/g, "");
  document.getElementById('quoteAuthor').textContent = q.a && q.a !== "—" ? q.a : "";
  document.getElementById('challengeText').textContent = c;

  // Status if already completed today
  const d = new Date();
  const y = d.getFullYear(), m=d.getMonth(), day=d.getDate();
  const mk = DateUtil.monthKey(y,m);
  const done = !!(AppState.completedDays[mk] && AppState.completedDays[mk][String(day).padStart(2,'0')]);
  const status = document.getElementById('completeStatus');
  status.hidden = !done;
  const btn = document.getElementById('btnComplete');
if (done) {
  btn.disabled = true;
  btn.style.opacity = "0.5";
} else {
  btn.disabled = false;
  btn.style.opacity = "1";
}

  // Tag dates
  const today = DateUtil.ymd();
  document.getElementById('quoteTag').textContent = new Date().toLocaleDateString(undefined, { weekday:'short', month:'short', day:'numeric' });
  document.getElementById('challengeTag').textContent = document.getElementById('quoteTag').textContent;
}

/* ---------- Calendar ---------- */
function renderCalendar(){
  const cal = document.getElementById('calendar');
  cal.innerHTML = '';
  const meta = document.getElementById('calMeta');

  const {y,m} = AppState.viewMonth;
  const monthName = new Date(y,m,1).toLocaleDateString(undefined, {month:'long', year:'numeric'});
  meta.textContent = `Viewing ${monthName}`;

  const dow = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
  dow.forEach(d=>{
    const el = document.createElement('div');
    el.className='dow';
   el.setAttribute('role','columnheader');
    el.textContent = d;
    cal.appendChild(el);
  });

  const first = DateUtil.startOfMonth(y,m).getDay();
  const days = DateUtil.daysInMonth(y,m);
  const prevDays = (first + 7) % 7;

  // Add blanks
  for (let i=0;i<prevDays;i++){
    const pad = document.createElement('div');
    pad.className = 'day muted';
    pad.setAttribute('role','gridcell');
    cal.appendChild(pad);
  }

  const monthMap = AppState.completedDays[DateUtil.monthKey(y,m)] || {};

  for (let d=1; d<=days; d++){
    const el = document.createElement('div');
    el.className = 'day';
    el.setAttribute('role','gridcell');
    if (DateUtil.isToday(y,m,d)) el.classList.add('today');

    const n = document.createElement('div');
    n.className = 'n';
    n.textContent = d;
    el.appendChild(n);

    const dd = String(d).padStart(2,'0');
    if (monthMap[dd]) el.classList.add('done');

    cal.appendChild(el);
  }
}

/* ---------- Actions ---------- */
function shuffleQuoteForToday(){
  const k = STORAGE.dailyKey('quote');
  const next = Math.floor(Math.random() * QUOTES.length);
  STORAGE.set(k, next);
  AppState.quoteIndex = next;
  renderHome();
}
  
function shuffleChallengeForToday(){
  const k = STORAGE.dailyKey('challenge');
  const next = Math.floor(Math.random() * CHALLENGES.length);
  STORAGE.set(k, next);
  AppState.challengeIndex = next;
  renderHome();
}

function markTodayCompleted(){
  const btn = document.getElementById('btnComplete');

  if (btn.disabled) return;

  const d = new Date();
  const y = d.getFullYear(), m=d.getMonth(), day=d.getDate();
  const mk = DateUtil.monthKey(y,m);

  if (!AppState.completedDays[mk]) AppState.completedDays[mk] = {};
  AppState.completedDays[mk][String(day).padStart(2,'0')] = true;

  STORAGE.set('completedDays', AppState.completedDays);

  document.getElementById('completeStatus').hidden = false;

  btn.disabled = true;
  btn.style.opacity = "0.5";

  renderCalendar();
}

function resetAll() {
  // build modal
  const modal = document.createElement('div');
  modal.className = 'reset-modal';
  modal.innerHTML = `
    <div class="reset-box">
      <div>Delete your streak records?</div>
      <button class="btn-ok" onclick="doReset()">Reset</button>
      <button class="btn-cancel" onclick="closeReset()">Close</button>
    </div>
  `;
  document.body.appendChild(modal);

  // actual reset
  window.doReset = () => {
    localStorage.removeItem('completedDays');
    localStorage.removeItem('quote_' + DateUtil.ymd());
    localStorage.removeItem('challenge_' + DateUtil.ymd());
    AppState.completedDays = {};
    renderHome(); renderCalendar();
    closeReset();
  };
  window.closeReset = () => modal.remove();
}

/* ---------- Quote Image Export ---------- */
function saveQuoteAsImage(){
  const canvas = document.getElementById('exportCanvas');
  const ctx = canvas.getContext('2d');
  const W = canvas.width, H = canvas.height;

  // Dynamic background gradient
const palettes = {
  calm: [
    ["#a1c4fd", "#c2e9fb"],
    ["#89f7fe", "#66a6ff"],
    ["#d4fc79", "#96e6a1"]
  ],
  vibrant: [
    ["#ff9a9e", "#fad0c4"],
    ["#fbc2eb", "#a6c1ee"],
    ["#fddb92", "#d1fdff"]
  ],
  dreamy: [
    ["#a18cd1", "#fbc2eb"],
    ["#f6d365", "#fda085"],
    ["#84fab0", "#8fd3f4"]
  ],
  bold: [
    ["#ff6a00", "#ee0979"],
    ["#00c6ff", "#0072ff"],
    ["#fc5c7d", "#6a82fb"]
  ],
  peaceful: [
    ["#84fab0", "#8fd3f4"],
    ["#cfd9df", "#e2ebf0"],
    ["#d4fc79", "#96e6a1"]
  ],
  hopeful: [
    ["#fddb92", "#d1fdff"],
    ["#f6d365", "#fda085"],
    ["#a1c4fd", "#c2e9fb"]
  ],
  freeSpirit: [
    ["#fbc2eb", "#a6c1ee"],
    ["#84fab0", "#8fd3f4"],
    ["#fddb92", "#d1fdff"]
  ]
};

const moods = Object.keys(palettes);
const today = new Date();
const dayIndex = today.getDay();
const mood = moods[dayIndex];

const palette = palettes[mood];
const [color1, color2] = palette[Math.floor(Math.random() * palette.length)];

const g1 = ctx.createLinearGradient(0, 0, W, H);
g1.addColorStop(0, color1);
g1.addColorStop(1, color2);
ctx.fillStyle = g1;
ctx.fillRect(0, 0, W, H);

function randomAlpha() { return 0.1 + Math.random() * 0.15; }
const glow1 = ctx.createRadialGradient(W * 0.8, H * 0.2, 50, W * 0.8, H * 0.2, 700);
glow1.addColorStop(0, `rgba(255,255,255,${randomAlpha()})`);
glow1.addColorStop(1, "rgba(0,0,0,0)");
ctx.fillStyle = glow1;
ctx.fillRect(0, 0, W, H);

const glow2 = ctx.createRadialGradient(W * 0.2, H * 0.85, 50, W * 0.2, H * 0.85, 700);
glow2.addColorStop(0, `rgba(255,255,255,${randomAlpha()})`);
glow2.addColorStop(1, "rgba(0,0,0,0)");
ctx.fillStyle = glow2;
ctx.fillRect(0, 0, W, H);

ctx.fillStyle = "rgba(0,0,0,0.0)";
ctx.fillRect(0, 0, W, H);

console.log(`Today's LMD mood: ${mood.toUpperCase()}`);

  // Card
  const pad = 64;
  const cardR = 32;
  const cardX = pad, cardY = pad, cardW = W - pad*2, cardH = H - pad*2;
  roundRect(ctx, cardX, cardY, cardW, cardH, cardR);
  ctx.fillStyle = "rgba(0,0,0,0.03)";
  ctx.fill();
  ctx.strokeStyle = "rgba(255,255,255,0.10)";
  ctx.lineWidth = 2;
  ctx.stroke();

  // Title/brand
  ctx.font = "bold 36px system-ui, Segoe UI, Roboto, Arial";
  ctx.fillStyle = "#20416e";
  ctx.fillText("LMD Quotes", cardX + 40, cardY + 70);
  ctx.font = "600 22px system-ui, Segoe UI, Roboto, Arial";
  ctx.fillStyle = "#20416e";
  const dateStr = new Date().toLocaleDateString(undefined, { weekday:'short', month:'short', day:'numeric', year:'numeric' });
  ctx.fillText(dateStr, cardX + 40, cardY + 100);

  // Quote
  const quote  = document.getElementById('quoteText').textContent.replace(/[“”]/g, '');
const author = document.getElementById('quoteAuthor').textContent;
ctx.font = '800 46px system-ui, Segoe UI, Roboto, Arial';
ctx.fillStyle = '#20416e';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
const quoteLines = wrapText(ctx, quote, cardW - 120);
const authorLine = `— ${author}`;
const totalHeight = (quoteLines.length * 58) + 70;  // +70 for author spacing
const startY = cardY + cardH / 2 - totalHeight / 2 + 29;

  // Quote lines
quoteLines.forEach((line, i) => {
  ctx.fillText(line, cardX + cardW / 2, startY + i * 58);
});

  // Author line
ctx.font      = '600 30px system-ui';
ctx.fillStyle = '#20416e';
ctx.textAlign = 'right';               
ctx.fillText(
  authorLine,
  cardX + cardW - 115,                  
  startY + quoteLines.length * 58 + 32
);

// Reset alignments
ctx.textAlign = 'start';
ctx.textBaseline = 'alphabetic';

  // Footer mark
  ctx.font = "700 20px system-ui, Segoe UI, Roboto, Arial";
  ctx.fillStyle = "#20416e";
  ctx.fillText("🌐 app.lumemeduck.xyz", cardX + 40, cardY + cardH - 50);

  // Decorative corner logo
const logo = new Image();
logo.src = 'icons/img.png';
logo.onload = () => {
  const logoSize = 150;
  const logoCenterX = cardX + cardW - 110;
  const logoCenterY = cardY + 110;
  const logoX = logoCenterX - logoSize / 2;
  const logoY = logoCenterY - logoSize / 2;

  ctx.drawImage(logo, logoX, logoY, logoSize, logoSize);

  const dataURL = canvas.toDataURL('image/png');
  const filename = `quote_${new Date().toISOString().split('T')[0]}.png`;
  showGeneratedImage(dataURL, filename);
};

  // Generate filename
const dataURL = canvas.toDataURL('image/png');
const filename = `quote_${new Date().toISOString().split('T')[0]}.png`;
showGeneratedImage(dataURL, filename);

function generateFilename() {
  const date = new Date().toISOString().split('T')[0];
  return `quote_${Date.now()}.png`;
}

function showGeneratedImage(dataURL, filename) {
  // Switch section
  showSection('generated');

  const loadingContainer = document.getElementById('loading-container');
  const resultContainer = document.getElementById('result-container');
  const img = document.getElementById('generatedImage');
  const downloadBtn = document.getElementById('download-button');
  const shareBtn = document.getElementById('share-button');

  // Reset visibility
  resultContainer.style.display = "none";
  loadingContainer.style.display = "flex";

  // Simulate delay
  setTimeout(() => {
    loadingContainer.style.display = "none";
    resultContainer.style.display = "flex";
    img.src = dataURL;

    downloadBtn.onclick = () => triggerDownload(dataURL, filename);
    shareBtn.onclick = () => shareImage(dataURL);
  }, 1000);
 }
}

// Download
function triggerDownload(dataURL, filename) {
  const isWebView = /(wv|WebView)/i.test(navigator.userAgent);

  if (!isWebView) {
    // Normal browser
    const link = document.createElement('a');
    link.href = dataURL;
    link.download = filename;
    link.style.display = 'none';
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
    return;
  }

  // WebView only
  const blob = dataURLToBlob(dataURL);
  const fd = new FormData();
  fd.append('file', blob, `quote_${Date.now()}.png`);

  fetch('https://tmpfiles.org/api/v1/upload', { method: 'POST', body: fd })
    .then(r => r.json())
    .then(res => {
      let url = res.data?.url || res.data || res.url;
      if (url && !url.includes('/dl/')) {
        url = url.replace('tmpfiles.org', 'tmpfiles.org/dl');
      }
      console.log('Uploaded successfully:', url);
    })
    .catch(err => {
      console.error('Upload failed:', err);
    });
}

function dataURLToBlob(dataURL) {
  const arr = dataURL.split(',');
  const mime = arr[0].match(/:(.*?);/)[1];
  const byteStr = atob(arr[1]);
  const ab = new Uint8Array(byteStr.length);
  for (let i = 0; i < byteStr.length; i++) {
    ab[i] = byteStr.charCodeAt(i);
  }
  return new Blob([ab], { type: mime });
}

// Share image
function shareImage(dataURL) {
  const blob = dataURLToBlob(dataURL);
  const file = new File([blob], 'quote.png', { type: 'image/png' });

  const promoText = 'Shared from LMD Quotes, check it out here: https://app.lumemeduck.xyz';

  if (navigator.canShare && navigator.canShare({ files: [file] })) {
    navigator.share({
      title: "Today's Quote",
      text: promoText,
      files: [file]
    })
      .then(() => console.log('Quote shared successfully!'))
      .catch(error => console.error('Failed to share quote:', error));
  } else {
    console.warn('Sharing not supported on this device.');
  }
 }

  function roundRect(ctx, x, y, w, h, r){
  const rr = Math.min(r, w/2, h/2);
  ctx.beginPath();
  ctx.moveTo(x+rr, y);
  ctx.arcTo(x+w, y, x+w, y+h, rr);
  ctx.arcTo(x+w, y+h, x, y+h, rr);
  ctx.arcTo(x, y+h, x, y, rr);
  ctx.arcTo(x, y, x+w, y, rr);
  ctx.closePath();
}

  function wrapText(ctx, text, maxWidth){
  const words = text.split(' ');
  const lines = [];
  let line = '';
  for (let i=0;i<words.length;i++){
    const test = line ? line + ' ' + words[i] : words[i];
    const {width} = ctx.measureText(test);
    if (width > maxWidth && line){
      lines.push(line);
      line = words[i];
    } else {
      line = test;
    }
  }
  if (line) lines.push(line);
  return lines;
}

/* ---------- Init ---------- */
function init(){
  // Load today's quote and challenge
  const q = pickDaily('quote', QUOTES);
  const c = pickDaily('challenge', CHALLENGES);
  AppState.quoteIndex = q.idx;
  AppState.challengeIndex = c.idx;

  // Bind header
  document.getElementById('btnProgress').addEventListener('click', ()=>Router.go('#streak'));
  document.getElementById('btnReset').addEventListener('click', resetAll);

  // Bind home actions
  document.getElementById('btnNewQuote').addEventListener('click', () => {
  shuffleQuoteForToday();
  maybeShowAd("quotes", 3);
 });
  document.getElementById('btnSaveQuote').addEventListener('click', () => {
  saveQuoteAsImage();
  maybeShowAd("image", 2);
 });
  document.getElementById('btnNewChallenge').addEventListener('click', () => {
  shuffleChallengeForToday();
  maybeShowAd("challenge", 3);
 });
  document.getElementById('btnComplete').addEventListener('click', () => {
  markTodayCompleted();
  showAd();
 });

  // Bind calendar nav
  document.getElementById('prevMonth').addEventListener('click', ()=>{
    const {y,m} = AppState.viewMonth;
    const d = new Date(y, m-1, 1);
    AppState.viewMonth = {y:d.getFullYear(), m:d.getMonth()};
    renderCalendar();
  });
  document.getElementById('nextMonth').addEventListener('click', ()=>{
    const {y,m} = AppState.viewMonth;
    const d = new Date(y, m+1, 1);
    AppState.viewMonth = {y:d.getFullYear(), m:d.getMonth()};
    renderCalendar();
  });
  document.getElementById('todayBtn').addEventListener('click', ()=>{
    const d = new Date();
    AppState.viewMonth = {y:d.getFullYear(), m:d.getMonth()};
    renderCalendar();
  });

  // Navigation buttons (bottom menu)
const navButtons = document.querySelectorAll('.menu-item');

navButtons.forEach(btn => {
  btn.addEventListener('click', () => {
    maybeShowAd("nav", 3);
  });
});

  // Router
  window.addEventListener('hashchange', Router.sync);

  // First render
  renderHome();
  renderCalendar();
  Router.sync();
}

function shareQuote() {
  const text = `"${document.getElementById('quoteText').textContent}" — ${document.getElementById('quoteAuthor').textContent}`;

  if (navigator.share) {
    navigator.share({ title: 'LMD Quotes', text });
    return;
  }

  // Show modal
  const modal  = document.getElementById('shareModal');
  const output = document.getElementById('shareText');
  output.textContent = text;
  modal.style.display = 'flex';
}

function copyShare() {
  const text = document.getElementById('shareText').textContent;
  navigator.clipboard.writeText(text)
    .then(() => {
      // Tiny toast
const toast = document.createElement('div');
toast.textContent = '✔ Copied';
toast.style.cssText =
  'position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);' +
  'background:#eef1ff;color:#22c55e;border:1px solid rgba(0,0,0,0.05);font-weight:bold;padding:8px 16px;' +
  'border-radius:8px;z-index:9999;animation:fade 2.5s forwards;';
document.body.appendChild(toast);

// Remove after fade
setTimeout(() => document.body.removeChild(toast), 2500);

// Keyframe
const style = document.createElement('style');
style.textContent = '@keyframes fade{0%{opacity:1}80%{opacity:1}100%{opacity:0}}';
document.head.appendChild(style);
      closeShare();
    })
    .catch(() => {
      // Old webviews
      const ta = document.createElement('textarea');
      ta.value = text; ta.style.position='fixed'; ta.style.opacity=0;
      document.body.appendChild(ta); ta.select();
      document.execCommand('copy');
      document.body.removeChild(ta);
      alert('✔ Copied!');
      closeShare();
    });
}

function closeShare() {
  document.getElementById('shareModal').style.display = 'none';
}
document.addEventListener('DOMContentLoaded', init);

// Close sidebar on screen touch
document.addEventListener('click', function(event) {
  const sidebar = document.getElementById('sidebar');
  const menuButton = document.getElementById('menuButton');
  if (sidebar && sidebar.style.display === 'flex') {
    if (!sidebar.contains(event.target) && event.target !== menuButton) {
      closeSidebar();
    }
  }
});

// Open sidebar
function openSidebar() {
  document.getElementById('sidebar').style.display = 'flex';
}

// Close sidebar
function closeSidebar() {
  document.getElementById('sidebar').style.display = 'none';
}

// Event listener
document.getElementById('menuButton').addEventListener('click', openSidebar);

// Specific section
function showSection(sectionId) {
  document.querySelectorAll('.view').forEach(section => {
    section.style.display = 'none';
  });

  // Show selected
  const section = document.getElementById(sectionId);
  if (section) {
    section.style.display = 'block';
  }

  // Remove active class
  document.querySelectorAll('.menu-item').forEach(item => {
    item.classList.remove('active');
  });

  // Add active class
  const clickedItem = document.querySelector(`.menu-item[onclick*="${sectionId}"]`);
  if (clickedItem) {
    clickedItem.classList.add('active');
  }
}

// Home default
showSection('home');

// Notifications & PWA Prompts
const notifyPrompt = document.getElementById("notifyPrompt");
const enableBtn = document.getElementById("enableNotifyBtn");
const cancelBtn = document.getElementById("cancelNotifyBtn");
const bellIcon = document.getElementById("bellIcon");

// Bell color
function updateBellColor() {
  if (Notification.permission === "granted") {
    bellIcon.style.color = "#0e95e9";
  } else {
    bellIcon.style.color = "#002d5d";
  }
}

// Show alerts
function showLocalNotification(title, body) {
  if (Notification.permission === "granted") {
    new Notification(title, {
      body,
      icon: "icons/icon-192.png",
      badge: "icons/icon-72.png"
    });
  }
}

// Schedule reminders in SW
async function scheduleNotificationsInSW() {
  if ("serviceWorker" in navigator) {
    const reg = await navigator.serviceWorker.ready;
    if ("periodicSync" in reg) {
      try {
        await reg.periodicSync.register("lmd-quotes-reminder", {
          minInterval: 60 * 60 * 1000
        });
        console.log("Periodic background sync registered.");
      } catch (err) {
        console.warn("Periodic sync registration failed:", err);
      }
    } else if (navigator.serviceWorker.controller) {
      navigator.serviceWorker.controller.postMessage({
        type: "SCHEDULE_NOTIFICATIONS"
      });
    }
  }
}

// Notify modal
function showNotifyModal(message) {
  document.getElementById("notifyMessage").innerText = message;
  document.getElementById("notifyModal").style.display = "flex";
}
function closeNotifyModal() {
  document.getElementById("notifyModal").style.display = "none";
}

// Notification flow
const COOLDOWN = 24 * 60 * 60 * 1000;

function shouldShowNotifyPrompt() {
  const last = localStorage.getItem("notifyLaterTime");
  return (
    Notification.permission !== "granted" &&
    (!last || Date.now() - parseInt(last, 10) > COOLDOWN)
  );
}

async function handleNotifyAllow() {
  notifyPrompt.style.display = "none";

  if (!("Notification" in window)) {
    showNotifyModal("System doesn't support daily reminders settings!");
    return;
  }

  const permission = await Notification.requestPermission();
  if (permission === "granted") {
    // Local push
    await scheduleNotificationsInSW();

    // FCM push
    try {
      const registration = await navigator.serviceWorker.register("/service-worker.js");
      console.log("✓ SW ready for firebase messaging!");

      const app = firebase.initializeApp({
        apiKey: "AIzaSyDi1-Qxs-lt8ZNGUm5xW3sAr3QgK38OLI4",
        authDomain: "lmd-quotes-app.firebaseapp.com",
        projectId: "lmd-quotes-app",
        storageBucket: "lmd-quotes-app.firebasestorage.app",
        messagingSenderId: "37451708871",
        appId: "1:37451708871:web:b0876517c898bc7d54c1e2"
      });

      const messaging = firebase.messaging(app);
      const token = await messaging.getToken({
        vapidKey:
          "BHDrm0tioscEdrcwKvG50hy2-ZjOkaUtLH3_3obWNpcsGnyG5nf7ccvVrHVz__zoNE4ggnsBqSN1k60GkQunr1w",
        serviceWorkerRegistration: registration
      });

      if (token) {
        console.log("✓ FCM Token:", token);
        // send to fcf
		  try {
        const response = await fetch("https://lmd-fcm.chrisoteme.workers.dev/register", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ token })
        });

        if (response.ok) {
          console.log("✓ Token successfully registered with LMD FCM Worker!");
        } else {
          console.warn("⚠️ Token registration failed:", response.status);
        }
      } catch (err) {
        console.error("⚠️ Failed to contact LMD Worker:", err);
      }
    } else {
      console.warn("⚠️ No FCM token received from Firebase!");
	  }

		// Foreground
      messaging.onMessage((payload) => {
        console.log("Message received in foreground:", payload);
      });
    } catch (err) {
      console.error("Firebase messaging setup failed:", err);
    }

    showNotifyModal("Daily reminder notifications are enabled!");
  } else {
    showNotifyModal("Notifications are blocked, allow them in sytem settings!");
  }

  updateBellColor();
}

function handleNotifyLater() {
  notifyPrompt.style.display = "none";
  localStorage.setItem("notifyLaterTime", Date.now().toString());
}

// Attach
enableBtn.onclick = handleNotifyAllow;
cancelBtn.onclick = handleNotifyLater;

// Auto prompt
window.addEventListener("load", () => {
  updateBellColor();
  if (shouldShowNotifyPrompt()) {
    notifyPrompt.style.display = "flex";
  } else if (Notification.permission === "granted") {
    scheduleNotificationsInSW();
  }
});
    
// Android Install Prompt
let deferredPrompt;
window.addEventListener("beforeinstallprompt", (e) => {
  e.preventDefault();
  deferredPrompt = e;

  const last = localStorage.getItem("pwaLaterTime");
  const showNow =
    !localStorage.getItem("pwaInstalled") &&
    (!last || Date.now() - parseInt(last, 10) > COOLDOWN);

  if (showNow) showAndroidInstallPrompt();
});

function showAndroidInstallPrompt() {
  const banner = document.createElement("div");
  banner.id = "pwaBanner";
  banner.innerHTML = `
    <div style="
      position:fixed;
      top:20px;
      left:50%;
      transform:translateX(-50%);
      background:var(--bg1);
      border:1px solid rgba(99,102,241,.25);
      padding:12px;
      border-radius:14px;
      max-width:320px;
      width:90%;
      box-shadow:0 4px 15px rgba(0,0,0,.4);
      font-size:15px;
      z-index:999;
      text-align:center;
	  color:var(--text);
      animation:fadeInBg 1.0s ease forwards;">
      📥 <b>LMD Quotes</b> works best when installed!  
      <br><br>
      <button id="dismissBtn" style="
        margin-right:15px;
        padding:5px 10px;
        background:#f59e0b;
        color:#fff;
        border:none;
        border-radius:7px;">Later</button>
      <button id="installBtn" style="
        margin-left:15px;
        padding:5px 10px;
        background:#22c55e;
        color:#fff;
        border:none;
        border-radius:7px;">Install</button>
    </div>
  `;
  document.body.appendChild(banner);

  document.getElementById("installBtn").addEventListener("click", () => {
    deferredPrompt.prompt();
    deferredPrompt.userChoice.then((choice) => {
      if (choice.outcome === "accepted") {
        console.log("User installed PWA");
        localStorage.setItem("pwaInstalled", "true");
      } else {
        console.log("User dismissed install");
      }
      deferredPrompt = null;
      banner.remove();
    });
  });

  document.getElementById("dismissBtn").addEventListener("click", () => {
    console.log("User tapped Later");
    localStorage.setItem("pwaLaterTime", Date.now().toString());
    banner.remove();
  });
}

// Detect installation
window.addEventListener("appinstalled", () => {
  console.log("PWA installed event fired");
  localStorage.setItem("pwaInstalled", "true");
});

// iOS Prompt
function isIos() {
  return /iphone|ipad|ipod/.test(window.navigator.userAgent.toLowerCase());
}
function isInStandaloneMode() {
  return "standalone" in window.navigator && window.navigator.standalone;
}

if (isIos() && !isInStandaloneMode()) {
  const iosPrompt = document.createElement("div");
  iosPrompt.innerHTML = `
    <div style="
      position:fixed;
      top:20px;
      left:50%;
      transform:translateX(-50%);
      background:var(--bg1);
      border:1px solid rgba(99,102,241,.25);
      padding:12px;
      border-radius:14px;
      max-width:320px;
      width:90%;
      box-shadow:0 4px 15px rgba(0,0,0,.4);
      font-size:15px;
      z-index:999;
      text-align:center;
	  color:var(--text);
	  animation:fadeInBg 1.0s ease forwards;">
      📥 <b>LMD Quotes</b> works best if you: Tap <span style="font-size:18px;">⬆️</span> then "Add to Home Screen"
      <br><br>
      <button id="closeIosPrompt" style="
        padding:4px 8px;
        border:none;
        border-radius:7px;
        background:#f59e0b;
        color:#ffffff">Close</button>
    </div>
  `;
  document.body.appendChild(iosPrompt);
  document
    .getElementById("closeIosPrompt")
    .addEventListener("click", () => iosPrompt.remove());
}

// Service Worker
window.addEventListener("load", () => {
  if ("serviceWorker" in navigator) {
    navigator.serviceWorker
      .register("/service-worker.js")
      .then((reg) => console.log("SW registered successfully!", reg.scope))
      .catch((err) => console.error("SW registration failed!", err));
  }
});
</script>
<script>

function getNextMidnight() {
  const now = new Date();

  const midnight = new Date(
    now.getFullYear(),
    now.getMonth(),
    now.getDate() + 1,
    0, 0, 0, 0
  );

  return midnight;
}

function updateCountdown() {

  const now = new Date();
  const target = getNextMidnight();

  const diff = target - now;

  if (diff <= 0) {
    location.reload();
    return;
  }

  const hours = Math.floor(diff / (1000 * 60 * 60));
  const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));

  const display = hours + "h " + minutes + "m";

  const el = document.getElementById("countdown");
  if (el) el.textContent = display;
}

updateCountdown();

setInterval(updateCountdown, 60000);
</script>
<script>
  const metaTheme = document.querySelector('meta[name="theme-color"]');

  function updateTheme() {
    const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
    metaTheme.setAttribute('content', isDark ? '#0f0b1a' : '#f1f4ff');
  }

  updateTheme();
  window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', updateTheme);
</script>
<script src="https://app.lumemeduck.xyz/appilix-ads.js"></script>
</body>
</html>
