/* Dream reflection and Daily Wisdom — Fari v2.20 */
.task-card.task-dream {
  background:
    radial-gradient(circle at 72% 18%, rgba(190, 224, 255, .62), transparent 28%),
    radial-gradient(circle at 16% 88%, rgba(224, 175, 204, .4), transparent 31%),
    linear-gradient(145deg, #182b5a, #536a98 57%, #c99698);
}

.task-card.task-dream .play,
.task-card.task-quote .play {
  width: 154px !important;
  height: 50px !important;
  border-radius: 999px;
}

.task-card.task-dream .play::after,
.task-card.task-quote .play::after {
  font-size: 14px;
  font-weight: 750;
}

.task-card.task-dream .play::after { content: "Reflect on a dream"; }
.task-card.task-quote .play::after { content: "Read today's thought"; }
.task-card.task-dream .play svg,
.task-card.task-quote .play svg { display: none; }

html[lang="zh-CN"] .task-card.task-dream .play::after,
html[lang="zh"] .task-card.task-dream .play::after { content: "记录并理解梦境"; }
html[lang="zh-CN"] .task-card.task-quote .play::after,
html[lang="zh"] .task-card.task-quote .play::after { content: "读今日名言"; }

.task-card.task-quote {
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 224, 159, .55), transparent 24%),
    radial-gradient(circle at 15% 82%, rgba(124, 205, 194, .42), transparent 34%),
    linear-gradient(145deg, #274b61, #857495 58%, #d8a87e);
}

.quote-home-mark {
  position: absolute;
  width: 54px;
  height: 54px;
  right: 22px;
  top: 20px;
  opacity: .14;
  transform: rotate(-7deg);
}

.quote-home-mark svg { width: 100%; height: 100%; fill: #fff; }
.task-badge::before { content: "9" !important; }

.dream-reflection-page,
.daily-quote-page {
  --feature-ink: #f8f5ed;
  --feature-muted: rgba(231, 236, 247, .7);
  --feature-line: rgba(255, 255, 255, .13);
  --feature-panel: rgba(255, 255, 255, .075);
  --feature-accent: #a4e0d7;
  --feature-warm: #f0c993;
  background:
    radial-gradient(circle at 72% 8%, rgba(125, 111, 189, .28), transparent 31%),
    radial-gradient(circle at 12% 76%, rgba(72, 158, 174, .18), transparent 34%),
    linear-gradient(165deg, #091533, #17234a 52%, #332b4b);
  color: var(--feature-ink);
}

.daily-quote-page {
  background:
    radial-gradient(circle at 18% 16%, rgba(75, 174, 168, .22), transparent 31%),
    radial-gradient(circle at 84% 72%, rgba(214, 157, 116, .2), transparent 36%),
    linear-gradient(155deg, #0a2635, #26304d 54%, #4c3448);
}

.dream-reflection-page .page-shell,
.daily-quote-page .page-shell {
  padding: max(76px, calc(env(safe-area-inset-top) + 67px)) 20px max(50px, calc(env(safe-area-inset-bottom) + 36px));
  overscroll-behavior: contain;
}

.dream-reflection-page .page-back,
.daily-quote-page .page-back {
  width: 48px;
  height: 48px;
  top: max(16px, calc(env(safe-area-inset-top) + 8px));
  left: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .13);
  color: #fff;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.dream-reflection-page .page-content,
.daily-quote-page .page-content { max-width: 560px; margin: 0 auto; }

.feature-kicker {
  margin: 0 0 8px;
  color: var(--feature-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.feature-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.page-content .feature-heading-row h1 {
  margin: 0;
  color: var(--feature-ink);
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1.05;
}

.feature-heading-action {
  min-width: 48px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--feature-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--feature-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.feature-intro {
  max-width: 470px;
  margin: 0 0 24px;
  color: var(--feature-muted);
  font-size: 13px;
  line-height: 1.6;
}

.feature-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 0 0 20px;
  padding: 5px;
  border: 1px solid var(--feature-line);
  border-radius: 18px;
  background: rgba(5, 13, 34, .34);
}

.feature-tabs button {
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--feature-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.feature-tabs button[aria-selected="true"] {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.feature-field { display: grid; gap: 9px; }
.feature-field > span,
.feature-fieldset legend {
  color: var(--feature-ink);
  font-size: 12px;
  font-weight: 750;
}

.feature-field textarea {
  width: 100%;
  min-height: 156px;
  resize: vertical;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 18px;
  outline: none;
  background: rgba(255, 255, 255, .075);
  color: #fff;
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
}

.feature-field textarea::placeholder { color: rgba(237, 240, 247, .42); }
.feature-field textarea:focus { border-color: rgba(164, 224, 215, .75); box-shadow: 0 0 0 3px rgba(164, 224, 215, .12); }

.feature-field-note,
.feature-counter,
.feature-boundary,
.feature-card-note {
  color: rgba(228, 233, 243, .59);
  font-size: 11px;
  line-height: 1.5;
}

.feature-counter { justify-self: end; }
.feature-fieldset { margin: 20px 0 0; padding: 0; border: 0; }
.feature-fieldset legend { margin-bottom: 10px; }

.emotion-chips,
.symbol-chips,
.quote-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emotion-chips button,
.symbol-chip,
.quote-theme {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--feature-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: var(--feature-muted);
  font: inherit;
  font-size: 12px;
}

.emotion-chips button { min-height: 48px; cursor: pointer; }
.emotion-chips button[aria-pressed="true"] {
  border-color: rgba(164, 224, 215, .62);
  background: rgba(164, 224, 215, .15);
  color: #eafffb;
}

.voice-capture,
.image-capture {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 22px;
  border: 1px solid var(--feature-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .055);
  text-align: center;
}

.voice-capture p,
.image-capture p { margin: 0; color: var(--feature-muted); font-size: 12px; line-height: 1.5; }

.voice-button,
.image-button {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: #f5f1e8;
  color: #202a43;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.voice-button[data-listening="true"] {
  background: #e8a8bf;
  color: #3d1830;
  box-shadow: 0 0 0 7px rgba(232, 168, 191, .12);
}

.image-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.image-preview { width: 100%; display: grid; gap: 9px; }
.image-preview img { width: 100%; max-height: 210px; object-fit: cover; border-radius: 16px; }

.feature-primary,
.feature-secondary,
.feature-danger {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.feature-primary { border: 0; background: #f5f1e8; color: #202a43; }
.feature-primary:disabled { opacity: .48; cursor: not-allowed; }
.feature-secondary { border: 1px solid var(--feature-line); background: rgba(255, 255, 255, .07); color: #fff; }
.feature-danger { border: 1px solid rgba(238, 156, 175, .38); background: rgba(169, 62, 88, .16); color: #ffdce4; }

.feature-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 22px;
}

.feature-actions .feature-primary:only-child { grid-column: 1 / -1; }

.feature-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--feature-muted);
  font-size: 12px;
  line-height: 1.5;
}

.feature-status.is-error {
  padding: 12px 14px;
  border: 1px solid rgba(244, 154, 175, .35);
  border-radius: 14px;
  background: rgba(165, 54, 82, .14);
  color: #ffd9e2;
}

.feature-loading {
  min-height: 55vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 15px;
  text-align: center;
}

.feature-loading-ring {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 255, 255, .13);
  border-top-color: var(--feature-accent);
  border-radius: 50%;
  animation: feature-spin .9s linear infinite;
}

@keyframes feature-spin { to { transform: rotate(360deg); } }

.dream-result-hero,
.quote-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 10%, rgba(255, 220, 154, .2), transparent 26%),
    radial-gradient(circle at 7% 90%, rgba(112, 208, 192, .17), transparent 31%),
    rgba(255, 255, 255, .075);
  box-shadow: 0 24px 55px rgba(2, 9, 27, .24);
}

.dream-result-hero { padding: 25px 21px; }
.dream-result-hero::before,
.quote-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -78px;
  top: -82px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(255, 255, 255, .025), 0 0 0 49px rgba(255, 255, 255, .018);
}

.dream-date,
.quote-date {
  position: relative;
  display: block;
  color: var(--feature-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.dream-result-hero h1 {
  position: relative;
  margin: 13px 0 15px;
  color: #fff;
  font-size: 30px;
}

.dream-result-hero > p {
  position: relative;
  margin: 0;
  color: rgba(242, 244, 249, .76);
  font-size: 14px;
  line-height: 1.65;
}

.dream-insight-grid { display: grid; gap: 11px; margin-top: 16px; }
.dream-insight {
  padding: 17px;
  border: 1px solid var(--feature-line);
  border-radius: 18px;
  background: var(--feature-panel);
}
.dream-insight span { display: block; margin-bottom: 7px; color: var(--feature-warm); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.dream-insight h2 { margin: 0; color: #fff; font: 500 21px/1.25 Georgia, "Noto Serif SC", serif; }
.dream-insight p { margin: 0; color: rgba(237, 240, 247, .75); font-size: 13px; line-height: 1.62; }
.dream-insight .symbol-chips { margin-top: 5px; }

.dream-safety {
  margin-top: 15px;
  padding: 14px 15px;
  border-left: 3px solid rgba(164, 224, 215, .67);
  border-radius: 4px 14px 14px 4px;
  background: rgba(164, 224, 215, .08);
  color: rgba(239, 246, 245, .76);
  font-size: 11px;
  line-height: 1.6;
}

.dream-safety.is-support {
  border-left-color: #ef9ab0;
  background: rgba(181, 70, 96, .14);
  color: #ffe1e8;
}

.dream-history-list { display: grid; gap: 11px; }
.dream-history-item {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--feature-line);
  border-radius: 18px;
  background: var(--feature-panel);
  color: #fff;
  text-align: left;
}
.dream-history-open { min-width: 0; min-height: 48px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.dream-history-open strong { display: block; overflow: hidden; font: 500 17px/1.3 Georgia, "Noto Serif SC", serif; text-overflow: ellipsis; white-space: nowrap; }
.dream-history-open span { display: block; margin-top: 7px; color: var(--feature-muted); font-size: 11px; }
.dream-history-delete { width: 48px; height: 48px; border: 1px solid rgba(239, 156, 177, .28); border-radius: 50%; background: rgba(158, 60, 84, .12); color: #ffdce5; cursor: pointer; }
.feature-empty { min-height: 40vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; }
.feature-empty p { max-width: 300px; margin: 0; color: var(--feature-muted); font-size: 13px; line-height: 1.6; }

.quote-card { min-height: 430px; padding: 34px 25px 27px; display: flex; flex-direction: column; }
.quote-mark { width: 58px; height: 58px; margin: 36px 0 12px; fill: rgba(246, 212, 151, .62); }
.quote-card blockquote {
  position: relative;
  margin: 0;
  color: #fff;
  font: 500 clamp(25px, 7vw, 35px)/1.34 Georgia, "Noto Serif SC", serif;
  text-wrap: balance;
}
.quote-attribution { position: relative; margin-top: auto; padding-top: 28px; }
.quote-attribution strong { display: block; color: #fff; font-size: 14px; }
.quote-attribution span { display: block; margin-top: 5px; color: var(--feature-muted); font-size: 11px; line-height: 1.4; }
.quote-themes { position: relative; margin-top: 17px; }
.quote-theme { min-height: 34px; display: grid; place-items: center; color: rgba(243, 246, 250, .69); }
.quote-reason { margin: 15px 3px 0; color: var(--feature-muted); font-size: 12px; line-height: 1.55; }
.quote-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
.quote-navigation .feature-primary { grid-column: 1 / -1; }

.feature-primary:focus-visible,
.feature-secondary:focus-visible,
.feature-danger:focus-visible,
.feature-heading-action:focus-visible,
.feature-tabs button:focus-visible,
.emotion-chips button:focus-visible,
.voice-button:focus-visible,
.image-button:focus-visible,
.dream-history-open:focus-visible,
.dream-history-delete:focus-visible,
.dream-reflection-page .page-back:focus-visible,
.daily-quote-page .page-back:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 359px) {
  .pages { width: 100%; gap: 0; justify-content: center; }
  .pages button,
  .pages button.active { width: 34px !important; height: 48px !important; flex: 0 0 34px; }
  .feature-actions { grid-template-columns: 1fr; }
  .feature-actions > * { grid-column: 1; }
  .quote-card { min-height: 390px; padding: 28px 20px 23px; }
  .quote-mark { margin-top: 25px; }
}

@media (orientation: landscape) and (max-height: 620px) {
  .dream-reflection-page .page-shell,
  .daily-quote-page .page-shell {
    width: 100%;
    max-width: none;
    padding-top: 68px;
  }
  .dream-reflection-page .page-content,
  .daily-quote-page .page-content { max-width: 680px; }
  .feature-loading { min-height: 65vh; }
  .quote-card { min-height: 290px; padding: 24px; }
  .quote-mark { width: 42px; height: 42px; margin: 15px 0 8px; }
  .quote-card blockquote { font-size: 24px; }
  .dream-result-hero { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .feature-loading-ring { animation: none; border-color: var(--feature-accent); }
  .dream-reflection-page *,
  .daily-quote-page * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
