/* Big Quote of the Day page: draw a quote, breathe with a mandala, send a 悄悄話. */
.quote-page { --quote: #8e4fd1; --paper: #fbf3df; }
.draw, .result { text-align: center; }
.draw h2, .result .picked { color: var(--quote); }
.draw p { color: var(--ink) !important; line-height: 1.8; margin: 8px 0 14px; }
.draw .ph { display: inline-block; } /* lines only break between phrases */
.product-card h2 { color: var(--quote); }
.product-card .soon { color: var(--quote); border-color: var(--quote); }
.product-card h2 { font-size: 16px; }
.product-body { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; margin-top: 10px; }
.product-body p { margin: 0; font-size: 13px; line-height: 1.6; }
.quote-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quote-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; }

/* Step 1: the tube button */
.tube-btn { display: block; position: relative; margin: 14px auto 6px; border: 0; background: none; cursor: pointer; padding: 0;
  transition: opacity .7s ease, transform .7s ease; }
.tube-btn img { display: block; width: 150px; height: auto; filter: drop-shadow(0 10px 18px rgba(142,79,209,.25)); animation: bob 3.2s ease-in-out infinite; }
.tube-name { position: absolute; left: 50%; top: 66%; transform: translateX(-50%); color: #fff; font-size: 10px; line-height: 1.25;
  white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.35); pointer-events: none; }
.tube-name b { font-size: 13px; }
.tube-btn:hover img, .tube-btn:focus-visible img { filter: drop-shadow(0 10px 22px rgba(240,98,146,.55)); }
.draw.fading .tube-btn, .draw.fading #draw { opacity: 0; transform: scale(.92); }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
#draw { max-width: 320px; transition: opacity .7s ease; }

/* Step 2: breathing */
.breath { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px; text-align: center; }
/* Breathing windows: the intro (開始呼吸 / 了解正念呼吸 / Skip) and the 正念呼吸 explanation. */
.breath-panel { position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 26px 22px 20px; box-shadow: 0 14px 40px rgba(142,79,209,.15); animation: floatup .45s ease both;
  background: color-mix(in srgb, var(--surface) 55%, transparent); } /* see-through, so today's mandala shows faintly behind */
.breath-panel h2 { margin: 0 0 10px; font-size: 20px; color: var(--quote); }
.breath .guide { font-size: 20px; color: var(--ink); margin: 0; text-wrap: balance; }
.learn-text { text-align: left; }
.learn-text p { font-size: 16px; margin: 0 0 12px; color: var(--ink); }
.learn-text h3 { font-size: 17px; margin: 16px 0 4px; color: var(--quote); }
#learn-panel { max-height: calc(100vh - 48px); max-height: calc(100svh - 48px); overflow-y: auto; }
.text-link { border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; padding: 4px 8px; cursor: pointer; }
.panel-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.small-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.small-row .ghost-btn { font-size: 14px; padding: 7px 14px; color: var(--muted); }
.breath { --m: min(72vw, 52vh, 380px); }
.breath .mandala { width: var(--m); height: auto; opacity: 0; transform: scale(.8); transition: opacity 1.2s ease; position: absolute;
  filter: drop-shadow(0 2px 3px rgba(60,30,80,.16)) drop-shadow(0 16px 28px rgba(60,30,80,.24)); } /* like a real disc on the table */
.breath .mandala.ghost { opacity: .22; } /* faintly behind the intro window */
.breath .mandala.show { opacity: 1; }
.breath .mandala.breathing { animation: breathe 8s ease-in-out 3; }
/* Each half is 4 s ease-in-out: slowly grows while breathing in, slowly shrinks while breathing out. */
@keyframes breathe { 0%, 100% { transform: scale(.8); } 50% { transform: scale(1.08); } }
/* 吸氣 / 呼氣 sits above the mandala in a soft hand-written font. */
.breath-word { position: absolute; left: 0; right: 0; bottom: calc(50% + var(--m) * .54 + 10px); font-size: 40px; font-weight: 400; letter-spacing: .3em; color: #5e4577; margin: 0; min-height: 1.4em; transition: opacity .6s ease; }
.skip { position: absolute; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.breath-word.glowing { animation: glow 8s ease-in-out 3; } /* brightens on 吸氣, dims on 呼氣, in step with the mandala */
@keyframes glow { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.breath.leaving .mandala, .breath.leaving .breath-word { opacity: 0; animation: none; }
@media (prefers-reduced-motion: reduce) {
  .tube-btn img { animation: none; }
  .breath .mandala.breathing { animation: none; transform: scale(.95); }
  .breath-word.glowing { animation: none; }
}

/* Step 3: the quote */
/* The quote card fills about 2/3 of a phone screen so the quote is the focus. */
.result { animation: rise .8s ease both; min-height: 64vh; min-height: 64svh; display: flex; flex-direction: column; justify-content: center; }
.result[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.small-label { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.picked { margin: 14px auto 20px; width: 100%; max-width: 520px; font-size: 28px; line-height: 1.6; padding: 40px 22px 40px 38px; border-radius: 12px;
  background: linear-gradient(90deg, #f6a9c8 0 16px, #f3e4c8 16px); color: #6b3f8f; text-align: left; }
/* The quote's illustrated card; the text card behind it is kept for screen readers only. */
.picked-card { display: block; margin: 14px auto 20px; width: 100%; max-width: 520px; height: auto; aspect-ratio: 1; border-radius: 12px;
  background: #f3e4c8; box-shadow: 0 10px 30px rgba(142,79,209,.18); }
.picked-card[hidden] { display: none; }
.picked.as-card { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sit { color: var(--ink) !important; }
.actions { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin: 14px auto 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ghost-btn { display: block; text-align: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: 10px 12px; font: inherit; font-size: 15px; text-decoration: none; cursor: pointer; }
.ghost-btn:hover { border-color: var(--pink); background: var(--pink-soft); }

.share-btn { border-color: var(--quote); color: var(--quote); }

/* 📸 share card preview */
.share-box { width: 100%; max-width: 380px; max-height: calc(100vh - 32px); max-height: calc(100svh - 32px); overflow-y: auto; background: var(--surface);
  border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; text-align: center; animation: floatup .45s ease both; }
.share-box h2 { margin: 0 0 4px; font-size: 19px; color: var(--quote); }
#share-img { display: block; width: auto; max-width: 100%; max-height: 56vh; max-height: 56svh; margin: 0 auto; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.share-box { position: relative; }
.share-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }

/* Step 4: the letter */
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(40,25,35,.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.letter { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--paper); color: #4a3a2e;
  border-radius: 18px; padding: 20px 20px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: floatup .45s ease both;
  background-image: repeating-linear-gradient(transparent 0 29px, rgba(170,140,100,.13) 29px 30px); }
@keyframes floatup { from { opacity: 0; transform: translateY(24px); } }
.letter h2 { margin: 0 0 10px; font-size: 19px; color: var(--quote); text-align: center; }
.letter p { font-size: 15px; margin: 0 0 12px; color: #4a3a2e !important; }
.letter .ask { font-size: 17px; margin-top: 14px; color: #3a2a2f !important; }
.letter .sign { text-align: left; font-size: 17px; color: var(--quote) !important; margin-top: -4px; }
.letter .privacy { font-size: 13px; color: #7a6450 !important; }
.letter-quote { margin: 6px 0 10px; padding: 10px 14px; border-left: 4px solid #f6a9c8; background: rgba(255,255,255,.55); border-radius: 8px;
  font-weight: 700; color: #6b3f8f; }
.letter-quote small { display: block; font-weight: 400; font-size: 12px; color: #8a7479; margin-top: 4px; }
.letter textarea { display: block; width: 100%; font: inherit; font-size: 16px; color: #3a2a2f; background: rgba(255,255,255,.8);
  border: 1px solid #e6d6b8; border-radius: 12px; padding: 10px 12px; resize: vertical; }
.count { text-align: right; font-size: 12px !important; margin: 4px 0 !important; color: #8a7479 !important; }
.thanks { text-align: center; color: var(--quote) !important; }
.letter .buy { margin-top: 4px; }
.letter .ghost-btn { width: 100%; margin-top: 8px; background: transparent; }
@media (prefers-color-scheme: dark) {
  .picked { color: #4b2a66; }
  .breath-word { color: #d9c3ef; }
}
