/* MengZhan's 104-degree fan and lifted dealing motion on the Ta说 table. */
.tarot-room:is([data-step=draw],[data-step=reveal]){--draw-slot-width:clamp(58px,8vw,84px);--draw-fan-width:96px}
.tarot-room .t-table-content .t-mengzhan-draw{position:relative;width:100%;height:100%;isolation:isolate}
.tarot-room[data-step=reveal] .t-table-content .t-reveal-table{position:absolute;left:0;right:0;top:0;bottom:auto;height:calc(var(--draw-slot-width)*1.8);width:100%;margin:0;z-index:90}
.tarot-room[data-step=reveal] .t-table-content .t-slot{width:var(--draw-slot-width);height:calc(var(--draw-slot-width)*1.54 + 22px);pointer-events:auto}
.tarot-room[data-step=reveal] .t-table-content .t-slot-card{width:var(--draw-slot-width);height:calc(var(--draw-slot-width)*1.54);border-radius:4px;box-shadow:2px 5px 9px #14081799}
.tarot-room .t-table-content .t-mengzhan-draw .t-fan{--pull:0px;position:absolute;inset:auto 0 0;width:100%;height:calc(var(--draw-fan-width)*1.54 + 12px);margin:0;touch-action:none;user-select:none;isolation:isolate;overflow:visible}
.tarot-room .t-table-content .t-mengzhan-draw .t-fan-card{position:absolute;left:50%;top:0;width:var(--draw-fan-width);height:calc(var(--draw-fan-width)*1.54);margin-left:calc(var(--draw-fan-width)/-2);padding:0;border:0;background:none;border-radius:4px;box-shadow:none;opacity:1;transform:var(--draw-pose);transform-origin:center center;z-index:var(--fan-index);filter:none;touch-action:none}
.tarot-room .t-mengzhan-draw .t-fan-card:disabled{opacity:1;cursor:default}
.tarot-room .t-mengzhan-draw .t-fan-lift{display:block;position:relative;width:100%;height:100%;pointer-events:none;transform:translateY(0);transition:transform 190ms cubic-bezier(.2,.75,.2,1);filter:drop-shadow(-2px 1px 1px #08041599)}
.tarot-room .t-mengzhan-draw .t-fan-card.is-active .t-fan-lift{transform:translateY(var(--pull));outline:1px solid white;outline-offset:-1px;border-radius:4px;filter:drop-shadow(0 0 3px #fffd)}
.tarot-room .t-mengzhan-draw .t-fan-card:focus-visible{outline:none}
.tarot-room .t-draw-controls{display:flex;align-items:center;justify-content:center;gap:14px}.tarot-room .t-draw-controls .t-quiet{min-width:44px;min-height:44px;font-size:22px;text-decoration:none}
.t-draw-controls{pointer-events:none}
.t-draw-controls button{pointer-events:auto}
.tarot-room.story-room[data-step=draw] .t-main>.t-draw-controls{bottom:6.8dvh}.tarot-room.story-room[data-step=draw] .t-main>#t-draw-status{bottom:3.5dvh;font-size:12px}
.tarot-room[data-step=draw] .t-scene-window>.t-heading{top:11dvh}
@media(max-width:650px){
 .tarot-room:is([data-step=draw],[data-step=reveal]){--draw-slot-width:clamp(58px,17vw,72px);--draw-fan-width:72px}
 .tarot-room[data-step=reveal] .t-table-content .t-slot small{font-size:11px;line-height:1.5;white-space:nowrap}
 .tarot-room[data-step=draw] .t-scene-window>.t-heading{top:43dvh;left:5%;width:90%}.tarot-room[data-step=draw] .t-heading h1{font-size:19px}.tarot-room[data-step=draw] .t-heading p{font-size:12px}
 .tarot-room.story-room[data-step=draw] .t-main>.t-draw-controls{bottom:6.8dvh;gap:8px}.tarot-room .t-draw-controls .t-brass{min-height:44px;min-width:170px;font-size:13px;padding:10px 16px;letter-spacing:1px}
 .tarot-room.story-room[data-step=draw] .t-main>#t-draw-status{bottom:3.8dvh;font-size:11px;line-height:1.5}
}
@media(max-width:650px) and (max-height:700px){
 .tarot-room:is([data-step=draw],[data-step=reveal]){--draw-slot-width:52px;--draw-fan-width:58px}
 .tarot-room[data-step=draw] .t-scene-window>.t-heading{top:34dvh}.tarot-room[data-step=draw] .t-heading h1{font-size:17px}.tarot-room[data-step=draw] .t-heading p{font-size:10px;margin:4px 0}
 .tarot-room.story-room[data-step=draw] .t-main>.t-draw-controls{bottom:8dvh}.tarot-room.story-room[data-step=draw] .t-main>#t-draw-status{bottom:4.5dvh}
}
@media(prefers-reduced-motion:reduce){.tarot-room .t-mengzhan-draw .t-fan-lift{transition:none}}
.tarot-room .t-mengzhan-draw .t-fan-card:disabled{visibility:visible}
.tarot-room .t-table-content .t-mengzhan-draw .t-fan-card{translate:none}
.tarot-room[data-card-count='3'][data-step=reveal] .t-table-content .t-reveal-table .t-slot{width:var(--draw-slot-width);height:calc(var(--draw-slot-width)*1.54 + 22px)}
.tarot-room[data-card-count='3'][data-step=reveal] .t-table-content .t-reveal-table .t-slot-card{width:var(--draw-slot-width);height:calc(var(--draw-slot-width)*1.54)}
.tarot-room[data-step=reveal] .t-reveal-table{animation:none}
.tarot-room.story-room[data-step=draw] .t-main>#t-draw-status{bottom:13.5dvh;pointer-events:none}
@media(min-width:951px) and (min-aspect-ratio:17/10){
 .tarot-room.story-room[data-step=draw] .t-main>.t-draw-controls{left:auto;right:2%;display:grid;grid-template-columns:repeat(2,1fr);width:max-content;gap:2px 4px}
 .tarot-room[data-step=draw] [data-draw-pick]{grid-column:1/-1;grid-row:1}
}
@media(max-width:650px) and (max-height:700px){.tarot-room.story-room[data-step=draw] .t-main>#t-draw-status{bottom:16dvh}}
.tarot-room.story-room[data-step=reveal] #t-envelope-space{left:5%;right:5%;bottom:10dvh;flex-direction:column;gap:6px;text-align:center}
.tarot-room.story-room[data-step=reveal] #t-envelope-space .t-whisper{max-width:360px;margin:0;font-size:11px;line-height:1.7}
.tarot-room.story-room[data-step=reveal]:has(#t-open-letter) #t-reveal-hint{display:none}
.tarot-room.story-room[data-step=reveal] .t-main>.t-actions{bottom:5.5dvh}
@media(max-width:650px){.tarot-room[data-step=reveal] .t-scene-window>.t-heading{top:43dvh;left:5%;width:90%}.tarot-room[data-step=reveal] .t-heading h1{font-size:19px}.tarot-room[data-step=reveal] .t-heading p{font-size:12px}}
@media(max-width:650px) and (max-height:700px){.tarot-room[data-step=reveal] .t-scene-window>.t-heading{top:34dvh}.tarot-room[data-step=reveal] .t-heading h1{font-size:17px}.tarot-room[data-step=reveal] .t-heading p{font-size:10px}}
body:has(.tarot-room[data-step=draw][open]),body:has(.tarot-room[data-step=reveal][open]){overflow:hidden}
.tarot-room:is([data-step=draw],[data-step=reveal]){overflow:hidden}
.tarot-room[data-step=shuffle]{overflow:hidden}
.t-mengzhan-shuffle{position:relative;width:100%;height:100%;isolation:isolate;touch-action:none;outline:none}
.t-mengzhan-shuffle .t-shuffle-card{position:absolute;left:50%;top:50%;margin-left:calc(var(--shuffle-card-width)/-2);margin-top:calc(var(--shuffle-card-width)/-.58/2);width:var(--shuffle-card-width);height:calc(var(--shuffle-card-width)/.58);pointer-events:none;will-change:transform}
.t-shuffle-pile{position:absolute;top:35%;width:var(--shuffle-card-width);height:calc(var(--shuffle-card-width)/.58 + 35px);transform:translateX(-50%);z-index:500;border:1px solid #d4b47466;background:#21142422;color:#f1d7a6;border-radius:4px;font-size:12px;padding-top:calc(var(--shuffle-card-width)/.58);touch-action:manipulation}
.t-shuffle-pile[hidden]{display:none}.t-shuffle-pile[aria-pressed=true]{border-color:#f2cf88;box-shadow:0 0 11px #e6ba6266}
.tarot-room.story-room[data-step=shuffle] .t-main>.t-draw-controls{bottom:6.8dvh}.tarot-room.story-room[data-step=shuffle] .t-main>#t-shuffle-status{bottom:13.5dvh;font-size:12px;pointer-events:none}
@media(max-width:650px){.tarot-room[data-step=shuffle] .t-scene-window>.t-heading{top:40dvh;left:5%;width:90%}.tarot-room[data-step=shuffle] .t-heading h1{font-size:19px}.tarot-room[data-step=shuffle] .t-heading p{font-size:11px}}
@media(max-width:650px) and (max-height:700px){.tarot-room[data-step=shuffle] .t-scene-window>.t-heading{top:28dvh}.tarot-room.story-room[data-step=shuffle] .t-main>#t-shuffle-status{bottom:15dvh;font-size:10px}}
/* All physical cards share the same receding plane as the painted tabletop. */
/* The 3:2 backdrop uses cover: its rear table edge moves down as the viewport widens.
   Keep this selector as specific as the story layout so shuffle cannot revert to 48dvh. */
.tarot-room.story-room:is([data-step=shuffle],[data-step=draw],[data-step=reveal]) .t-table-content{transform:perspective(1000px) rotateX(48deg);transform-origin:50% 0;transform-style:preserve-3d;left:13%;top:max(60dvh,calc(100vw * .373333 + 12px));width:74%;height:27dvh}
.t-table-corner{position:absolute!important;display:block!important;width:0!important;height:0!important;padding:0!important;margin:0!important;border:0!important;pointer-events:none!important;visibility:hidden}
.tarot-room .t-shuffle-card{filter:drop-shadow(1px 3px 1px #11091488)}
.tarot-room .t-mengzhan-draw .t-fan-lift{filter:drop-shadow(1px 2px 1px #11091499)}
.tarot-room .t-slot.occupied .t-slot-card{box-shadow:1px 3px 2px #100819b3,0 0 0 1px #d6bf7a55}
@media(max-width:650px){.tarot-room.story-room:is([data-step=shuffle],[data-step=draw],[data-step=reveal]) .t-table-content{left:8%;top:60dvh;width:84%;transform:perspective(800px) rotateX(48deg)}}
@media(max-width:650px) and (max-height:700px){.tarot-room.story-room:is([data-step=shuffle],[data-step=draw],[data-step=reveal]) .t-table-content{height:24dvh;transform:perspective(700px) rotateX(48deg)}}
@media(min-aspect-ratio:2/1){.tarot-room.story-room:is([data-step=shuffle],[data-step=draw],[data-step=reveal]) .story-room-backdrop>img{object-position:50% 100%}.tarot-room.story-room:is([data-step=shuffle],[data-step=draw],[data-step=reveal]) .t-table-content{top:60dvh}}
