:root {
  --bg: #070b1b;
  --panel: #0e1733;
  --ink: #eaf2ff;
  --muted: #9fb0d9;
  --accent: #16ffe3;
  --accent2: #8a2be2;
  --ok: #33ff99;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(
      80vw 80vh at 20% 10%,
      rgba(22, 255, 227, 0.08),
      transparent 60%
    ),
    radial-gradient(
      60vw 60vh at 80% 30%,
      rgba(138, 43, 226, 0.08),
      transparent 60%
    ),
    var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial;
}
.page {
  max-width: 1100px;
  padding: 28px 18px;
  margin: 0 auto;
}
.hero {
  text-align: center;
  margin-bottom: 16px;
}
.title {
  font-size: clamp(28px, 5vw, 56px);
  text-shadow: 0 0 16px rgba(22, 255, 227, 0.35),
    0 0 32px rgba(138, 43, 226, 0.25);
  margin: 0 0 6px 0;
}
.tagline {
  color: var(--muted);
  margin: 0 auto;
  max-width: 700px;
}

.card {
  background: linear-gradient(
        180deg,
        rgba(22, 255, 227, 0.06),
        rgba(22, 255, 227, 0.02)
      )
      padding-box,
    radial-gradient(
        120% 120% at 0% 0%,
        rgba(138, 43, 226, 0.45),
        rgba(22, 255, 227, 0.45)
      )
      border-box;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.controls .row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.input {
  flex: 1 1 240px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 12px;
  outline: none;
}
.input.small {
  flex: 0 0 180px;
  max-width: 220px;
}
.input:focus {
  border-color: rgba(22, 255, 227, 0.6);
  box-shadow: 0 0 0 2px rgba(22, 255, 227, 0.2);
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  color: #001313;
  background: linear-gradient(
    180deg,
    rgba(22, 255, 227, 0.9),
    rgba(22, 255, 227, 0.7)
  );
  box-shadow: 0 8px 30px rgba(22, 255, 227, 0.25),
    inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}
.btn.ghost {
  color: var(--ink);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
}

.boards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}
@media (min-width: 1000px) {
  .boards {
    grid-template-columns: 1fr 1fr;
  }
}

.board {
  --habit-colour: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 6px solid var(--habit-colour);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.board .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.board .name {
  font-weight: 700;
}
.board .stats {
  color: var(--muted);
  font-size: 14px;
}
.board .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cell {
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cell:hover {
  transform: translateY(-1px);
}
.cell.done {
  color: #001313;
  background: linear-gradient(
    180deg,
    var(--habit-colour),
    rgba(22, 255, 227, 0.7)
  );
  box-shadow: 0 8px 30px rgba(22, 255, 227, 0.25);
  border-color: transparent;
}
.legend {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.quote {
  margin-top: 4px;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  width: 100%;
}

#toast {
  position: fixed;
  left: 50%;
  top: 14px;
  transform: translateX(-50%) translateY(-20px);
  opacity: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(22, 255, 227, 0.12);
  border: 1px solid rgba(22, 255, 227, 0.5);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 20px rgba(22, 255, 227, 0.25);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* highlight today's date */
.cell.today {
  outline: 2px solid var(--habit-colour);
  box-shadow: 0 0 16px rgba(22, 255, 227, 0.35);
}

/* gentle pulse to guide to next month day 1 */
@keyframes pulseHint {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}
.cell.hint {
  animation: pulseHint 1.2s ease-in-out 2;
  outline: 2px solid var(--habit-colour);
}

/* Big quote box at the bottom of each board */
.board .quote.box {
  margin-top: 12px;
  padding: 16px 18px;
  font-size: 1.1rem;
  line-height: 1.5;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.board .quote.box {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2),
    0 0 0 2px var(--habit-colour, #16ffe3) inset;
}

.board .quote.box {
  transition: transform 120ms ease, opacity 120ms ease;
}
.board .quote.box:active {
  transform: scale(0.99);
  opacity: 0.9;
}

.board .quote.box {
  margin-top: 12px;
  padding: 16px 18px;
  font-size: 1.1rem;
  line-height: 1.5;
  text-align: center;

  /* NEW: colours are driven by JS variables for perfect theme matching */
  color: var(--quote-text, #ffffff);
  background: var(--quote-bg, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--quote-border, rgba(255, 255, 255, 0.15));
  border-radius: 12px;
  backdrop-filter: blur(4px);

  /* subtle glow that respects the theme */
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2),
    0 0 0 2px var(--quote-border, rgba(255, 255, 255, 0.15)) inset,
    0 8px 26px var(--quote-glow, rgba(0, 0, 0, 0.15));

  transition: transform 120ms ease, opacity 120ms ease;
}
.board .quote.box:active {
  transform: scale(0.99);
  opacity: 0.9;
}
