:root {--plum:#2b2034;--dark:#201728;--saffron:#e5a646;--rose:#d47678;--cream:#fff8ed;--paper:#f5ecdc;--line:#dacbb6;--muted:#726675}
* {box-sizing:border-box}
body {margin:0;background:var(--cream);color:var(--plum);font:16px/1.5 Inter,"Noto Sans Devanagari",Arial,sans-serif}
button {font:inherit}
button {cursor:pointer}
.eyebrow {color:#e9b35e;letter-spacing:.16em;text-transform:uppercase;font-size:.76rem;font-weight:800}
.answer-card {position:relative;width:min(280px,70vw);aspect-ratio:2/3;z-index:1;cursor:pointer}
.answer-card-inner {width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .75s cubic-bezier(.2,.8,.2,1);box-shadow:16px 22px 22px #160e1e77}
.answer-card.revealed .answer-card-inner {transform:rotateY(180deg)}
.answer-face {position:absolute;inset:0;backface-visibility:hidden;border:7px solid #dfaa5a;outline:1px solid #fff1c3;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.answer-back {background:repeating-radial-gradient(circle at 50% 50%,#a85159 0 13px,#b85b61 14px 27px,#6f364c 28px 30px)}
.answer-arch {width:82%;height:87%;border:2px solid #f5d08a;border-radius:120px 120px 5px 5px;background:#522f4bdb;display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:0 0 0 8px #efc27955}
.answer-back-title {font:normal 3.3rem/.9 Georgia,serif;letter-spacing:-.06em;margin:20px 0;color:#fff2ce}
.answer-back-small, .answer-front-label {font-size:.66rem;font-weight:800;letter-spacing:.18em}
.answer-back-small {color:#f2ca84}
.answer-front {background:#fbedd0;color:#63394e;transform:rotateY(180deg);padding:20px;box-shadow:inset 0 0 0 8px #a2576044}
.answer-front-label {position:absolute;top:20px;color:#945166}
.answer-deity {position:absolute;top:48px;width:calc(100% - 54px);aspect-ratio:1;background-size:300% 200%;background-position:0% 0%;border:3px solid #d9a35e;box-shadow:0 6px 13px #52263833}
.answer-front strong {position:absolute;bottom:23px;min-height:95px;display:grid;place-items:center;font:normal clamp(1.25rem,2vw,1.55rem)/1.16 Georgia,serif;max-width:226px;padding:0 8px}
.answer-card:focus-visible {outline:3px solid #fff;outline-offset:12px}
@media(max-width:600px) {
.answer-card {width:235px}
.answer-front-label {font-size:.57rem}
.answer-front strong {font-size:1.28rem;min-height:78px;bottom:16px}
}
@media(prefers-reduced-motion:reduce) {
.answer-card-inner {transition:none}
}
.entry-overlay[hidden] {display:none}
.entry-overlay {position:fixed;inset:0;z-index:100;background:radial-gradient(circle at 50% 45%,#75475c 0,#3d293e 46%,#1d1428 100%);color:#fff5df;display:grid;place-items:center;padding:12px;overflow:auto}
.entry-dialog {outline:none;width:100%;max-width:620px;min-height:min(750px,96vh);display:flex;flex-direction:column;align-items:center;justify-content:space-between;text-align:center;position:relative;padding:clamp(12px,2vh,24px) 16px}
.entry-head h1 {font:normal clamp(1.3rem,3vw,1.9rem)/1.1 Georgia,serif;margin:5px 0 0}
.entry-head .eyebrow {font-size:.67rem}
.entry-card {width:min(340px,70vw,42vh);flex:none;margin:8px 0 0}
.entry-actions {display:flex;flex-direction:column;gap:7px;align-items:center}
.entry-status {min-height:19px;font-size:.78rem;color:#eed5ce}
@media(max-width:600px) {
.entry-dialog {min-height:min(670px,96vh)}
.entry-card {width:min(290px,77vw,41vh)}
.entry-head h1 {font-size:1.36rem}
}
.prayer-trigger {appearance:none;border:0;background:none;color:inherit;padding:0;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:170px;min-height:126px}
.prayer-trigger:disabled {opacity:.75;cursor:wait}
.prayer-icon {width:106px;height:106px;display:grid;place-items:center;position:relative;border:2px solid #e5b260;border-radius:50%;overflow:hidden;background:radial-gradient(circle,#eed294 0,#c58362 53%,#743e5b 100%);box-shadow:0 0 0 7px #eab97426,0 0 30px #eab97450;animation:prayer-glow 5.2s ease-in-out infinite}
.prayer-icon:before {content:"";position:absolute;inset:8px;border:1px solid #ffe6b5a8;border-radius:50%}
.pose-folded, .pose-open {position:absolute;inset:0;background-image:url("assets/namaste-poses.webp");background-size:200% 100%;background-repeat:no-repeat;filter:drop-shadow(0 3px 3px #63374755)}
.pose-folded {background-position:left center}
.pose-open {background-position:right center}
.pose-folded {animation:prayer-folded 5.2s steps(1,end) infinite}
.pose-open {opacity:0;animation:prayer-open 5.2s steps(1,end) infinite}
.prayer-hint {font-size:.79rem;font-weight:750;letter-spacing:.06em;color:#f7dfb1;min-height:1.4em;animation:prayer-hint 5.2s ease-in-out infinite}
.entry-actions .prayer-trigger {min-width:170px}
.entry-actions {gap:0}
.entry-actions .prayer-hint {color:#f7dfb1}
@keyframes prayer-glow {0%,100%{box-shadow:0 0 0 7px #eab97426,0 0 30px #eab97450}70%{box-shadow:0 0 0 12px #eab97412,0 0 42px #eab9749a}}
@keyframes prayer-folded {0%,72%,85%,100%{opacity:1}73%,84%{opacity:0}}
@keyframes prayer-open {0%,72%,85%,100%{opacity:0}73%,84%{opacity:1}}
@keyframes prayer-hint {0%,12%,59%,100%{opacity:0;transform:translateY(5px)}17%,48%{opacity:1;transform:translateY(0)}}
@media(max-width:600px) {
.prayer-trigger {min-height:113px}
.prayer-icon {width:92px;height:92px}
.pose-folded, .pose-open {font-size:3.15rem}
}
@media(prefers-reduced-motion:reduce) {
.prayer-icon, .pose-folded, .pose-open, .prayer-hint {animation:none}
.pose-folded, .prayer-hint {opacity:1}
.pose-open {display:none}
}
.entry-dialog {z-index:2}
.petal-field {position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:1}
.petal {position:absolute;top:-32px;left:var(--left);width:var(--size);height:calc(var(--size) * 1.55);border-radius:80% 10% 70% 12%;background:linear-gradient(140deg,#eb5765 0,#ba294b 48%,#711a37 100%);box-shadow:inset 2px 1px 3px #ffa0a699,0 3px 7px #250b2466;opacity:.78;animation:petal-fall var(--duration) linear var(--delay) infinite;transform-origin:50% 85%}
.petal:after {content:"";position:absolute;left:49%;top:15%;height:70%;border-left:1px solid #ffb4ab66;transform:rotate(-16deg)}
@keyframes petal-fall {0%{transform:translate3d(0,-7vh,0) rotate(12deg) rotateY(0deg);opacity:0}8%{opacity:.78}88%{opacity:.8}100%{transform:translate3d(var(--drift),115vh,0) rotate(430deg) rotateY(180deg);opacity:0}}
.answer-back {background:radial-gradient(circle at 50% 39%,#74516a 0,#3d2946 49%,#9b4c5d 100%)}
.answer-back:before {content:"";position:absolute;inset:10px;border:1px solid #e7b765a8;background:repeating-conic-gradient(from 0deg at 50% 39%,transparent 0deg 10deg,#e9bf7144 10deg 10.5deg,transparent 11deg 20deg);mask-image:radial-gradient(circle at 50% 39%,transparent 0 27%,#000 41%,transparent 61%);pointer-events:none}
.answer-arch {background:radial-gradient(circle at 50% 37%,#744c67 0,#442b4b 59%,#43243f 100%);border-color:#f5cd88;box-shadow:inset 0 0 0 8px #d1936555,0 0 0 8px #efc27955,0 0 35px #f7bf7344}
.answer-arch:before {content:"✦  ·  ✦  ·  ✦";position:absolute;top:11%;font-size:.75rem;color:#f5cf83;letter-spacing:.42em}
.answer-arch:after {content:"✧  ✧  ✧";position:absolute;bottom:12%;font-size:1.1rem;color:#e8b66c;letter-spacing:.55em}
.back-lotus {width:112px;height:112px;filter:drop-shadow(0 0 15px #eebf7788);margin-bottom:4px;animation:lotus-glow 5s ease-in-out infinite}
@keyframes lotus-glow {50%{filter:drop-shadow(0 0 28px #f3d18add);transform:scale(1.05)}}
.answer-back-title {font-size:2.8rem;margin:7px 0 13px;text-shadow:0 0 12px #fbd99877}
.answer-back-small {max-width:190px;font-size:.57rem}
.entry-ritual-row {display:flex;align-items:flex-start;gap:22px;flex-wrap:wrap}
.entry-ritual-row {justify-content:center;gap:14px}
.blessing-widget {display:flex;align-items:center;flex-direction:column;min-width:138px;margin-top:8px;text-align:center}
.blessing-button {display:flex;flex-direction:column;align-items:center;gap:4px;background:none;border:0;color:#f5dbb0;padding:0;min-height:116px}
.blessing-button svg {width:84px;height:84px;padding:10px;border:1px solid #f1c982;border-radius:50%;background:radial-gradient(circle,#834e5d,#533448);box-shadow:0 0 0 5px #e9b56b24,0 0 20px #e7a96044;transition:transform .35s,box-shadow .35s}
.blessing-button:hover:not(:disabled) svg {box-shadow:0 0 0 8px #e9b56b29,0 0 33px #f8c56a88}
.blessing-button[data-completed] {opacity:.82}
.bless-label {font-size:.77rem;font-weight:750;white-space:nowrap}
.entry-ritual-row .blessing-widget {margin-top:1px;min-width:130px}
.entry-ritual-row .blessing-button {min-height:111px}
.entry-ritual-row .blessing-button svg {width:80px;height:80px}
.entry-ritual-row .prayer-trigger {min-width:130px}
.entry-actions {gap:0}
@media(max-width:600px) {
.blessing-widget {min-width:115px}
.entry-ritual-row {gap:4px}
.entry-ritual-row .blessing-widget {min-width:115px}
.entry-ritual-row .prayer-trigger {min-width:120px}
.back-lotus {width:84px;height:84px}
.answer-back-title {font-size:2.45rem}
}
.petal-field {z-index:5}
.blessing-widget {width:170px;min-width:170px;margin-top:12px}
.blessing-button {width:170px;min-height:126px;gap:4px}
.blessing-button svg {width:106px;height:106px;padding:10px;border-width:2px;box-shadow:0 0 0 7px #eab97426,0 0 30px #eab97450;animation:diya-glow 5.2s ease-in-out infinite}
.blessing-button svg path:first-child {transform-box:fill-box;transform-origin:50% 85%;animation:diya-flame 2.35s ease-in-out infinite}
.blessing-button svg path:nth-child(2) {transform-box:fill-box;transform-origin:50% 85%;animation:diya-inner-flame 1.65s ease-in-out infinite}
.bless-label {font-size:.77rem;line-height:1.4em;min-height:1.4em}
.entry-ritual-row .blessing-widget {width:170px;min-width:170px;margin-top:0}
.entry-ritual-row .blessing-button {width:170px;min-height:126px}
.entry-ritual-row .blessing-button svg {width:106px;height:106px}
.entry-ritual-row .prayer-trigger {min-width:170px}
@keyframes diya-glow {0%,100%{box-shadow:0 0 0 7px #eab97426,0 0 30px #eab97450}50%{box-shadow:0 0 0 10px #eab97416,0 0 40px #ffca72a0}}
@keyframes diya-flame {0%,100%{transform:rotate(-5deg) skewX(-3deg) scale(.94,1)}28%{transform:rotate(7deg) skewX(6deg) scale(1.08,.91)}55%{transform:rotate(-9deg) skewX(-5deg) scale(.9,1.11)}78%{transform:rotate(4deg) skewX(4deg) scale(1.02,.96)}}
@keyframes diya-inner-flame {0%,100%{transform:rotate(4deg) scale(.9,1)}45%{transform:rotate(-7deg) scale(1.12,.84)}75%{transform:rotate(8deg) scale(.85,1.09)}}
@media(max-width:600px) {
.blessing-widget, .entry-ritual-row .blessing-widget {width:120px;min-width:120px;margin-top:0}
.blessing-button, .entry-ritual-row .blessing-button {width:120px;min-height:113px}
.blessing-button svg, .entry-ritual-row .blessing-button svg {width:92px;height:92px}
.entry-ritual-row .prayer-trigger {min-width:120px}
}
.answer-back-title {font:normal clamp(1.55rem,2vw,2rem)/1.42 "Noto Serif Devanagari",Georgia,serif;letter-spacing:.02em;margin:22px 0 12px;color:#ffe7ac;text-shadow:0 0 18px #fbd99899}
.answer-back-small {font-size:.63rem;line-height:1.5;letter-spacing:.12em;max-width:220px}
.back-lotus {width:126px;height:126px}
.answer-card {transform-style:preserve-3d;will-change:transform}
.answer-card-inner {transition:transform .94s cubic-bezier(.18,.72,.18,1.02),box-shadow .94s ease}
.answer-card.revealed .answer-card-inner {box-shadow:-12px 21px 28px #160e1e77}
.answer-card.drawing {animation:draw-lift 1.16s cubic-bezier(.18,.74,.23,1) both}
.answer-card.covering {animation:cover-settle .9s ease-in-out both}
@keyframes draw-lift {0%{transform:translate3d(0,0,0) rotateZ(0) scale(1)}24%{transform:translate3d(0,-22px,42px) rotateZ(-4deg) scale(1.055)}65%{transform:translate3d(0,-13px,28px) rotateZ(2deg) scale(1.03)}100%{transform:translate3d(0,0,0) rotateZ(0) scale(1)}}
@keyframes cover-settle {0%{transform:translate3d(0,0,0) rotateZ(0)}35%{transform:translate3d(0,-11px,20px) rotateZ(2deg)}100%{transform:translate3d(0,0,0) rotateZ(0)}}
.bless-label {animation:prayer-hint 5.2s ease-in-out infinite}
.blessing-button svg {animation:prayer-glow 5.2s ease-in-out infinite}
.music-toggle {position:fixed;top:max(18px,calc(env(safe-area-inset-top) + 8px));right:max(18px,calc(env(safe-area-inset-right) + 8px));z-index:120;display:inline-flex;align-items:center;gap:8px;padding:9px 13px;border:1px solid #e9bd70;border-radius:24px;background:#302239eb;color:#ffe2a4;box-shadow:0 6px 22px #1c10298a;font-size:.78rem;font-weight:700}
.music-toggle[aria-pressed="true"] {background:#633e57}
@media(max-width:600px) {
.back-lotus {width:102px;height:102px}
.answer-back-title {font-size:1.43rem}
.answer-back-small {font-size:.54rem;max-width:170px}
}
.entry-actions {width:100%}
.music-toggle {width:44px;height:44px;min-width:44px;justify-content:center;padding:0;border-radius:50%;font-size:1.33rem;line-height:1;touch-action:manipulation}
.music-toggle[aria-pressed="true"] {box-shadow:0 0 0 4px #eab97428,0 6px 22px #1c10298a}
@media(max-width:600px) {
.entry-overlay {padding:8px;overflow-y:auto;overscroll-behavior:contain}
.entry-dialog {min-height:min(640px,96dvh);padding:8px 8px 16px;gap:7px;justify-content:center}
.entry-head {flex:none}
.entry-card {width:min(260px,68vw,36dvh);margin:3px 0 8px}
.entry-actions {flex:none}
.entry-ritual-row {gap:12px}
.entry-ritual-row .prayer-trigger, .entry-ritual-row .blessing-widget, .entry-ritual-row .blessing-button {width:118px;min-width:118px}
.entry-status {min-height:17px}
}
@media(max-width:380px) {
.entry-dialog {min-height:96dvh}
.entry-card {width:min(230px,64vw,34dvh)}
.entry-ritual-row {gap:5px}
.entry-ritual-row .prayer-trigger, .entry-ritual-row .blessing-widget, .entry-ritual-row .blessing-button {width:112px;min-width:112px}
}
@media(prefers-reduced-motion:reduce) {
.petal {display:none}
.back-lotus, .blessing-button svg, .blessing-button svg path:first-child, .blessing-button svg path:nth-child(2), .bless-label, .answer-card.drawing, .answer-card.covering {animation:none}
.answer-card-inner {transition:none}
}
.answer-card {isolation:isolate;filter:drop-shadow(0 17px 15px #160f2088)}
.answer-card::before, .answer-card::after {content:"";position:absolute;inset:3px;border:7px solid #d9a65e;outline:1px solid #fff0bd92;pointer-events:none;transition:transform .9s cubic-bezier(.2,.8,.2,1)}
.answer-card::before {z-index:0;background:linear-gradient(135deg,#593449,#a75464 55%,#442a46);transform:translate(-17px,10px) rotate(-8deg);box-shadow:0 15px 20px #150e1f77}
.answer-card::after {z-index:1;background:radial-gradient(circle at 50% 42%,#a9636e,#482b47 70%);transform:translate(17px,9px) rotate(7deg);box-shadow:0 11px 16px #150e1f88}
.answer-card-inner {z-index:2;box-shadow:2px 2px 0 #ffdd97,5px 5px 0 #ae744f,9px 11px 20px #160e1eaa}
.answer-face {box-shadow:inset 0 0 0 2px #fff4d59c,inset 0 0 25px #24172b75}
.answer-card.drawing::before {transform:translate(-23px,13px) rotate(-11deg)}
.answer-card.drawing::after {transform:translate(23px,11px) rotate(9deg)}
.entry-dialog {min-height:min(750px,96vh);justify-content:flex-start;gap:13px}
.entry-head {margin-top:2px;flex:none}
.entry-head h1 {font-size:clamp(1.25rem,2.5vw,1.7rem)}
.entry-card {width:min(330px,68vw,43vh);margin:8px 0 10px}
.entry-actions {margin-top:3px}
.entry-status {min-height:16px}
@media(max-width:600px) {
.entry-dialog {min-height:0;height:auto;max-height:none;gap:5px;justify-content:flex-start;padding:11px 8px 18px}
.entry-head {margin-top:7px}
.entry-head h1 {font-size:1.2rem;margin-top:1px}
.entry-card {width:min(265px,68vw,39dvh);margin:5px 0 11px}
.entry-actions {margin-top:0}
.entry-ritual-row {gap:8px}
.answer-card::before {transform:translate(-12px,7px) rotate(-6deg)}
.answer-card::after {transform:translate(12px,6px) rotate(6deg)}
}
@media(max-width:380px) {
.entry-card {width:min(238px,65vw,35dvh)}
.entry-dialog {gap:3px}
}
@media(prefers-reduced-motion:reduce) {
.answer-card::before, .answer-card::after {transition:none}
}
.answer-card {--card-lift:48px;--card-rest:13px;perspective:1100px}
.entry-card {--card-lift:34px;--card-rest:12px}
.answer-card.drawing, .answer-card.covering {animation:none}
.answer-card-inner {transition:transform .82s cubic-bezier(.18,.82,.2,1),box-shadow .82s ease;transform:translate3d(0,0,0) rotateY(0) scale(1);transform-origin:50% 50%;will-change:transform}
.answer-card.drawing:not(.revealed) .answer-card-inner {transform:translate3d(0,calc(-1 * var(--card-lift)),42px) rotateZ(-3deg) rotateY(0) scale(1.07);box-shadow:1px 4px 0 #ffde9b,4px 9px 0 #aa734e,18px 31px 30px #100b19b0}
.answer-card.drawing.revealed .answer-card-inner {transform:translate3d(0,calc(-1 * var(--card-lift)),48px) rotateZ(2deg) rotateY(180deg) scale(1.08);box-shadow:-1px 4px 0 #ffde9b,-5px 10px 0 #aa734e,-18px 34px 35px #100b19b0}
.answer-card.revealed:not(.drawing):not(.covering) .answer-card-inner {transform:translate3d(0,calc(-1 * var(--card-rest)),25px) rotateY(180deg) scale(1.035);box-shadow:-1px 3px 0 #ffde9b,-5px 7px 0 #aa734e,-14px 25px 26px #100b19a0}
.answer-card.covering.revealed .answer-card-inner {transform:translate3d(0,calc(-1 * var(--card-lift)),36px) rotateZ(2deg) rotateY(180deg) scale(1.06)}
.answer-card.covering:not(.revealed) .answer-card-inner {transform:translate3d(0,calc(-1 * var(--card-lift) * .48),23px) rotateZ(-2deg) rotateY(0) scale(1.035)}
@media(max-width:600px) {
.answer-card {--card-lift:32px;--card-rest:9px}
.entry-card {--card-lift:25px;--card-rest:7px}
}
@media(prefers-reduced-motion:reduce) {
.answer-card-inner {transition:none}
}
/* Keep the answer out of the locked preview. The parchment seal is its own decorative face. */
.answer-mist { display: none }
.gate-pending .answer-back { visibility: hidden }
.gate-pending .answer-mist {
  display: block;
  border: 0;
  outline: 0;
  box-shadow: none;
  transform: translateZ(var(--half-stock));
  background: #65452c url("/assets/third-card-seal.webp") center / 103% 103% no-repeat;
}
.answer-front {background:#21172b;overflow:hidden;padding:0}
.answer-deity {position:absolute;inset:8px;top:8px;width:calc(100% - 16px);height:calc(100% - 16px);background-size:450% 200%;background-repeat:no-repeat;border:0;box-shadow:none;z-index:0}
.answer-front::after {content:"";position:absolute;inset:34% 0 0;background:linear-gradient(transparent 4%,#1c1229ae 54%,#170e25f5 100%);z-index:1;pointer-events:none}
.answer-front-label {
  top: 22px;
  z-index: 2;
  padding: 4px 8px;
  background: #281729d9;
  letter-spacing: .055em;
}
.answer-front .answer-message {
  z-index: 2;
  bottom: clamp(9px, 4%, 24px);
  gap: .25rem;
  width: 94%;
  max-width: none;
  min-height: 0;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.4;
  text-wrap: balance;
}
.card-caption {order:6;max-width:min(480px,88vw);min-height:0;color:#ffe5b3;font-size:.86rem;line-height:1.42;text-align:center;text-wrap:balance;letter-spacing:.01em}
.card-caption:not(.visible) {display:none}
.card-caption.visible {display:block;margin:10px auto 0;padding:10px 18px;border:1px solid #e8bb7855;background:#281b33d9;border-radius:4px;box-shadow:0 5px 18px #180f2677}
.entry-caption {width:min(470px,90vw);margin:4px auto 0!important;font-size:.83rem}
.entry-dialog {gap:9px}
@media(max-width:600px) {
.answer-front-label {font-size:.55rem;top:18px}
.answer-front .answer-message {font-size:clamp(.875rem,4vw,1.12rem)}
.card-caption {font-size:.76rem;max-width:92vw}
.card-caption.visible {padding:8px 12px;margin-top:7px}
.entry-caption {font-size:.76rem;line-height:1.35}
.entry-dialog {gap:5px}
}
@media(max-width:600px) {
.entry-card {width:min(245px,65vw,35dvh)}
.entry-dialog {gap:3px}
.entry-caption {max-width:92vw}
.entry-status {min-height:14px}
}
@media(max-width:380px) {
.entry-card {width:min(220px,62vw,33dvh)}
}
.card-caption, .card-caption:not(.visible), .card-caption.visible, .card-caption.leaving {display:block;position:fixed;left:50%;top:54%;width:min(530px,86vw);max-width:none;margin:0!important;padding:18px 24px;min-height:64px;z-index:15;pointer-events:none;border:1px solid #f3d492b8;border-radius:10px;background:linear-gradient(135deg,#1e132cdc,#52364ad9 60%,#28192fe8);color:#fff2d1;box-shadow:0 18px 45px #0f091dba,inset 0 0 0 1px #fff0bb2a,0 0 35px #f6c87945;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);font:normal clamp(.94rem,1.45vw,1.12rem)/1.48 Georgia,"Noto Serif Devanagari",serif;letter-spacing:.015em;text-align:center;text-wrap:balance;opacity:0;transform:translate(-50%,-46%) perspective(900px) rotateX(10deg) scale(.94);transition:opacity .85s ease,transform .85s cubic-bezier(.2,.8,.2,1)}
.card-caption.visible {opacity:1;transform:translate(-50%,-50%) perspective(900px) rotateX(0) scale(1)}
.card-caption.leaving {opacity:0;transform:translate(-50%,-56%) perspective(900px) rotateX(-6deg) scale(.98)}
@media(max-width:600px) {
.card-caption, .card-caption:not(.visible), .card-caption.visible, .card-caption.leaving {top:50%;width:calc(100vw - 36px);padding:14px 16px;min-height:58px;font-size:.94rem;line-height:1.43}
}
@media(prefers-reduced-motion:reduce) {
.card-caption, .card-caption.visible, .card-caption.leaving {transition:none;transform:translate(-50%,-50%)}
}
html { background: #1d1428 }
body { margin: 0 }
.entry-overlay {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
}
.entry-dialog { min-height: 0; padding: 10px 8px; gap: 10px }
.entry-head h1 {
  font-size: clamp(1.7rem, 5vw, 2.65rem);
  color: #fff0d0;
  letter-spacing: -.025em;
}
.book-prompt { color: #eed5ce; margin: 5px 0 16px; font-size: .95rem }
.entry-card { margin-bottom: 16px }
.book-note { margin: 0; color: #eed5ce; font-size: .8rem }
.entry-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.prayer-hint, .bless-label { animation: none; opacity: 1 }
.entry-ritual-row { flex-wrap: nowrap; gap: 4px }
button:focus-visible { outline: 2px solid #ffd58d; outline-offset: 4px }
.card-caption:not(.visible):not(.leaving) { visibility: hidden }
@media(max-width:600px) {
  .entry-overlay:not(.fortune-stage) {
    align-items: start;
    padding-top: max(28px, calc(env(safe-area-inset-top) + 28px));
  }
  .entry-dialog { gap: 4px; padding-top: 4px }
  .entry-head { margin-top: 0 }
  .entry-head h1 { font-size: clamp(1.55rem, 6.5vw, 2rem) }
  .book-prompt { margin-bottom: 6px }
  .entry-card { margin-bottom: 11px }
  .entry-ritual-row { gap: 12px }
  .entry-ritual-row .prayer-trigger,
  .entry-ritual-row .blessing-widget,
  .entry-ritual-row .blessing-button { width: 108px; min-width: 108px }
  .entry-ritual-row .prayer-trigger,
  .entry-ritual-row .blessing-button { min-height: 0; gap: 3px }
  .prayer-icon,
  .entry-ritual-row .blessing-button svg {
    width: clamp(62px, 18vw, 74px);
    height: clamp(62px, 18vw, 74px);
  }
  .entry-ritual-row .blessing-button svg { padding: 7px }
  .prayer-hint, .bless-label { font-size: .875rem; line-height: 1.4 }
  .music-toggle {
    top: calc(env(safe-area-inset-top) + 8px);
    right: calc(env(safe-area-inset-right) + 8px);
  }
}

.home-screen-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #e9bd7080;
  border-radius: 24px;
  background: #302239;
  color: #ffe2a4;
  font-size: .875rem;
}
.home-screen-button[hidden] { display: none }
.home-screen-button svg { width: 18px; height: 18px }

.home-screen-reminder {
  display: grid;
  gap: 2px;
  margin: 2px 0 0;
  color: #ffe2a4;
  font-size: .875rem;
  line-height: 1.35;
}
.home-screen-reminder[hidden],
.home-screen-reminder [lang="zh-CN"],
html:lang(zh) .home-screen-reminder [lang="en"] { display: none }
html:lang(zh) .home-screen-reminder [lang="zh-CN"] { display: block }

.home-screen-dialog {
  width: min(410px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  padding: 16px;
  border: 1px solid #e9bd70;
  border-radius: 20px;
  background: #302239;
  color: #fff2d1;
  box-shadow: 0 18px 56px #160e1eb3;
}
dialog button, dialog a { touch-action: manipulation }
.home-screen-dialog [hidden] { display: none }
.home-screen-dialog::backdrop { background: #170d21bd }
.install-header { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.install-header h2 { margin: 0; font: clamp(1.22rem, 5.5vw, 1.55rem)/1.15 Georgia, serif }
.home-screen-dialog button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #e9bd7070;
  border-radius: 12px;
  background: #46314e;
  color: #fff2d1;
  font-size: .875rem;
  font-weight: 700;
}
.home-screen-dialog button:disabled { opacity: .55; cursor: default }
.home-screen-dialog .install-close {
  width: 44px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}
.install-platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 }
.install-platforms button[aria-pressed="true"],
#install-next,
#install-done button {
  border-color: #f5cf83;
  background: #f5cf83;
  color: #2b2034;
}
.install-demo {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 12px 10px 4px;
  border: 1px solid #e9bd7040;
  border-radius: 16px;
  background: #251a2e;
}
.install-phone {
  display: grid;
  width: min(100%, 236px);
  min-height: 216px;
  padding: 5px;
  overflow: hidden;
  border: 2px solid #806587;
  border-radius: 24px;
  background: #13101a;
}
.install-scene {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-radius: 17px;
  background: #eeeaf3;
  color: #262034;
  font-size: .875rem;
  line-height: 1.25;
  animation: install-reveal 220ms ease-out;
}
.install-safari { grid-template-rows: 1fr auto }
.install-chrome { grid-template-rows: auto 1fr }
.install-webpage {
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid #b5815655;
  border-radius: 12px;
  background: radial-gradient(ellipse at center, #684057, #2e213a 75%);
  color: #ffedbe;
  font: 1.15rem/1.2 Georgia, serif;
  text-align: center;
}
.install-toolbar { display: flex; align-items: center; gap: 7px; color: #28243f }
.install-address, .install-row { padding: 8px; border-radius: 8px; background: #e1dce9 }
.install-address { flex: 1; min-width: 0; text-align: center }
.install-sheet { align-content: end; padding-bottom: 12px }
.install-menu { align-content: start }
.install-handle { justify-self: center; width: 34px; height: 4px; border-radius: 9px; background: #a49aaf }
.install-muted { color: #514962; font-size: .8125rem }
.install-row { display: flex; align-items: center; gap: 7px; min-height: 35px }
.install-row > span { font-size: 1rem }
.install-switch {
  flex: 0 0 32px;
  height: 18px;
  margin-inline-start: auto;
  border-radius: 12px;
  background: #247048;
}
.install-switch::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin: 2px 2px 2px auto;
  border-radius: 50%;
  background: #fff;
}
.install-target {
  position: relative;
  overflow: hidden;
  outline: 1px solid #a66500;
  background: #ffe6ab;
  color: #3e280e;
  font-weight: 700;
}
.install-target::after {
  content: "";
  position: absolute;
  inset: 50% 4px auto auto;
  width: 18px;
  height: 18px;
  border: 2px solid #9a5700;
  border-radius: 50%;
  background: #fff5c859;
  pointer-events: none;
  animation: install-tap 1.4s ease-out 2;
  opacity: 0;
}
.install-glyph {
  display: grid;
  place-items: center;
  width: 38px;
  height: 34px;
  border-radius: 9px;
  font-size: 1.35rem;
}
.install-glyph svg { width: 21px; height: 21px }
.install-action { justify-self: end; padding: 6px 12px; border-radius: 8px }
.install-result {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  justify-items: center;
  align-items: start;
  gap: 12px;
  background: radial-gradient(ellipse at 75% 0%, #743c69, #2e2145 75%);
  color: #fff2d1;
}
.install-shortcut { display: grid; justify-items: center; gap: 4px; text-align: center }
.install-shortcut img { display: block; border-radius: 16px; box-shadow: 0 0 0 2px #ffd388, 0 0 15px #ffd38870 }
.install-placeholder { width: 64px; max-width: 100%; aspect-ratio: 1; border-radius: 16px; background: #fff1d428 }
.install-caption { width: 100%; min-height: 3.5em; text-align: center }
.install-caption p { margin: 0; font-size: .875rem; line-height: 1.35 }
.install-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.install-controls form button { width: 100% }
.install-progress { color: #f3d6a1; font-size: .875rem; font-variant-numeric: tabular-nums }
#install-native, #install-already-added { width: 100%; margin-top: 8px }
@keyframes install-reveal {
  from { opacity: .5; transform: translateY(4px) }
}
@keyframes install-tap {
  0%, 20% { opacity: 0; transform: translateY(-50%) scale(.55) }
  40% { opacity: 1 }
  80%, 100% { opacity: 0; transform: translateY(-50%) scale(1.8) }
}
@media (prefers-reduced-motion: reduce) {
  .install-scene, .install-target::after { animation: none }
}

.draw-notice { margin: 0; color: #ffe1a6; font-size: .875rem }
.answer-face[hidden], .fortune-caption[hidden], .fortune-light[hidden] { display: none }
.fortune-stage { background: #240b13 }
.fortune-stage .entry-dialog { gap: 14px; padding-block: 12px }
.fortune-stage .entry-head,
.fortune-stage .entry-actions,
.fortune-stage .home-screen-button,
.fortune-stage .home-screen-reminder,
.fortune-stage .draw-notice,
.fortune-stage .book-note,
.fortune-stage .petal-field { display: none }
.fortune-stage .entry-card {
  width: min(454px, 84vw, max(148px, calc((100dvh - var(--fortune-panel-space, 183px)) * .65)));
  margin: 0;
  --card-lift: 7px;
  --card-rest: 0px;
}
.fortune-stage .entry-card::before,
.fortune-stage .entry-card::after { opacity: 0 }
.fortune-stage .entry-card.revealed:not(.covering) {
  animation: fortune-arrival 760ms cubic-bezier(.18,.86,.28,1.05) both,
    fortune-hover 5s 760ms ease-in-out infinite;
}
@media (orientation: landscape) and (max-height: 550px) {
  .fortune-stage .entry-dialog {
    display: grid;
    grid-template-columns: auto minmax(0, 320px);
    width: min(96vw, 730px);
    justify-content: center;
    gap: clamp(12px, 4vw, 42px);
  }
  .fortune-stage .entry-card { width: min(40vw, calc((100dvh - 64px) * .65)) }
}
@keyframes fortune-arrival {
  0% { transform: scale(.62) }
  72% { transform: scale(1.035) }
  100% { transform: scale(1) }
}
@keyframes fortune-hover {
  0%, 100% { translate: 0 0 }
  50% { translate: 0 -7px }
}
.fortune-face {
  overflow: hidden;
  transform: rotateY(180deg);
  border: 3px solid #f8d378;
  outline: 1px solid #ffefaa;
  background: #5c2319;
  box-shadow: 0 0 24px #fff1a2dc, 0 0 58px #f5b739b9, 0 0 100px #e5822a84;
}
.fortune-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fortune-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(117deg, transparent 35%, #fff3be73 49%, #fffde5b5 51%, transparent 61%);
  background-size: 300% 100%;
  mix-blend-mode: screen;
  animation: fortune-card-shine 6.8s 600ms ease-in-out infinite;
}
@keyframes fortune-card-shine {
  0% { background-position: 100% 0 }
  34%, 100% { background-position: 0 0 }
}
.fortune-name {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 1px;
  padding: 14px 3px 7px;
  background: linear-gradient(transparent, #351007f2 60%);
  font-size: clamp(.88rem, 4vw, 1.28rem);
  line-height: 1.35;
}
.fortune-caption {
  position: relative;
  z-index: 5;
  width: min(466px, 100%);
  padding: 12px;
  border: 1px solid #ebc579;
  border-radius: 15px;
  background: linear-gradient(140deg, #2b1019f2, #55331cde 52%, #2d1119ef);
  color: #fff1c1;
  box-shadow: 0 8px 24px #251122ad, 0 0 24px #f3bc5363, inset 0 0 0 1px #ffdb8136;
  backdrop-filter: blur(12px);
  animation: show-fortune-caption 480ms ease-out both;
}
.fortune-message {
  display: grid;
  gap: 3px;
  margin: 0 0 9px;
  font: 700 clamp(.98rem, 4.05vw, 1.23rem)/1.24 Georgia, serif;
}
.fortune-caption .fortune-copy-hi {
  color: #ffdd9d;
  font-family: "Noto Sans Devanagari", Mangal, sans-serif;
  font-size: .86em;
  line-height: 1.28;
}
.fortune-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(360px, 100%);
  margin-inline: auto;
}
.fortune-actions > :not([hidden]) {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 50px;
  padding: 6px 5px;
  font-size: clamp(.76rem, 3.45vw, .94rem);
  font-weight: 700;
  line-height: 1.2;
}
.fortune-close {
  border: 1px solid #e5c27e94;
  border-radius: 12px;
  color: #fff0cf;
  background: #371620;
  font: inherit;
}
.fortune-caption span { white-space: nowrap }
.fortune-copy-zh, html:lang(zh) .fortune-copy-en { display: none }
html:lang(zh) .fortune-copy-zh { display: inline }
.fortune-actions .luck-journey .fortune-copy-hi { color: #593515 }
.luck-unavailable {
  border: 1px solid #e6bb6a8c;
  border-radius: 12px;
  background: #79512865;
  color: #ffe2a7;
  cursor: default;
  font: inherit;
}
.fortune-link-note {
  display: none;
  gap: 1px;
  margin: 6px 0 0;
  color: #ffe2b0;
  font-size: .75rem;
  line-height: 1.2;
}
.fortune-actions:has(.luck-unavailable:not([hidden])) + .fortune-link-note { display: grid }
@media (max-width: 600px) and (orientation: portrait) {
  .fortune-stage { --fortune-panel-space: 215px }
  .fortune-stage .entry-dialog { gap: 9px; padding-block: 6px }
  .fortune-caption { padding: 9px 8px }
}
.fortune-light {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, #ffd4784e, transparent 51%, #210b179a 100%),
    url("assets/fortune-jewels.webp") center / cover #3b121a;
}
@media (max-aspect-ratio: 3/4) {
  .fortune-light { background-position: center, 8% center }
}
.fortune-light::before {
  position: absolute;
  inset: -45%;
  content: "";
  background: repeating-conic-gradient(from -6deg, #ffdd9860 0deg, #f9a43815 10deg, transparent 18deg 29deg);
  mask-image: radial-gradient(ellipse, #000 12%, #000b 39%, transparent 69%);
  mix-blend-mode: screen;
  animation: fortune-rays 34s linear infinite;
}
.fortune-light::after {
  content: "";
  position: absolute;
  inset: -45%;
  background:
    radial-gradient(ellipse, #fff5c0 2%, #ffc74a 14%, #ffa22760 31%, transparent 52%),
    radial-gradient(ellipse, transparent 29%, #fff6b4a6 33%, #ffbd5180 35%, transparent 47%);
  mix-blend-mode: screen;
  animation: fortune-burst 980ms cubic-bezier(.13,.68,.19,1) both;
}
.fortune-light i {
  position: absolute;
  top: var(--spark-y);
  left: var(--spark-x);
  width: var(--spark-size);
  aspect-ratio: 1;
  z-index: 1;
  animation: fortune-drift var(--spark-duration) var(--spark-delay) ease-in-out infinite;
}
.fortune-spark {
  background: radial-gradient(circle, #fffdee 16%, #ffdf83 54%, #e7a241 85%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
}
.fortune-gem {
  background: conic-gradient(from 35deg, #fff9eb, #b06150, #ffe5ad, #a63b5c, #fff9eb);
  clip-path: polygon(18% 18%, 77% 8%, 98% 42%, 53% 97%, 1% 46%);
}
.fortune-gem:nth-child(even) {
  background: conic-gradient(from 35deg, #f8ffe0, #579f87, #dcffd7, #326448, #f8ffe0);
}
.fortune-light .fortune-dust {
  width: calc(var(--spark-size) * .34);
  border-radius: 50%;
  background: #ffdf9b;
  box-shadow: 0 0 14px 4px #ffb564a6;
}
@keyframes fortune-rays {
  to { transform: rotate(1turn) }
}
@keyframes fortune-burst {
  0% { opacity: .14; transform: scale(.25) }
  22% { opacity: 1 }
  100% { opacity: 0; transform: scale(1.85) }
}
@keyframes fortune-drift {
  0%, 100% { opacity: .52; transform: translate3d(-9px, 15px, 0) rotate(-12deg) scale(.73) }
  50% { opacity: 1; transform: translate3d(13px, -28px, 0) rotate(15deg) scale(1.12) }
}
@keyframes show-fortune-caption {
  from { opacity: 0; transform: translateY(6px) }
}
@media (prefers-reduced-motion: reduce) {
  .fortune-stage .entry-card.revealed:not(.covering),
  .fortune-light::before, .fortune-light i, .fortune-face::after, .fortune-caption { animation: none }
  .fortune-light::after, .fortune-face::after { display: none }
}
.luck-journey, .campaign-primary, .campaign-secondary {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 7px 16px;
  border: 1px solid #efc574;
  border-radius: 12px;
  background: #f5cf83;
  color: #302239;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.luck-journey { box-shadow: 0 0 16px #efbb5266; color: #432711; font-size: .95rem }
.luck-journey[hidden], .luck-unavailable[hidden], .campaign-dialog [hidden] { display: none }
#coin-shower { position: fixed; inset: 0; z-index: 110; pointer-events: none; overflow: hidden }
#coin-shower i {
  position: absolute;
  top: -34px;
  left: var(--coin-x);
  width: var(--coin-size);
  aspect-ratio: 1;
  border: 2px solid #fff1a6;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #fff9a8, #f3b234 62%, #b96812);
  box-shadow: 0 0 10px #ffbf50b8, inset 0 0 0 2px #b67120;
  animation: drop-coin var(--coin-duration) var(--coin-delay) ease-in both;
}
@keyframes drop-coin {
  from { opacity: 0; transform: translateY(-30px) rotateY(0) }
  12%, 86% { opacity: 1 }
  to { opacity: 0; transform: translate(32px, 106dvh) rotateY(660deg) }
}
.campaign-dialog {
  width: min(430px, calc(100% - 24px));
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  padding: 18px;
  border: 1px solid #e9bd70;
  border-radius: 20px;
  background: #302239;
  color: #fff2d1;
  box-shadow: 0 18px 56px #160e1eb3;
}
.campaign-dialog::backdrop { background: #170d21bd }
.campaign-dialog p { margin: 10px 0; font-size: .95rem }
.campaign-dialog .install-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #e9bd7070;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.35rem;
}
.campaign-dialog .campaign-primary, .campaign-dialog .campaign-secondary { width: 100% }
.campaign-secondary, .campaign-text-button { background: #46314e; color: #fff2d1 }
.campaign-text-button { min-height: 44px; margin-top: 6px; padding: 0 9px; border: 0; border-radius: 8px }
.campaign-message { color: #ffda8e }
.campaign-message:empty { display: none }
.channel-verify-fallback { display: inline-block; margin-top: 10px; font-size: .82rem; color: inherit }

.share-dialog h2 { font-size: clamp(1.2rem, 5vw, 1.45rem) }
#campaign-reward { margin: 4px 0 8px; color: #fff2d1; line-height: 1.45 }
.invitation-domain { display: inline-block; margin-top: 4px; color: inherit }
.invitation-domain:focus-visible { outline: 2px solid #ffd58d; outline-offset: 4px }
.share-zh, html:lang(zh) .share-en { display: none }
html:lang(zh) .share-zh { display: inline }
.share-button-row { display: grid; gap: 8px; margin-top: 12px }
.share-button-row { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr) }
.share-button-row :is(button, a) { padding-inline: 6px; font-size: .875rem }

.android-motion .answer-card { filter: none; will-change: auto }
.android-motion .answer-card-inner { transition-property: transform; transition-duration: .62s }
.android-motion .answer-card::before,
.android-motion .answer-card::after { transition-duration: .55s }
.android-motion .pose-folded, .android-motion .pose-open { filter: none }
.android-motion .back-lotus,
.android-motion .prayer-icon,
.android-motion .blessing-button svg { animation: none }
.android-motion .card-caption,
.android-motion .fortune-caption {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.android-motion .fortune-face::after {
  background-image: linear-gradient(117deg, transparent 35%, #fff3be40 49%, #fffde580 51%, transparent 61%);
  mix-blend-mode: normal;
}
.android-motion .fortune-light::before { animation: none; mix-blend-mode: normal }
.android-motion .fortune-light::after { inset: -12%; mix-blend-mode: normal }
.android-motion .fortune-light .fortune-dust { box-shadow: none }
.android-motion body:has(.campaign-dialog[open]) .petal,
.android-motion body:has(.campaign-dialog[open]) .pose-folded,
.android-motion body:has(.campaign-dialog[open]) .pose-open { animation-play-state: paused }
@media (prefers-reduced-motion: reduce) {
  .android-motion .answer-card-inner,
  .android-motion .answer-card::before,
  .android-motion .answer-card::after { transition: none }
}

#invitation-poster {
  display: block;
  max-width: 100%;
  max-height: 42vh;
  height: auto;
  object-fit: contain;
  margin: 8px auto 0;
  border-radius: 8px;
}

.fortune-stage .entry-card.revealed:not(.covering),
.fortune-caption { animation: none }

.drawn-card-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
}

.answer-front-label { top: clamp(19px, 6.5%, 34px); z-index: 5 }
.answer-front .answer-message { bottom: 6.5%; width: 84%; z-index: 5 }
.fortune-name { inset: auto 9% 6.5%; z-index: 5 }

:is(.ritual-dialog, #campaign-dialog),
:is(.ritual-dialog, #campaign-dialog) *:not(.ritual-card-turn, #daily-victory, #daily-divination, #daily-divination *),
:is(.ritual-dialog, #campaign-dialog)::before,
:is(.ritual-dialog, #campaign-dialog)::after,
:is(.ritual-dialog, #campaign-dialog) *:not(.ritual-card-turn, #daily-divination, #daily-divination *)::before,
:is(.ritual-dialog, #campaign-dialog) *:not(.ritual-card-turn, .ritual-card-scene, #daily-divination, #daily-divination *)::after {
  animation: none !important;
  transition: none !important;
}

body:has(#campaign-dialog[open], .ritual-dialog[open]) .entry-overlay *,
body:has(#campaign-dialog[open], .ritual-dialog[open]) .entry-overlay *::before,
body:has(#campaign-dialog[open], .ritual-dialog[open]) .entry-overlay *::after {
  animation-play-state: paused;
}

/* Keep the title and actions within the visible home screen on short phones. */
.entry-overlay:not(.fortune-stage) {
  --toolbar-top: max(8px, calc(env(safe-area-inset-top) + 4px));
  padding: calc(var(--toolbar-top) + 49px) 12px max(8px, env(safe-area-inset-bottom));
}
.entry-overlay:not(.fortune-stage) .entry-dialog {
  gap: clamp(4px, 1dvh, 9px);
  padding: 0 5px;
}
.entry-overlay:not(.fortune-stage) .entry-head { margin-top: 0 }
.entry-overlay:not(.fortune-stage) .book-prompt { margin: 3px 0 4px }
.entry-overlay:not(.fortune-stage) .entry-card {
  width: min(330px, 70vw, max(120px, calc((100dvh - var(--toolbar-top) - 334px) * .63)));
  margin: 4px 0 clamp(8px, 1.6dvh, 14px);
}
.entry-overlay:not(.fortune-stage) .entry-actions { position: relative; margin-top: 0 }
.entry-overlay:not(.fortune-stage) .entry-ritual-row .prayer-trigger,
.entry-overlay:not(.fortune-stage) .entry-ritual-row .blessing-button { min-height: 0 }
.entry-overlay:not(.fortune-stage) .prayer-icon,
.entry-overlay:not(.fortune-stage) .entry-ritual-row .blessing-button svg {
  width: clamp(48px, 11dvh, 90px);
  height: clamp(48px, 11dvh, 90px);
}
.entry-overlay:not(.fortune-stage) .home-screen-button {
  position: fixed;
  z-index: 6;
  top: var(--toolbar-top);
  left: max(8px, calc(env(safe-area-inset-left) + 4px));
  min-height: 44px;
  padding-inline: 9px;
  font-size: .76rem;
}
.blessing-status {
  position: absolute;
  z-index: 6;
  bottom: calc(100% + 6px);
  inset-inline: 0;
  width: fit-content;
  max-width: min(100%, 340px);
  margin: auto;
  padding: 8px 13px;
  border: 1px solid #dcb477;
  border-radius: 10px;
  background: #302239f5;
  color: #fff1d5;
  font-size: .84rem;
  pointer-events: none;
}
.blessing-status > *, #streak-status > * { display: block; line-height: 1.45; text-align: center }
.blessing-status > strong, #streak-status > strong { margin-bottom: 2px }
.blessing-status:empty { opacity: 0 }

#open-daily:not([hidden]) {
  color: #ffe3a5;
  animation: today-fortune-glow 7s 1s ease-in-out infinite;
}
@keyframes today-fortune-glow {
  0%, 65%, 100% { background-color: #46314e; box-shadow: 0 0 0 0 #e7bd7800 }
  78% { background-color: #684c61; box-shadow: 0 0 0 2px #ffd58d9c, 0 0 15px #ffc96d97 }
  88% { background-color: #503952; box-shadow: 0 0 0 1px #ffd58d38, 0 0 8px #ffc96d58 }
}
@media (prefers-reduced-motion: reduce) {
  #open-daily:not([hidden]) { animation: none }
}

/* Independent scale preserves the transform used by the card flip. */
:is(button:enabled, [role="button"]:not([aria-disabled="true"]), a.luck-journey[href]):active {
  scale: .96;
}
@media (prefers-reduced-motion: reduce) {
  :is(button:enabled, [role="button"]:not([aria-disabled="true"]), a.luck-journey[href]):active { scale: none }
}

#entry-card .answer-back, #entry-card::before, #entry-card::after {
  background: #5d2c1b var(--lotus-card-back) center / 100% 100% no-repeat;
}
#entry-card .answer-back { border: 0; outline: 0 }
#entry-card .answer-back .answer-arch, #entry-card .answer-back::before { visibility: hidden }

#entry-card { --edge-radius: clamp(10px, 2.8vw, 17px); border-radius: var(--edge-radius) }
#entry-card .answer-card-inner, #entry-card .answer-face,
#entry-card::before, #entry-card::after { border-radius: var(--edge-radius) }
#entry-card .answer-face, #entry-card::before, #entry-card::after {
  border: 0;
  outline: 0;
  overflow: hidden;
}
#entry-card .answer-back { box-shadow: inset 0 0 0 1px #57352180 }

/* Open the side cards around a shared grip near the foot of the center card. */
.entry-overlay:not(.fortune-stage) #entry-card { max-width: 47vw }
.entry-overlay:not(.fortune-stage) #entry-card::before,
.entry-overlay:not(.fortune-stage) #entry-card::after {
  transform-origin: 50% 88%;
  transform: translateY(-6%) rotate(var(--fan-angle)) scale(.94);
  rotate: none;
  translate: none;
}
#entry-card::before { --fan-angle: -26deg }
#entry-card::after { --fan-angle: 26deg }
#entry-card:is(.drawing, .is-drawing)::before { --fan-angle: -29deg }
#entry-card:is(.drawing, .is-drawing)::after { --fan-angle: 29deg }

/* Both printed faces and the cut edge turn on the same rigid body. */
#entry-card .answer-card-inner {
  --half-stock: 1.2px;
  box-shadow: 0 1px 0 #98683f, 0 12px 20px #160e1e70;
}
#entry-card .answer-back { transform: translateZ(var(--half-stock)) }
#entry-card :is(.answer-front, .fortune-face) { transform: rotateY(180deg) translateZ(var(--half-stock)) }
#entry-card .answer-card-inner::before,
#entry-card .answer-card-inner::after {
  content: "";
  position: absolute;
  top: var(--edge-radius);
  bottom: var(--edge-radius);
  width: calc(var(--half-stock) + var(--half-stock));
  background: linear-gradient(to right, #91643f, #b38b62, #8a603e);
  transform: rotateY(90deg);
  pointer-events: none;
}
#entry-card .answer-card-inner::before { left: calc(0px - var(--half-stock)) }
#entry-card .answer-card-inner::after { right: calc(0px - var(--half-stock)) }

:root { --lotus-card-back: url("/assets/lotus-card-back.webp") }
@media (max-width: 600px) {
  :root { --lotus-card-back: url("/assets/card-back-compact.webp") }
}
