:root {
  --teal-950: #062a2a;
  --teal-900: #08403f;
  --teal-800: #0b524f;
  --teal-700: #0f6e68;
  --green-500: #34d399;
  --green-400: #6ee7b7;
  --blue-500: #38bdf8;
  --blue-400: #7dd3fc;
  --ink: #eafffb;
  --ink-dim: #b7d9d3;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --danger: #f87171;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
}

body {
  background: linear-gradient(160deg, var(--teal-950), var(--teal-900) 45%, var(--teal-800) 100%);
  position: relative;
  overflow-x: hidden;
}

/* Motivating animated background: soft drifting glow orbs */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.bg-glow span {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: float 22s ease-in-out infinite;
}
.bg-glow span:nth-child(1) { width: 420px; height: 420px; background: var(--green-500); top: -100px; left: -100px; animation-duration: 26s; }
.bg-glow span:nth-child(2) { width: 360px; height: 360px; background: var(--blue-500); bottom: -120px; right: -80px; animation-duration: 30s; animation-delay: -6s; }
.bg-glow span:nth-child(3) { width: 260px; height: 260px; background: var(--green-400); top: 40%; left: 60%; animation-duration: 20s; animation-delay: -3s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.1); }
}

a { color: var(--green-400); }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 24px; }

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.3px;
}
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--blue-500));
  box-shadow: 0 0 14px var(--green-500);
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
}

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

label { font-size: 0.85rem; color: var(--ink-dim); display: block; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,0.2);
  color: var(--ink);
  font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-400);
}
.field { margin-bottom: 14px; }

button, .btn {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
button:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--green-500), var(--blue-500)); color: #04241f; }
.btn-primary:hover { opacity: 0.92; }
.btn-ghost { background: transparent; border: 1px solid var(--card-border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green-400); }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--danger); border: 1px solid rgba(248,113,113,0.4); }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

.error-msg { color: var(--danger); font-size: 0.85rem; min-height: 18px; }
.success-msg { color: var(--green-400); font-size: 0.85rem; min-height: 18px; }
.muted { color: var(--ink-dim); font-size: 0.85rem; }

/* Top nav */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
}
.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(0,0,0,0.18);
  border-radius: 12px;
  flex-wrap: wrap;
}
.tab {
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--ink-dim);
  user-select: none;
}
.tab.active { background: linear-gradient(135deg, var(--green-500), var(--blue-500)); color: #04241f; font-weight: 700; }

.section { display: none; }
.section.active { display: block; }

/* Affirmation card */
.affirmation {
  background: linear-gradient(135deg, rgba(52,211,153,0.16), rgba(56,189,248,0.16));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 26px;
  font-size: 1.15rem;
  font-style: italic;
}
.affirmation .author { font-style: normal; font-size: 0.85rem; color: var(--ink-dim); margin-top: 8px; }

/* Music player */
.player {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.player .play-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--green-500), var(--blue-500));
  color: #04241f; font-size: 1.1rem;
}
.player select { max-width: 220px; }
.player input[type="range"] { width: 100px; }

/* Stat / progress cards */
.stat {
  text-align: center;
  padding: 18px;
}
.stat .big { font-size: 1.9rem; font-weight: 800; background: linear-gradient(135deg, var(--green-400), var(--blue-400)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .label { font-size: 0.8rem; color: var(--ink-dim); margin-top: 4px; }

.progress-bar-bg { height: 10px; border-radius: 999px; background: rgba(0,0,0,0.25); overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green-500), var(--blue-500)); transition: width 0.4s ease; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--card-border); font-size: 0.9rem; }
th { color: var(--ink-dim); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }

.todo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
}
.todo-item.done { opacity: 0.5; text-decoration: line-through; }
.todo-item .cat-badge {
  font-size: 0.7rem; padding: 3px 8px; border-radius: 999px;
  background: rgba(56,189,248,0.18); color: var(--blue-400); text-transform: capitalize;
}
.chip {
  padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.chip.pending { background: rgba(250, 204, 21, 0.15); color: #fde047; }
.chip.active { background: rgba(52,211,153,0.15); color: var(--green-400); }
.chip.rejected { background: rgba(248,113,113,0.15); color: var(--danger); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--teal-900); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 24px; width: 92%; max-width: 480px;
  max-height: 86vh; overflow-y: auto;
}

.hidden { display: none !important; }

canvas { max-width: 100%; }

footer.credits { text-align: center; padding: 24px; color: var(--ink-dim); font-size: 0.78rem; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; gap: 12px; align-items: flex-start; }
}
