:root {
  --ink-strong: #4A4159;
  --ink-body:   #5C5470;
  --ink-list:   #6E6580;
  --ink-muted:  #8C819E;
  --ink-label:  #C0B5A3;
  --lilac:      #B9A8D6;
  --lilac-soft: #B4A9C2;
  --accent:     #6F5FA3;
  --accent-ink: #FFF8EE;
  --surface:    #FFFFFF;
  --divider:    #F0E9DE;
  --star-bg:    #F6F1E9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #F6EEE3;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@keyframes qdj-pop {
  0%   { transform: scale(0.97); opacity: 0; }
  100% { transform: scale(1);    opacity: 1; }
}

.app-bg {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background: linear-gradient(180deg, #E8E0F2 0%, #F6EEE3 34%, #F6EEE3 100%);
  background-attachment: fixed;
}

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 28px;
  padding-top: calc(20px + env(safe-area-inset-top));
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

/* ---- Header ---- */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 16px;
}
.header__title {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-strong);
  letter-spacing: 0.2px;
}
.header__date {
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
  text-transform: capitalize;
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 18px;
}
.tab {
  flex: 1;
  border: none;
  cursor: pointer;
  padding: 9px 4px;
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  background: transparent;
  color: var(--ink-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.tab.is-active {
  background: var(--surface);
  color: var(--ink-strong);
}

/* ---- Loading / empty ---- */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-muted);
  font-size: 16px;
}
.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.5;
}

/* ---- Today card ---- */
.today { animation: qdj-pop 0.35s ease; }

.card {
  background: var(--surface);
  border-radius: 28px;
  padding: 26px 24px 24px;
  box-shadow: 0 10px 30px rgba(93, 76, 128, 0.12);
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.star-btn {
  border: none;
  background: var(--star-bg);
  cursor: pointer;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.surprise-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--lilac);
  margin-bottom: 8px;
}

.question {
  font-family: 'Baloo 2', sans-serif;
  font-size: 27px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink-strong);
  text-wrap: pretty;
  margin: 0 0 20px;
}

.divider {
  height: 1px;
  background: var(--divider);
  margin-bottom: 18px;
}

.label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-label);
  margin-bottom: 8px;
}

.answer {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-body);
  text-wrap: pretty;
  margin-bottom: 18px;
}

.chat-box {
  border-radius: 18px;
  padding: 14px 16px;
}
.chat-box__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 4px;
}
.chat-box__text {
  font-size: 16px;
  font-style: italic;
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.btn-primary {
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  font-weight: 600;
  padding: 15px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(111, 95, 163, 0.3);
}
.btn-primary:active { transform: translateY(1px); }
.btn-link {
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--accent);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 8px;
  text-decoration: underline;
}

/* ---- List cards (past / favs) ---- */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.list-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: 0 6px 18px rgba(93, 76, 128, 0.08);
}
.list-card__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 8px;
}
.list-card__date {
  flex: 1;
  min-width: 90px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--lilac);
  text-transform: capitalize;
}
.list-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.chip--sm {
  padding: 3px 10px;
  font-size: 11.5px;
}
.star-btn--plain {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 17px;
  padding: 0;
  width: auto;
  height: auto;
  min-width: 0;
  border-radius: 0;
}
.list-card__q {
  font-family: 'Baloo 2', sans-serif;
  font-size: 18.5px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink-strong);
  margin: 0 0 8px;
  text-wrap: pretty;
}
.list-card__a {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-list);
}

/* ---- Footer ---- */
.footer {
  margin-top: auto;
  padding-top: 26px;
  text-align: center;
  font-size: 12.5px;
  color: var(--lilac-soft);
}

@media (prefers-reduced-motion: reduce) {
  .today { animation: none; }
  .tab { transition: none; }
}
