/* วัสดุจริงกับชั้นวัตถุที่แยกขยับได้ */
.stage { height: 357px; overflow: visible; }
.stage::before,.stage::after { display: none; }
.scene-footer { position: relative; z-index: 20; }
.ritual-workspace { position: relative; width: 100%; height: 100%; isolation: isolate; touch-action: none; user-select: none; perspective: 1100px; }
.ritual-workspace img { pointer-events: none; user-select: none; -webkit-user-drag: none; }
.ritual-workspace button { touch-action: none; user-select: none; padding: 0; border: 0; background: transparent; }
.ritual-workspace button:hover:not(:disabled) { background: transparent; border-color: transparent; }
.ritual-workspace button:disabled { opacity: 1; }
.ritual-workspace button:focus-visible { outline: 1px dashed #cfac75; outline-offset: 5px; }
.ritual-mat { position: absolute; left: 12%; right: 12%; height: 130px; bottom: 0; border-radius: 50%; transform: rotateX(66deg); background: radial-gradient(ellipse,#3c171f70,#23121633 55%,transparent 74%); z-index: -2; }
.contact-shadow { position: absolute; bottom: 12px; left: 24%; width: 52%; height: 16px; border-radius: 50%; background: #000b; filter: blur(11px); z-index: -1; }
.ritual-light { position: absolute; inset: 15% 10% 0; opacity: 0; border-radius: 50%; background: radial-gradient(ellipse,#b4936435,transparent 60%); pointer-events: none; z-index: -1; }
.ritual-workspace[data-ready=true] [data-gesture] { cursor: grab; }
.ritual-workspace.is-grabbed [data-gesture] { cursor: grabbing; }
.ritual-workspace[data-ready=false] { filter: saturate(.8) brightness(.91); }
.ritual-workspace.ritual-leave { animation: ritual-fade .42s ease both; pointer-events: none; }
.ritual-complete button { pointer-events: none; }

/* ไพ่หนังและการพลิกสามมิติ */
.real-fan { position: absolute; bottom: 12px; left: 50%; width: 460px; height: 245px; transform: translateX(-50%); perspective: 1000px; }
.real-card { position: absolute; left: calc(50% - 76px); width: 152px; height: 238px; border-radius: 13px; transform: translateX(var(--offset)) rotate(var(--fan-angle)); transform-origin: 50% 95%; transition: transform .55s cubic-bezier(.2,.7,.2,1),opacity .4s,filter .4s; -webkit-tap-highlight-color: transparent; }
.card-turn { display: block; position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .16s linear; }
.card-back,.card-front { display: block; position: absolute; inset: 0; backface-visibility: hidden; border-radius: 11px; }
.card-back img { position: absolute; left: 50%; top: 50%; width: 252px; height: 252px; transform: translate(-50%,-50%); filter: drop-shadow(3px 9px 8px #000a); }
.card-front { transform: rotateY(180deg); display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--rarity); filter: drop-shadow(3px 8px 9px #0009); }
.card-face-material { position: absolute; left: 50%; top: 50%; width: 252px; height: 252px; transform: translate(-50%,-50%); filter: saturate(.45) brightness(.66); }
.rarity-ink { position: absolute; inset: -3px -1px; border-radius: 17px; background: radial-gradient(ellipse at 50% 40%,var(--rarity-color),transparent 72%); mix-blend-mode: screen; opacity: .82; box-shadow: inset 0 0 25px var(--rarity-color),0 0 15px var(--rarity-glow); }
.front-crest { width: 68px; height: 68px; border-radius: 50%; display: block; position: relative; margin-bottom: 14px; filter: drop-shadow(0 0 12px var(--rarity-glow)); }
.front-crest img { width: 100%; height: 100%; filter: grayscale(.65) brightness(.85); }
.front-crest::after { content: ''; position: absolute; inset: 7%; border-radius: 50%; background: var(--rarity-color); mix-blend-mode: color; }
.front-rarity { position: relative; z-index: 1; font-size: 13px; letter-spacing: .04em; text-shadow: 0 2px 4px #000; color: var(--rarity); }
.real-card:hover:not(:disabled) { transform: translateX(var(--offset)) translateY(-8px) rotate(var(--fan-angle)); filter: brightness(1.14); }
.card-selected .real-card:not(.is-selected) { opacity: .22; transform: translateX(calc(var(--offset) * 1.3)) translateY(14px) rotate(var(--fan-angle)) scale(.92); }
.card-selected .real-card.is-selected { z-index: 5; transform: translateX(0) translateY(-8px) rotate(-3deg); filter: drop-shadow(0 0 12px #b493641a); }
.real-card.is-flipped { filter: drop-shadow(0 0 18px #b4936440); }

/* กระบอกไม้จริง ไม้คำทำนายแต่ละแท่งขยับอย่างอิสระ */
.real-cup { position: absolute; width: 240px; height: 260px; bottom: 15px; left: calc(50% - 120px); transform-origin: 50% 85%; }
.cup-photo { position: absolute; width: 256px; height: 256px; left: -8px; bottom: 0; filter: drop-shadow(9px 9px 8px #0009); z-index: 2; }
.real-sticks { position: absolute; left: 50%; bottom: 194px; width: 100px; height: 100px; z-index: 1; transform: rotate(var(--stick-sway,0deg)); transform-origin: bottom; }
.fortune-stick { position: absolute; bottom: 0; left: -5px; width: 10px; height: calc(104px + var(--stick-lift)); transform: translateX(var(--stick-x)) rotate(var(--stick-tilt)); transform-origin: 50% 100%; background: linear-gradient(90deg,#6d4629,#c0a070 31%,#b28f5a 75%,#62412c); border-radius: 3px 3px 1px 1px; box-shadow: 2px 0 3px #0008; }
.fortune-stick::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 26px; background: linear-gradient(90deg,#5e1822,#9c2939,#46121d); border-radius: 3px 3px 0 0; border-bottom: 1px solid #b4936480; }
.fortune-stick b { position: absolute; left: 3px; bottom: 23px; width: 3px; height: 26px; border-left: 1px solid #60462b70; }
.cup-rim { position: absolute; left: 67px; top: 39px; width: 106px; height: 13px; border-radius: 0 0 50% 50%; border-bottom: 6px solid #66502e; z-index: 4; pointer-events: none; }
.gesture-surface { position: absolute; z-index: 6; border-radius: 50%; }
.cup-grip { width: 180px; height: 280px; bottom: 12px; left: calc(50% - 90px); }
.cup-primed .chosen-stick { filter: brightness(1.32); }
.cup-primed .real-cup { filter: drop-shadow(0 0 9px #b4936420); }
.fallen-stick { display: none; position: absolute; width: 169px; height: 17px; bottom: 28px; left: calc(50% + 25px); border-radius: 4px; background: linear-gradient(#a7844c,#c8ad77 35%,#78522e); box-shadow: 0 6px 7px #000b; color: #681a22; }
.fallen-stick.is-visible { display: block; }
.fallen-stick span { position: absolute; left: 14px; font-size: 13px; line-height: 17px; }
.fallen-stick::after { content: ''; position: absolute; right: 0; top: 0; width: 33px; height: 17px; background: linear-gradient(#8a2c37,#4c141e); border-radius: 0 4px 4px 0; }

/* หีบแยกฝาและฐาน ให้กลอนรับเมาส์อยู่ชั้นหน้า */
.real-chest { position: absolute; width: 360px; height: 360px; left: calc(50% - 180px); bottom: -19px; perspective: 1000px; }
.chest-photo { position: absolute; inset: 0; pointer-events: none; }
.chest-photo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(5px 9px 7px #0008); }
.chest-base { clip-path: inset(49% 0 0 0); z-index: 3; }
.chest-top { clip-path: inset(0 0 51% 0); transform-origin: 50% 49%; transition: transform 1.15s cubic-bezier(.2,.7,.2,1); z-index: 4; }
.chest-interior { position: absolute; width: 95%; left: 2.5%; height: 78px; top: 39%; border-radius: 50%; background: radial-gradient(ellipse,#a37c393b,#070507 70%); border: 4px solid #503325; z-index: 1; opacity: 0; transition: opacity .5s; }
.brass-locks { position: absolute; top: 52%; left: 15%; width: 70%; display: flex; justify-content: space-between; z-index: 6; }
.brass-lock { position: relative; width: 42px; height: 52px; border-radius: 13px !important; filter: drop-shadow(1px 3px 3px #000a); }
.lock-ring { position: absolute; top: 0; left: 0; width: 42px; height: 42px; display: block; border: 3px solid #70532d; border-radius: 50%; background: repeating-conic-gradient(#b79a69 0 12deg,#705735 12deg 15deg); box-shadow: inset 0 0 0 4px #b49663,inset 0 0 0 5px #493723,0 0 0 1px #b4936470; transition: transform .12s; }
.lock-ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: linear-gradient(120deg,#c3a572,#81613c 48%,#b69760); border: 1px solid #ddc08850; }
.lock-notch { position: absolute; top: -2px; left: 15px; width: 5px; height: 6px; background: #ebce8d; border-radius: 1px; }
.lock-bar { position: absolute; left: 15px; top: 8px; width: 5px; height: 20px; border-radius: 3px; background: linear-gradient(90deg,#352719,#ddba76,#654627); box-shadow: 1px 1px 2px #0009; }
.brass-lock small { position: absolute; bottom: -2px; left: 15px; font-size: 8px; color: #d5b27d; }
.brass-lock.is-unlocked { transform: translateY(5px); filter: brightness(.7); pointer-events: none; }
.brass-lock.is-unlocked small { visibility: hidden; }
.chest-open .chest-top { transform: rotateX(-112deg); }
.chest-open .chest-interior { opacity: 1; }
.chest-unlocked .brass-locks { transition: opacity .6s; opacity: .1; }

/* วงตราทองเหลืองหมุนด้วยแรงเฉื่อย */
.real-wheel { position: absolute; width: 259px; height: 259px; left: calc(50% - 129.5px); bottom: 15px; border-radius: 50%; }
.wheel-photo { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(3px 10px 9px #000b); will-change: transform; }
.wheel-grip { inset: 0; }
.wheel-pin { position: absolute; left: calc(50% - 7px); top: -4px; z-index: 7; width: 14px; height: 30px; pointer-events: none; filter: drop-shadow(0 2px 3px #0009); }
.wheel-pin::before { content: ''; position: absolute; left: 4px; width: 7px; height: 7px; border-radius: 50%; background: #ab8c5a; border: 1px solid #c8ad77; }
.wheel-pin i { position: absolute; left: 6px; top: 5px; width: 4px; height: 23px; border-radius: 1px 1px 50% 50%; background: linear-gradient(90deg,#775934,#dcc18c); }
.wheel-hub { position: absolute; left: calc(50% - 8px); top: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(at 33% 25%,#c9ac78,#73502d 70%); border: 1px solid #cfb27b; box-shadow: 0 3px 4px #0008; pointer-events: none; z-index: 7; }
.wheel-coasting .wheel-photo { filter: drop-shadow(3px 10px 9px #000b) brightness(1.08); }

/* ซองกระดาษ ผนึกครั่งและแผ่นคำทำนาย */
.real-envelope { position: absolute; width: 330px; height: 230px; left: calc(50% - 165px); bottom: 17px; perspective: 1000px; transform: rotate(-5deg); }
.envelope-photo { position: absolute; inset: 0; pointer-events: none; }
.envelope-photo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(4px 8px 7px #0008); }
.envelope-base { clip-path: polygon(0 0,100% 0,100% 100%,0 100%); z-index: 2; }
.envelope-flap { clip-path: polygon(3% 9%,97% 9%,95% 29%,50% 74%,5% 29%); z-index: 3; transform-origin: 50% 12%; transition: transform .14s; }
.reward-letter { position: absolute; inset: 27px 30px 25px; border-radius: 7px; background: linear-gradient(135deg,#bca98a,#d7c5a1 40%,#b29b7b); color: #35211d; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 0 0 9px #5c38261f; z-index: 1; transform: translateY(var(--paper-pull,0px)); }
.reward-letter span { font-size: 32px; }
.reward-letter small { font-size: 11px; }
.real-wax { position: absolute; left: calc(50% - 28px); top: 115px; width: 56px; height: 55px; background: radial-gradient(at 30% 25%,#9b2829,#5b1117 66%,#350c0e) !important; border: 2px solid #8f3435 !important; border-radius: 45% 42% 44% 48%; box-shadow: 2px 5px 5px #0008,inset 0 0 0 4px #4310149c; color: #bf7562; z-index: 7; transition: transform .2s,box-shadow .2s,opacity .4s; }
.real-wax::after { content: ''; position: absolute; inset: 8px; border: 1px solid #c4756c77; border-radius: 50%; }
.real-wax span { font-size: 27px; text-shadow: 0 1px 1px #2e0c1399; }
.wax-pressed .real-wax { transform: scale(.92); box-shadow: 0 1px 2px #0008,inset 0 0 0 4px #4310209c; }
.wax-broken .real-wax { transform: translate(36px,47px) rotate(28deg); opacity: .38; pointer-events: none; }
.paper-grip { inset: 0; border-radius: 20px; z-index: 5; }
.paper-open .envelope-flap { transition: transform .55s; }
.paper-opening .envelope-base,.paper-open .envelope-base { clip-path: polygon(0 0,3% 9%,50% 74%,97% 9%,100% 0,100% 100%,0 100%); }
.paper-open .reward-letter { z-index: 1; }
.tear-thread { position: absolute; z-index: 4; left: 5%; right: 5%; top: 29px; height: 1px; background: linear-gradient(90deg,transparent,#a57a5255,transparent); pointer-events: none; }

/* สีระบุระดับรางวัลปรากฏหลังปลดผนึก สีหน้าต่างยังใช้ธีม ARTHAN */
.ritual-workspace { --rarity: #c4b7a5; --rarity-color: #a59a85; --rarity-glow: #b0a59128; }
.preview-tools label { display: flex; align-items: center; gap: 7px; font-size: 10px; }
.preview-tools select { background: #1a1114; border: 1px solid #a07d4b30; border-radius: 20px; padding: 3px 10px; font-size: 10px; color: #d2b99b; }
.rarity-awaken .ritual-light { opacity: .8; background: radial-gradient(ellipse,var(--rarity-glow),transparent 68%); animation: rarity-bloom 1.4s ease both; }
.rarity-awaken .front-crest { animation: crest-awaken .9s ease both; }
.rarity-awaken .chosen-stick::before { background: var(--rarity-color); box-shadow: 0 0 15px var(--rarity-glow); }
.rarity-awaken .fallen-stick::after { background: linear-gradient(var(--rarity-color),#281317); box-shadow: 0 0 13px var(--rarity-glow); }
.rarity-awaken .chest-interior { opacity: 1; background: radial-gradient(ellipse,var(--rarity-color),#080507 75%); box-shadow: 0 -15px 32px var(--rarity-glow); }
.rarity-awaken .wheel-hub { background: radial-gradient(at 35% 25%,var(--rarity),var(--rarity-color)); box-shadow: 0 0 28px 8px var(--rarity-glow); }
.rarity-awaken .wheel-photo { filter: drop-shadow(0 0 17px var(--rarity-glow)); }
.rarity-awaken .reward-letter { background: linear-gradient(135deg,#1e1616,var(--rarity-color)); color: var(--rarity); box-shadow: 0 0 21px var(--rarity-glow); }
.ritual-tier-tag { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); color: var(--rarity); font-size: 12px; letter-spacing: .08em; z-index: 10; animation: tier-arrive .4s ease both; white-space: nowrap; }
.reward-leaving .real-fan,.reward-leaving .real-cup,.reward-leaving .real-chest,.reward-leaving .real-wheel,.reward-leaving .real-envelope { transition: opacity .5s,filter .5s; opacity: .3; filter: brightness(.75); }
.reward-flight { position: absolute; z-index: 12; left: 50%; top: 54%; width: 110px; height: 110px; display: grid; place-items: center; animation: item-out .85s cubic-bezier(.16,.75,.2,1) both; }
.reward-flight::before { content: ''; position: absolute; inset: -35px; border-radius: 50%; background: radial-gradient(ellipse,var(--rarity-glow),transparent 70%); }
.reward-flight img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 11px 12px #000b); }
@keyframes rarity-bloom { 0% { opacity: 0; transform: scale(.65); } 35% { opacity: 1; } 100% { opacity: .2; transform: scale(1.1); } }
@keyframes crest-awaken { 45% { filter: brightness(1.5) drop-shadow(0 0 16px var(--rarity-glow)); } }
@keyframes tier-arrive { from { opacity: 0; transform: translate(-50%,6px); } to { opacity: 1; transform: translate(-50%,0); } }
.ritual-workspace[data-ritual="sticks"] { --origin-x: 80px; --origin-y: 105%; }
.ritual-workspace[data-ritual="chest"] { --origin-y: 70%; }
.ritual-workspace[data-ritual="wheel"] { --origin-y: 0%; }
.ritual-workspace[data-ritual="envelope"] { --origin-y: 55%; }
@keyframes item-out { from { opacity: 0; transform: translate(calc(-50% + var(--origin-x,0px)),var(--origin-y,20%)) scale(.2); } 30% { opacity: 1; } to { opacity: 1; transform: translate(-50%,-80%) scale(1.06); } }

@keyframes ritual-fade { to { opacity: 0; transform: translateY(-5px) scale(.98); } }
@media(min-width:1800px) {
  .stage { height: 390px; }
  .real-fan { bottom: 20px; transform: translateX(-50%) scale(1.1); transform-origin: 50% 100%; }
  .real-chest { bottom: -10px; transform: scale(1.1); transform-origin: 50% 100%; }
  .real-wheel { bottom: 20px; transform: scale(1.1); transform-origin: 50% 100%; }
  .real-cup { bottom: 18px; transform-origin: 50% 100%; }
  .real-envelope { bottom: 25px; }
}
@media(max-height:800px) {
  .stage { height: 318px; }
  .real-fan { bottom: 4px; transform: translateX(-50%) scale(.93); transform-origin: 50% 100%; }
  .real-cup { bottom: 3px; }
  .real-chest { bottom: -27px; width: 330px; height: 330px; left: calc(50% - 165px); }
  .real-wheel { width: 240px; height: 240px; left: calc(50% - 120px); bottom: 4px; }
  .real-envelope { bottom: 5px; width: 310px; height: 216px; left: calc(50% - 155px); }
  .real-wax { top: 106px; }
  .scene-footer { min-height: 30px; font-size: 10px; gap: 10px; }
  .reward-shelf { margin-top: 6px; }
}
@media(max-width:800px) {
  .stage { height: 340px; }
  .real-fan { width: 380px; transform: translateX(-50%) scale(.84); transform-origin: 50% 100%; }
  .scene-footer { flex-wrap: wrap; min-height: 48px; text-align: center; }
  .scene-heading p { max-width: 95%; }
}
@media(prefers-reduced-motion:reduce) {
  .ritual-workspace *, .ritual-workspace *::before, .ritual-workspace *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.result-spark,.batch-item small { color: var(--rarity,var(--gold)); }
.result .stamp { border-color: var(--rarity,var(--gold)); color: var(--rarity,var(--gold)); }

/* ค่าสีทุกบริบทรับจาก tiers.js ซึ่งอ้างอิงวงล้อชุดเดิม */
[data-tier="0"] { --rarity: var(--tier-0); }
[data-tier="1"] { --rarity: var(--tier-1); }
[data-tier="2"] { --rarity: var(--tier-2); }
[data-tier="3"] { --rarity: var(--tier-3); }
[data-tier] { --rarity-color: var(--rarity); --rarity-glow: color-mix(in srgb,var(--rarity) 34%,transparent); }
.tier-key { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.tier-key span { font-size: 9px; color: var(--rarity); line-height: 1.5; }
.tier-key span::before { content: ''; display: inline-block; width: 3px; height: 3px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.reward-item small,.detail-row small { color: var(--rarity,var(--muted)); }
.reward-item[data-tier="2"],.reward-item[data-tier="3"] { background: linear-gradient(140deg,color-mix(in srgb,var(--rarity) 10%,transparent),transparent); }
.reward-item[data-tier="3"] small { color: var(--tier-3); }
.history-entry header { flex-wrap: wrap; gap: 8px; }
.history-tier { color: var(--rarity); font-size: 10px; }
.reward-item[data-tier="2"]::after,.reward-item[data-tier="3"]::after { content: ''; position: absolute; bottom: 0; left: 30%; right: 30%; height: 1px; background: linear-gradient(90deg,transparent,var(--rarity),transparent); }
.reveal-anticipation .real-fan,.reveal-anticipation .real-cup,.reveal-anticipation .real-chest,.reveal-anticipation .real-wheel,.reveal-anticipation .real-envelope { filter: brightness(.75); transition: filter .2s; }
.reveal-anticipation .ritual-light { opacity: .35; background: radial-gradient(ellipse,#8b243529,transparent 65%); }
.rarity-awaken[data-tier="2"] .card-front,.rarity-awaken[data-tier="3"] .card-front { filter: drop-shadow(0 0 18px var(--rarity-glow)); }
.rarity-awaken[data-tier="3"] .rarity-ink { animation: foil-illuminate 1.1s ease both; }
.rarity-awaken[data-tier="2"] .ritual-tier-tag,.rarity-awaken[data-tier="3"] .ritual-tier-tag { font-size: 14px; text-shadow: 0 0 15px var(--rarity-glow); }
.reward-flight { animation-duration: var(--flight-time,.85s); }
.real-card.is-selected .card-back::after { content: ''; position: absolute; inset: 0; border-radius: 12px; background: linear-gradient(115deg,transparent 30%,#d5b67b27 48%,transparent 65%); animation: material-sweep .75s ease both; pointer-events: none; }
.cup-primed .cup-rim { box-shadow: 0 4px 9px #b4936427; }
.is-unlocked .lock-bar { animation: latch-kick .35s ease both; }
.chest-open .chest-interior { transition: background .4s,box-shadow .4s,opacity .4s; }
.wheel-coasting .wheel-pin i { transform-origin: 50% 0; animation: pin-tremble .14s ease-in-out infinite; }
.wheel-coasting::after { content: ''; position: absolute; inset: 1%; border-radius: 50%; background: conic-gradient(from var(--wheel-angle,0deg),transparent 0deg 35deg,#d4b07865 50deg,transparent 65deg 215deg,#d4b07835 230deg,transparent 245deg); mask: radial-gradient(transparent 67%,#000 68% 70%,transparent 71%); pointer-events: none; }
.wax-broken .real-wax { clip-path: polygon(0 0,100% 0,100% 100%,48% 100%,60% 65%,35% 49%,49% 19%,0 38%); }
.paper-open .reward-letter::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg,transparent 25%,#ead7d22b 48%,transparent 70%); animation: material-sweep .9s ease both; pointer-events: none; }

/* แสงรางวัลอยู่รอบวัตถุและเว้นพื้นที่ชื่อให้อ่านนิ่ง */
.tier-effects { position: absolute; left: 50%; top: 54%; width: 330px; height: 260px; transform: translate(-50%,-50%); pointer-events: none; z-index: 5; color: var(--rarity); }
.tier-effects i { position: absolute; display: block; pointer-events: none; }
.tier-halo { inset: -10px -18px; border-radius: 50%; background: radial-gradient(ellipse,var(--rarity-glow),transparent 66%); animation: tier-halo-in 1.4s ease both; }
.tier-orbit { width: 210px; height: 210px; left: calc(50% - 105px); top: calc(50% - 105px); border: 1px solid color-mix(in srgb,var(--rarity) 45%,transparent); border-radius: 50%; animation: tier-orbit-in 1.2s ease both; }
.tier-rays { inset: 0; border-radius: 50%; background: repeating-conic-gradient(from 12deg,transparent 0deg 26deg,color-mix(in srgb,var(--rarity) 34%,transparent) 27deg 28deg,transparent 29deg 40deg); mask: radial-gradient(transparent 0 38%,#000 49%,transparent 70%); animation: tier-rays-in 1.5s ease both; }
.tier-wave { width: 180px; height: 180px; left: calc(50% - 90px); top: calc(50% - 90px); border: 1px solid color-mix(in srgb,var(--rarity) 55%,transparent); border-radius: 50%; animation: tier-wave-out 1s ease-out both; }
.tier-spark { left: calc(50% - 2px); top: calc(50% - 2px); width: 3px; height: 7px; border-radius: 50%; background: var(--rarity); box-shadow: 0 0 6px var(--rarity-glow); animation: tier-spark-out 1.15s cubic-bezier(.1,.6,.2,1) var(--delay) both; }
.tier-effects[data-tier="0"] .tier-orbit,.tier-effects[data-tier="0"] .tier-rays,.tier-effects[data-tier="0"] .tier-wave { display: none; }
.tier-effects[data-tier="0"] .tier-halo { opacity: .45; }
.tier-effects[data-tier="1"] .tier-rays,.tier-effects[data-tier="1"] .tier-wave { display: none; }
.tier-effects[data-tier="2"] .tier-rays { opacity: .6; }
.tier-effects[data-tier="3"] .tier-orbit { width: 245px; height: 245px; left: calc(50% - 122.5px); top: calc(50% - 122.5px); border-color: color-mix(in srgb,var(--rarity) 60%,transparent); box-shadow: 0 0 17px var(--rarity-glow); }
.tier-effects[data-tier="3"] .tier-rays { inset: -22px; }
.result { position: relative; isolation: isolate; animation: result-fade .25s ease both; }
.result > .tier-effects { top: 48%; z-index: -1; }
.result-art { position: relative; animation: treasure-arrive .35s cubic-bezier(.2,.8,.2,1) both; }
.result[data-tier="1"] .result-art { animation-duration: .5s; }
.result[data-tier="2"] .result-art { animation-duration: .7s; filter: drop-shadow(0 8px 13px #000a) drop-shadow(0 0 13px var(--rarity-glow)); }
.result[data-tier="3"] .result-art { animation-duration: .9s; filter: drop-shadow(0 8px 13px #000a) drop-shadow(0 0 20px var(--rarity-glow)); }
.result[data-tier="3"] { background: radial-gradient(ellipse,color-mix(in srgb,var(--tier-3) 10%,transparent),transparent 65%); }
.result[data-tier="3"] .result-spark { letter-spacing: .1em; }
@keyframes material-sweep { from { opacity: 0; transform: translateX(-18px); } 35% { opacity: 1; } to { opacity: 0; transform: translateX(24px); } }
@keyframes latch-kick { 40% { transform: translateY(2px); } }
@keyframes pin-tremble { 50% { transform: rotate(8deg); } }
@keyframes foil-illuminate { 40% { opacity: 1; filter: brightness(1.35); } }
@keyframes tier-halo-in { 0% { opacity: 0; transform: scale(.7); } 35% { opacity: .95; } 100% { opacity: .1; transform: scale(1.1); } }
@keyframes tier-orbit-in { from { opacity: 0; transform: scale(.8) rotate(-12deg); } 30% { opacity: .8; } to { opacity: 0; transform: scale(1.12) rotate(12deg); } }
@keyframes tier-rays-in { from { opacity: 0; transform: scale(.8) rotate(-8deg); } 30% { opacity: .75; } to { opacity: 0; transform: scale(1.1) rotate(14deg); } }
@keyframes tier-wave-out { from { opacity: .7; transform: scale(.65); } to { opacity: 0; transform: scale(1.5); } }
@keyframes tier-spark-out { from { opacity: 0; transform: rotate(var(--angle)) translateX(45px) scale(.4); } 20% { opacity: .9; } to { opacity: 0; transform: rotate(var(--angle)) translateX(var(--reach)) scale(.5); } }
@keyframes result-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes treasure-arrive { from { opacity: 0; transform: translateY(8px) scale(.88); } 65% { opacity: 1; transform: translateY(-2px) scale(1.03); } to { opacity: 1; transform: none; } }
@media(prefers-reduced-motion:reduce) {
  .tier-effects .tier-rays,.tier-effects .tier-wave,.tier-effects .tier-spark { display: none; }
  .tier-effects *,.result-art,.result,.real-card.is-selected .card-back::after,.wheel-coasting .wheel-pin i,.paper-open .reward-letter::after { animation: none !important; }
  .tier-effects .tier-orbit { opacity: .3; }
  .tier-effects .tier-halo { opacity: .2; }
}
/* พรีวิวจอเตี้ยต้องไม่เลื่อนทั้งหน้าเมื่อโฟกัสปุ่มเปิดทันที */
@media(max-height:760px) and (min-width:801px) {
  body { padding-block: 38px 10px; }
  .window-head { height: 70px; }
  .stage { height: 280px; }
  .reward-shelf { padding-block: 8px; }
}
