/* ความหนาของวัตถุสามชุด การเคลื่อนไหวทั้งหมดเล่นรอบเดียว */
.automatic-workspace { filter: none !important; }
.solid-fan,.solid-card,.solid-card-turn,.cup-assembly,.cup-body,.cup-stick-rack,.cup-fortune-stick,.solid-wheel,.wheel-rotor { transform-style: preserve-3d; }
.ceremony[data-presentation="cards"] .scene-heading p,.ceremony[data-presentation="sticks"] .scene-heading p,.ceremony[data-presentation="wheel"] .scene-heading p { max-width: 190px; }
.solid-fan { position: absolute; width: 430px; height: 220px; left: calc(50% - 215px); bottom: 46px; transform: rotateX(7deg); pointer-events: none; }
.solid-card { position: absolute; width: 142px; height: 218px; left: calc(50% - 71px); top: 0; transform-origin: 50% 95%; transform: translateX(var(--card-offset)) rotateZ(var(--card-angle)); transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.solid-card.is-selected { transform: translate3d(0,-12px,32px) rotateZ(-3deg) rotateY(-6deg) scale(1.025); z-index: 5; }
.cards-opening .solid-card:not(.is-selected) { transform: translateX(calc(var(--card-offset)*1.24)) translateY(9px) rotateZ(var(--card-angle)); }
.cards-opening .solid-card:not(.is-selected) .solid-card-back { filter: brightness(.62); }
.solid-card-turn { position: absolute; inset: 0; }
.solid-card-back,.solid-card-front { position: absolute; inset: 0; border-radius: 9px; backface-visibility: hidden; border: 1px solid #90623c; box-shadow: inset 0 0 9px #0008; }
.solid-card-back { transform: translateZ(1.5px); background: #3a1b20 url('assets/rituals/card.webp') center / 230px 230px; }
.solid-card-front { transform: rotateY(180deg) translateZ(1.5px); display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--gold); background: linear-gradient(#211416cc,#3d2024b8),url('assets/rituals/card.webp') center / 230px 230px; }
.solid-crest { width: 61px; height: 61px; position: relative; margin-bottom: 15px; }
.solid-crest img { width: 100%; height: 100%; }
.solid-card-front .front-rarity { font-size: 11px; }
.card-foil { position: absolute; inset: 1px; border-radius: 9px; background: radial-gradient(ellipse at 50% 42%,var(--rarity-glow),transparent 72%); box-shadow: inset 0 0 0 1px #b4936440; opacity: 0; }
.rarity-awaken .card-foil { animation: card-foil-reveal 1s ease both; }
.rarity-awaken .solid-card-front { color: var(--rarity); }
.rarity-awaken .solid-crest { filter: drop-shadow(0 0 9px var(--rarity-glow)); }
.card-edge { position: absolute; display: block; background: repeating-linear-gradient(0deg,#7e5f43 0 1px,#bba17d 1px 2px,#58422e 2px 3px); }
.card-edge-left,.card-edge-right { width: 3px; height: 208px; top: 5px; left: -1.5px; transform: rotateY(90deg); }
.card-edge-right { left: 140.5px; }
.card-edge-top,.card-edge-bottom { height: 3px; width: 132px; left: 5px; top: -1.5px; transform: rotateX(90deg); }
.card-edge-bottom { top: 216.5px; }
.card-ground-shadow,.cup-ground-shadow,.wheel-ground-shadow { position: absolute; width: 300px; height: 34px; left: calc(50% - 150px); bottom: 17px; border-radius: 50%; background: radial-gradient(ellipse,#000c,transparent 72%); pointer-events: none; }
.cards-opening .card-ground-shadow { animation: card-shadow-shift 1.6s ease both; }

/* ช่องกระบอกอยู่หลังไม้ ริมด้านหน้าบังปลายไม้ที่ยังอยู่ข้างใน */
.cup-assembly { position: absolute; width: 220px; height: 220px; left: calc(50% - 110px); bottom: 32px; pointer-events: none; }
.cup-body { position: absolute; inset: 0; transform-origin: 50% 94%; }
.cup-body-art { position: absolute; inset: 0; width: 100%; height: 100%; transform: translateZ(0); }
.cup-mouth-shadow { position: absolute; width: 89px; height: 23px; top: 3px; left: calc(50% - 44.5px); border-radius: 50%; background: radial-gradient(ellipse,#080506,#291b10 70%,#997344); transform: translateZ(1px); }
.cup-stick-rack { position: absolute; left: 50%; top: 24px; transform: translateZ(3px); }
.cup-fortune-stick { display: block; position: absolute; width: 8px; height: var(--stick-height); top: calc(0px - var(--stick-height)); left: -4px; transform: translateX(var(--stick-x)) rotateZ(var(--stick-tilt)); transform-origin: 50% 100%; background: repeating-linear-gradient(90deg,#6a472b 0 1px,#b99a65 1px 3px,#cdb17c 3px 5px,#8b683e 5px 8px); border-radius: 2px 2px 1px 1px; }
.cup-fortune-stick::before { content: ''; position: absolute; inset: 0 0 auto; height: 24px; border-radius: 2px 2px 0 0; background: linear-gradient(90deg,#50151d,#a5403d 45%,#63212a); border-bottom: 1px solid #c5a27077; }
.cup-fortune-stick span { position: absolute; width: 2px; height: 100%; right: -1px; top: 0; transform: rotateY(90deg); background: linear-gradient(#792c2e 0 24px,#644125 24px); }
.cup-front-mask { position: absolute; inset: 0; transform: translateZ(6px); clip-path: inset(10% 0 0 0); }
.cup-front-mask img { width: 100%; height: 100%; }
.cup-lip-shade { position: absolute; width: 92px; height: 11px; left: calc(50% - 46px); top: 15px; border-radius: 0 0 50% 50%; border-bottom: 3px solid #c6a56e55; transform: translateZ(7px); }
.stick-landed .cup-ground-shadow { animation: cast-shadow-open .3s ease both; }
.rarity-awaken .selected-fortune::before { background: var(--rarity); box-shadow: 0 0 10px var(--rarity-glow); }

@keyframes card-foil-reveal { 0% { opacity: 0; } 45% { opacity: .9; } 100% { opacity: .65; } }
@keyframes card-shadow-shift { from { transform: scaleX(1); } to { transform: translateX(6px) scaleX(.88); } }
@media(max-height:800px) { .solid-fan { bottom: 48px; transform: rotateX(7deg) scale(.88); transform-origin: 50% 100%; } .cup-assembly { bottom: 31px; transform: scale(.88); transform-origin: 50% 100%; } }
@media(prefers-reduced-motion:reduce) { .solid-card { transition-duration: .01ms; } .card-foil,.card-ground-shadow,.cup-ground-shadow,.wheel-face-shine { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
