
#storyScene{position:absolute;inset:0;z-index:24;display:flex;flex-direction:column;gap:10px;padding:14px;box-sizing:border-box;line-height:1.5;background:linear-gradient(#2e1011b8,#281014e8),var(--scene-rug) center/cover;color:var(--cream)}
.scene-top,.scene-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px}.scene-top{font-size:.8rem}.scene-top .pb{min-height:36px;font-size:.73rem;padding:0 10px}.scene-stage{position:relative;flex:1;min-height:100px;overflow:hidden;border-radius:20px;border:3px solid var(--ink);background:radial-gradient(ellipse at bottom,#ac663a88,#34192144)}.scene-body{position:absolute;bottom:-8%;height:102%;max-width:100%;object-fit:contain;left:50%;transform:translateX(-50%);filter:drop-shadow(0 5px 0 #24120b80);animation:scene-breathe 3.1s ease-in-out infinite}.scene-gift{position:absolute;bottom:12px;right:10px;width:23%;filter:drop-shadow(0 4px 0 #0006)}.scene-title{position:absolute;top:10px;right:10px;left:10px;text-align:center;font-size:1.25rem;color:var(--gold);text-shadow:0 2px var(--ink)}.scene-dialogue{background:var(--cream);color:var(--ink);border:3px solid var(--ink);border-radius:18px;padding:12px 14px;box-shadow:0 5px 0 var(--ink)}.scene-dialogue>b{color:#9c3028}.scene-dialogue p{font-size:1rem;line-height:1.65;margin:5px 0 10px;min-height:3.2em}.scene-bottom>span{font-size:.75rem;opacity:.65}.scene-bottom .pb{min-height:40px}.story-replay{min-height:32px!important;font-size:.75rem!important;padding:0 14px!important;margin-bottom:5px}.story-chapter{font-size:.78rem;line-height:1.4;color:var(--gold);margin:0 0 4px;text-align:center}
#sheet.instant-score{z-index:23;pointer-events:auto;opacity:1;transition:none;background:#24120bd9;padding:12px;box-sizing:border-box;line-height:1.4}.score-paper{display:flex;flex-direction:column;gap:8px;background:#fff5dc;color:var(--ink);border:3px solid var(--ink);border-radius:18px;padding:12px;width:100%;max-height:100%;box-sizing:border-box;box-shadow:0 5px 0 #24120b}.score-paper header{display:flex;justify-content:space-between;font-size:1.15rem}.score-paper header>span{color:#a74135}.score-totals{display:grid;grid-template-columns:1fr 1fr;text-align:center;background:#f2dfb5;border-radius:12px;padding:5px;font-size:.85rem}.score-totals strong{display:block;font-size:2rem;line-height:1.15}.score-totals small{font-size:.75rem;color:#95422c}.score-scroll{overflow:auto;min-height:0;touch-action:pan-y;scrollbar-width:thin}.score-scroll table{border-collapse:collapse;width:100%;font-size:.82rem}.score-scroll th,.score-scroll td{padding:5px 3px;border-bottom:1px solid #cbb88d}.score-scroll th{text-align:right;font-weight:600}.score-scroll td{text-align:center;min-width:35px;font-weight:800;direction:ltr}.score-scroll th small{font-size:.65rem;opacity:.7}.score-total-row{background:#f6e8c8}.score-total-row:last-child{color:#813025;font-size:.95rem}.project-detail{font-size:.75rem;margin-top:8px}.project-detail p{margin:2px 0}.score-explain{font-size:.65rem;opacity:.8;margin:6px 0}.score-paper>.pb{min-height:40px;flex:none}.score[role=button]{cursor:pointer}.score[role=button]:focus-visible{outline:3px solid var(--gold)}
@keyframes scene-breathe{50%{transform:translateX(-50%) translateY(-3px) rotate(.5deg)}}
@media(max-height:650px){#storyScene{gap:6px;padding:10px}.scene-dialogue{padding:9px 11px}.scene-dialogue p{font-size:.9rem}.score-paper{padding:8px;gap:5px}.score-scroll th,.score-scroll td{padding:3px;font-size:.75rem}.score-totals strong{font-size:1.55rem}}
@media(prefers-reduced-motion:reduce){.scene-body{animation:none}}

#storyScene.opening{background:#381c17;gap:8px;justify-content:center}
.opening-shot{flex:1;min-height:0;display:grid;place-items:center;overflow:hidden;background:#381c17}
.opening-shot img{width:100%;height:100%;object-fit:contain;min-height:0;filter:drop-shadow(0 3px 5px #1a090888)}
#storyScene.opening .scene-dialogue{flex:none}#storyScene.opening .scene-dialogue p{min-height:0}
#storyScene.opening .scene-bottom{justify-content:flex-end}

#ask.bids .pb{font-size:1.04rem;min-height:47px;padding:0 13px}
#ask.bids.many{gap:4px}#ask.bids.many .pb{padding:0 8px;font-size:.93rem}
#clubMenu{box-sizing:border-box;width:min(310px,88vw);border:3px solid var(--ink);border-radius:20px;color:var(--ink);background:var(--cream);font-family:var(--ui);padding:16px;line-height:1.5}
#clubMenu::backdrop{background:#211009bb}#clubMenu h2{margin:0 0 12px;font-size:1.3rem}.volume-line{display:flex;gap:8px;align-items:center;margin:6px 0 14px}.volume-line input{flex:1;min-width:0;accent-color:#a84c2e;direction:ltr}
.menu-buttons{display:grid;gap:8px}.menu-buttons .pb{min-height:42px}
.club-paper{gap:12px;padding:15px}.club-paper table{width:100%;border-collapse:collapse;text-align:center}.club-paper td,.club-paper th{padding:6px 4px;border-bottom:1px solid #d7bd92}.club-paper th:first-child{text-align:right}.club-paper .big-number{font-size:1.34rem;font-weight:800}.club-paper .big-number:last-child{font-size:1.85rem;background:#f3db9e}.club-paper [data-review]{margin:0;text-align:center;font-weight:700;color:#8c3024}
.club-screen{min-height:0;flex:1;display:grid;place-items:center}.club-screen video{max-width:100%;max-height:100%;width:100%;object-fit:contain}.film-caption{background:var(--cream);color:var(--ink);border-radius:14px;padding:10px 13px;font-size:.96rem;line-height:1.6}.film-caption b{color:#a23c2b}.film-caption p{margin:2px 0}.film-caption:has(p:empty){display:none}



/* One table covering the visible viewport. Controls sit inside the safe area. */
:root{--controls-space:62px;--portrait-size:clamp(82px,12vmin,96px)}
html,body{width:100%;height:100%;margin:0;padding:0}
#wrap{position:fixed;inset:0;width:100%;height:100%;height:100dvh;box-sizing:border-box;border:0;border-radius:0;box-shadow:none}
#cv{position:absolute;inset:0;width:100%;height:100%}
#bar{position:fixed;z-index:5;left:0;right:0;bottom:0;margin:0;min-height:var(--controls-space);box-sizing:content-box;pointer-events:none;padding:0 max(5px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(5px,env(safe-area-inset-left))}
#acts,#projs{pointer-events:auto}
body:has(#start:not([hidden]),#stage:not([hidden]),#sheet:not([hidden]),#storyScene:not([hidden]),#quit:not([hidden]),#giftWin:not([hidden])) #bar{visibility:hidden}
#hud{top:max(9px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right))}
.fc{justify-content:flex-start;transform:translate(-50%,0);margin-top:calc(var(--portrait-size) * -.5)}
.fc:has([data-seat="1"]){left:clamp(16%,calc(100% - 49px),86%)!important}
.fc:has([data-seat="3"]){left:clamp(14%,49px,84%)!important}
.fc canvas{transition:none}.fc.talking canvas{transform:none}
#stage .op img{animation:none}
.club-paper{font-family:var(--ui);font-size:1rem;line-height:1.45;max-width:430px;overflow:auto;touch-action:pan-y}
.club-paper header,.club-paper .big-number,.club-paper .big-number:last-child{font-size:1rem}
.club-paper header.contract-won,.club-paper header.contract-won span{color:#226437}
.club-paper header.contract-lost,.club-paper header.contract-lost span{color:#a1332b}
#storyScene{align-items:stretch}.film-caption,.scene-dialogue{width:min(100%,620px);align-self:center;box-sizing:border-box}
#stage .lvl{max-width:950px}
#start .st[data-st="wear"]{height:100%;justify-content:flex-start;overflow:auto;padding:62px 10px 24px;touch-action:pan-y}
#wearList,.wcat,.wrow{min-width:0}
#start .st[data-st="wear"] #wearList{max-width:510px}
.wt{position:relative}.wt .from-face{position:absolute;top:3px;right:3px;width:23px;height:23px;border-radius:50%;border:1.5px solid var(--ink);background:var(--cream);object-fit:cover;filter:none}
.wt.lock .from-face{filter:none}.wt .from-name{font:.66rem/1.2 var(--ui);color:var(--gold)}
.wt .sleeve-swatch{width:60px;height:62px;overflow:hidden;display:grid;align-items:center}
.wt .sleeve-swatch img{width:100%;height:61px;object-fit:cover;object-position:center top;border-radius:6px}
.hand .ri{height:auto;object-fit:contain;transition:none}
.giver-portrait{width:52px!important;height:52px!important;object-fit:cover;border:2px solid var(--gold);border-radius:50%;background:var(--cream);animation:none!important}
@media(max-height:520px){:root{--controls-space:45px;--portrait-size:clamp(52px,13vmin,68px)}#acts .pb,#projs .pb,#qopts .pb{min-height:37px}#stage{padding-top:42px}#stage .lv{min-height:180px}#stage .lv .op2 canvas{width:46px;height:46px}#stage .lvl{flex-shrink:0}#start{overflow:auto;touch-action:pan-y}#start .st:not([data-st="wear"]){margin:auto;padding-block:46px 8px}.club-paper{gap:3px;padding:7px 12px}.club-paper th,.club-paper td{padding:2px 4px}}

.hand{overflow:visible;clip-path:inset(-28px 0 0)}

.hand{width:clamp(145px,27vh,181px);aspect-ratio:591/1088}
.hand .fb{width:15%;height:26%}.hand .watch-preview{position:absolute;height:auto;transform:translate(-50%,-62%);pointer-events:none}
#wearList .fhand{grid-area:preview}
@media(min-width:660px){#start .st[data-st="wear"] #wearList{display:grid;max-width:780px;grid-template-columns:minmax(210px,.65fr) minmax(0,1fr);grid-template-areas:"preview ." "preview ." "preview .";align-items:center}.wr.fhand{align-self:stretch;justify-content:center}}

/* The playing surface sits between two independent control rows. */
#table-shell{display:grid;grid-template-rows:auto minmax(0,1fr) auto;width:min(100%,max(280px,calc(56.6dvh - 62px)));height:100%;height:100dvh;margin-inline:auto;box-sizing:border-box}
#wrap{position:relative;inset:auto;width:100%;height:100%;min-height:0;grid-row:2}
#hud{position:relative;inset:auto;grid-row:1;box-sizing:border-box;min-height:48px;padding:max(4px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 4px max(8px,env(safe-area-inset-left));width:100%}
#bar{position:relative;inset:auto;grid-row:3;box-sizing:border-box;width:100%;min-height:var(--controls-space);padding:5px max(4px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left));flex-wrap:wrap;align-content:center}
#ask.bids,#ask.bids.many{position:static;display:flex;flex-flow:row wrap;inset:auto;gap:5px;max-width:100%;pointer-events:auto;align-items:center;justify-content:center}
#bar #siklB{position:static;transform:none;pointer-events:auto;animation:none;min-height:38px}
#bar #acts{max-width:100%;flex-wrap:wrap}
#table-shell:has(#start:not([hidden]),#stage:not([hidden]),#storyScene:not([hidden]),#quit:not([hidden]),#giftWin:not([hidden])){grid-template-rows:0 minmax(0,1fr) 0}
#table-shell:has(#start:not([hidden]),#stage:not([hidden]),#storyScene:not([hidden]),#quit:not([hidden]),#giftWin:not([hidden])) > :is(#hud,#bar){display:none}
@media(orientation:portrait){#table-shell{width:100%}}



#claimAudit{position:absolute;z-index:6;inset:auto 3% 1.5%;text-align:center;color:var(--cream);line-height:1.5}#claimAudit p{display:table;background:#312219;margin:.3em auto;padding:.35em .65em;border-radius:10px}

/* Illustrated pages use the full drawing, including the hands and playing cards. */
body:has(#storyScene.opening:not([hidden])) #table-shell{width:min(100%,600px)}
#storyScene.opening{padding:clamp(10px,3vw,22px);gap:10px;background:radial-gradient(ellipse at 70% 20%,#663726,#2c1816 80%);font-family:var(--ui);justify-content:space-between}
.comic-head,.comic-meta,.comic-turn{display:flex;justify-content:space-between;align-items:center;gap:10px}
.comic-head h2{margin:0;color:#ffe6b5;font:800 1.35rem/1.35 var(--ui)}
.comic-head .pb{min-height:36px}.comic-space{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;container-type:size}
.comic-plate{position:relative;display:flex;flex-direction:column;align-items:stretch;margin:0;width:min(100%,max(180px,calc(100cqh - 112px)));max-width:100%;direction:rtl}
.comic-image{display:block;width:100%;aspect-ratio:1;object-fit:contain;border:2px solid #29170f;box-sizing:border-box;border-radius:12px;box-shadow:0 4px 0 #271810}
.comic-balloon,.story-balloon{background:#fff4d9;color:#362217;border:2px solid #362217;border-radius:16px;box-shadow:0 3px 0 #352013;line-height:1.45;text-align:right;box-sizing:border-box}
.comic-balloon{position:relative;z-index:1;margin:0 3% clamp(-48px,-7cqw,-12px);padding:8px 13px 10px}
.comic-balloon::after,.story-balloon::after{position:absolute;content:"";left:clamp(5%,var(--speaker-x,50%),93%);bottom:-8px;width:12px;height:12px;background:#fff4d9;border-right:2px solid #362217;border-bottom:2px solid #362217;transform:rotate(45deg) skew(12deg,12deg)}
.comic-balloon b,.story-balloon b{display:block;font:800 .82rem/1.3 var(--ui);color:#945127;margin:0 0 2px}
.comic-balloon p,.story-balloon p{margin:0;font:600 clamp(.95rem,2.8vw,1.16rem)/1.5 var(--ui)}
.comic-foot{display:grid;gap:8px}.comic-count{direction:ltr;font-variant-numeric:tabular-nums;color:#efcf9f}
.comic-meta{font-size:.87rem}.comic-meta button{border:1px solid #c29a6a;border-radius:18px;padding:4px 12px;background:#482c22;color:#ffeccf;font:700 .85rem/1.2 var(--ui);min-height:32px;cursor:pointer}
.comic-turn{justify-content:stretch}.comic-turn .pb{flex:1;min-height:41px}.comic-turn .pb:disabled{opacity:.45}
#storyScene:not(.opening) .scene-stage{display:flex;flex-direction:column;padding:8px;align-items:center}
#storyScene:not(.opening) .scene-title{position:static;order:-1;font-size:1rem}
.story-balloon{position:relative;width:min(95%,510px);padding:8px 12px;z-index:1}
#storyScene:not(.opening) .scene-body{height:68%;bottom:-3%}
@media(max-height:520px){#storyScene.opening{gap:3px;padding:5px 10px}.comic-foot{display:flex;align-items:center;justify-content:space-between}.comic-meta,.comic-turn{gap:5px}.comic-turn .pb{min-height:33px}.comic-head h2{font-size:1.05rem}.comic-balloon p,.story-balloon p{font-size:.87rem}.comic-plate{width:min(100%,max(120px,calc(100cqh - 68px)))}.comic-balloon{margin-inline:-12%;max-width:124%;padding:4px 9px}.comic-plate .comic-balloon{min-width:min(100%,280px)}}

#photoClue{font:.9rem/1.5 var(--ui);color:var(--cream);max-width:34ch;margin:0 auto}
#giftWin.photo-ending{overflow:auto;touch-action:pan-y;box-sizing:border-box;padding:12px;justify-content:safe center;background:#2f1a15}
#giftWin.photo-ending>img:first-child{width:min(100%,560px);height:auto;max-height:39%;object-fit:contain;animation:none;border-radius:10px}
#giftWin.photo-ending .giver-portrait{display:none}
#giftWin.photo-ending>p{max-width:45ch;font:600 1rem/1.6 var(--ui)}

#table-shell{background:#351014 url(assets/welcome-sadu.webp?v=2) center / cover no-repeat}
#wrap,#start,#stage{background:transparent}
#start:has([data-st="note"]:not([hidden])) .nav3{display:none}
#start .st.welcome{gap:22px;padding:24px 14px}
#start .welcome h1{font:800 clamp(5.6rem,18vmin,9.3rem)/1.15 var(--ui);color:#ffd365;letter-spacing:normal;transform:rotate(-3deg);text-shadow:0 -1px 0 #fff0aa,0 1px 0 #ffbf44,1px 2px 0 #cd872d,2px 3px 0 #bb7527,3px 4px 0 #a75d21,4px 5px 0 #8d491b,5px 6px 0 #753718,6px 7px 0 #602917,7px 8px 0 #542317,9px 12px 0 #200e11a6,13px 19px 18px #13070ad9}
#start #begin{font:800 1.24rem/1 var(--ui);min-width:146px;min-height:52px;border:2px solid #4f271b;border-radius:32px;background:linear-gradient(#ffe398,#ffc350);color:#4a261a;box-shadow:0 4px 0 #754223,0 7px 12px #1b080a85}
#start #begin:active{transform:translateY(2px);box-shadow:0 2px 0 #754223}

#start .st.welcome{gap:0;padding:20px 10px}
.king-emblem{position:relative;width:clamp(95px,17vh,146px);aspect-ratio: .76;margin-bottom:22px;isolation:isolate;animation:king-deal .75s cubic-bezier(.2,.8,.2,1) both}
.king-emblem::before,.king-face{position:absolute;inset:0;border-radius:8%;box-shadow:0 5px 9px #16070b99}
.king-emblem::before{content:"";transform:translate(8%,-3%) rotate(7deg);background:repeating-linear-gradient(45deg,#733731 0 3px,#8e463e 4px 6px);border:3px solid #d4b88a}
.king-face{display:grid;place-items:center;background:#f5e4bc;border:2px solid #705138;transform:rotate(-6deg);box-sizing:border-box}
.king-face::before{content:"";position:absolute;inset:6%;border:1px solid #c5a46c;border-radius:5%}
.king-face picture{display:block;width:92%;transform:translateY(1%)}
.king-face img{display:block;width:100%;height:auto}
.king-face .corner{position:absolute;direction:ltr;left:8%;top:5%;color:#9a3233;font:bold clamp(15px,2.8vh,23px)/.85 Georgia,serif;z-index:1}
.king-face .corner small{display:block;font-size:.66em;line-height:1.15}
.king-face .corner.end{inset:auto 8% 5% auto;transform:rotate(180deg)}
#start .welcome h1,#start [data-st=mode] h1{font:800 clamp(2.55rem,10.5vmin,4.35rem)/1.4 var(--ui);white-space:nowrap}
#start .welcome h1{animation:king-title .7s .12s both;transform:rotate(-2deg);text-shadow:0 -1px #fff1ae,0 2px #e49b36,1px 4px #ad6228,2px 6px #6b301a,3px 9px 2px #250e11b0}
#start .welcome .slogan{font:600 clamp(1rem,3.3vmin,1.3rem)/1.55 var(--ui);color:#ffebcb;margin:2px 0 22px}
@keyframes king-deal{from{opacity:0;transform:translateY(16px) rotate(9deg) scale(.92)}to{opacity:1;transform:none}}
@keyframes king-title{from{opacity:0;translate:0 8px}to{opacity:1;translate:0}}
/* Team selection: illustrated contemporary Saudi card rooms. */
#table-shell:has(#stage:not([hidden])){width:min(100%,1120px);background:#ece9de}
#stage{box-sizing:border-box;overflow-y:auto;touch-action:pan-y;gap:0;padding:clamp(65px,10vh,86px) clamp(14px,3vw,40px) 28px;background:#ece9de;color:#193b35}
#stage .nav3{inset:10px clamp(14px,3vw,40px) auto;align-items:center;border-bottom:1px solid #cacabe;padding-bottom:8px}
#stage .nav3 .pb{font:700 .86rem/1 var(--ui);min-height:36px;padding:0 13px;border-radius:7px;border:1px solid #b6bdb1;background:#f5f3e9;color:#28443a;box-shadow:none;text-shadow:none}
#stage h2,#stage .rt{width:min(100%,1020px);text-align:start;direction:rtl;color:#203f34;text-shadow:none}
#stage h2{font:800 clamp(1.65rem,4.4vmin,2.6rem)/1.3 var(--ui);margin:0 0 12px}
#stage .rt{margin:0 0 10px}
#stage .lvl{display:grid;flex:none;width:100%;max-width:1020px;height:clamp(350px,62dvh,535px);margin:0;padding:0;gap:10px;direction:rtl;grid-template-columns:1.6fr 1fr 1fr;grid-template-rows:1fr 1fr;grid-template-areas:"featured s1 s2" "featured s3 s4"}
#stage .lvl>.lv{display:grid;grid-template-rows:minmax(0,1fr) auto;box-sizing:border-box;position:relative;isolation:isolate;overflow:hidden;min-width:0;min-height:0;width:100%;height:100%;padding:0;gap:0;border:1px solid #b8bcae;border-radius:10px;background:#f8f7ef;color:#233c32;opacity:1;filter:none;box-shadow:none;text-align:start;text-shadow:none;transition:border-color .18s,box-shadow .18s}
#stage .lvl>.lv.featured{background:#183d32;color:#fff9e8;border-color:#183d32}
#stage .lv:not(:disabled):hover,#stage .lv:focus-visible{border-color:#276951;box-shadow:0 0 0 2px #35785d;outline:none}
#stage .stage-scene{position:relative;display:block;min-height:0;overflow:hidden}
#stage .stage-poster,#stage .stage-silhouette{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 39%}
#stage .stage-poster{transition:transform .3s}
#stage .lv:not(:disabled):hover .stage-poster{transform:scale(1.018)}
#stage .stage-caption{position:relative;z-index:1;display:grid;gap:2px;background:inherit;color:inherit;padding:8px 13px;font-family:var(--ui);line-height:1.4}
#stage .stage-heading{display:flex;justify-content:space-between;align-items:baseline;gap:4px}
#stage .lv:not(:disabled) .stage-heading{display:grid;gap:0}
#stage .stage-trait{font-size:clamp(.77rem,1.55vmin,.92rem);line-height:1.5;color:#405347;font-weight:600}
#stage .featured .stage-trait{color:#f3f2dc}
#stage .stage-caption strong{font-size:clamp(1.05rem,2.6vmin,1.45rem);font-weight:800}
#stage .stage-caption small{font-size:.78rem;font-weight:600;color:#526253}
#stage .lv:not(:disabled) .stage-caption{display:grid;gap:1px;padding-inline-end:48px}
#stage .lv:not(:disabled) .stage-caption::after{content:"←";position:absolute;inset-inline-end:13px;top:50%;transform:translateY(-50%);width:30px;height:30px;border:1px solid currentColor;border-radius:50%;display:grid;place-content:center;font:20px/1 sans-serif}
#stage .featured .stage-caption{padding-block:12px}
#stage .featured .stage-caption strong{font-size:clamp(1.6rem,4vmin,2.4rem)}
#stage .featured .stage-caption small{color:#dde6cf;font-size:.92rem}
@media(max-width:650px){
  #stage{padding-inline:14px}#stage h2,#stage .rt{max-width:510px}
  #stage .lvl{height:clamp(535px,78dvh,720px);max-width:510px;gap:8px;grid-template-columns:1fr 1fr;grid-template-rows:1.58fr 1fr 1fr;grid-template-areas:"featured featured" "s1 s2" "s3 s4"}
  #stage .stage-caption{padding:6px 9px}#stage .featured .stage-caption{padding:8px 13px}#stage .stage-caption small{font-size:.71rem}
}
@media(max-height:460px){.king-emblem{width:64px;margin-bottom:5px}#start .welcome .slogan{margin-bottom:8px}#start .welcome h1{font-size:2.4rem}#stage{padding-top:55px}#stage .lvl{height:320px}}
@media(prefers-reduced-motion:reduce){.king-emblem,#start .welcome h1{animation:none}#stage .lv .stage-poster{transition:none}#stage .lv:not(:disabled):hover .stage-poster{transform:none}}

#wrap:has(#stage:not([hidden]),#start:not([hidden])) > :is(#cv,.fc,.me0,#chips,#dealer,#talk,#opts){visibility:hidden}
#stage .lvl>.lv{font-family:var(--ui);cursor:pointer}#stage .lvl>.lv:disabled{cursor:default}

*{scrollbar-width:none!important}
*::-webkit-scrollbar{display:none!important;width:0;height:0}
#table-shell:has([data-st=wear]:not([hidden])){width:min(100%,980px)}
#start .st[data-st=wear]{gap:10px;padding:56px clamp(10px,3vw,28px) 20px;justify-content:flex-start;overflow-y:auto;overflow-x:hidden}
#start .st[data-st=wear] #wearList{display:grid;grid-template-columns:minmax(150px,.64fr) minmax(0,1fr);grid-template-areas:"preview controls";align-items:start;gap:12px;max-width:880px;margin:auto 0}
#start .st[data-st=wear] .ttl{font-size:clamp(1.45rem,4vmin,2rem)}
.ward-options,.wr.fhand{border:1px solid #a77b55;border-radius:14px;background:#30161b;box-shadow:0 5px 15px #1b070745;box-sizing:border-box}
.ward-options{grid-area:controls;padding:12px;min-width:0}
.ward-tabs{display:flex;gap:4px;align-items:stretch;flex-wrap:wrap;border-bottom:1px solid #8b5e4766;padding-bottom:9px;margin-bottom:10px}
.ward-tabs button{flex:1 0 auto;padding:7px 6px;border:1px solid transparent;background:transparent;color:#f2dfc4;font:800 .87rem/1.2 var(--ui);cursor:pointer;border-radius:7px}
.ward-tabs button[aria-pressed=true]{border-color:#e9b861;background:#64412d;color:#fff0cb}
.wcat .wct{display:none}
.wcat .wrow{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(86px,100%),1fr));gap:7px;overflow:visible;padding:0;touch-action:pan-y}
.wrow .wt{min-width:0;min-height:83px;gap:3px;border:1px solid #845f51;border-radius:10px;background:#412329;padding:6px;color:#f8e8cf;box-shadow:none}
.wrow .wt[aria-pressed=true]{border:2px solid #ffd373;background:#674032;box-shadow:inset 0 0 0 1px #604137}
.wrow .wt img,.wrow .wt .none,.wrow .wt .sleeve-swatch{width:100%;height:48px;max-width:74px}
.wrow .wt .from-face{width:21px;height:21px}
.wrow .wt small{font-size:.79rem;white-space:normal}
.wrow .wt .from-name{font-size:.66rem}
.wrow img.th{object-position:center 95%}
.wrow .wt .skin-sample{background:var(--tone);display:block;width:45px;height:37px;border-radius:55% 45% 53% 47%;border:1px solid #efd5a78a;margin:4px}
.wr.fhand{margin:0;padding:12px;align-items:center;justify-content:space-between;overflow:hidden;gap:7px}
.wr.fhand>b{align-self:stretch;flex:none}
.wr .hand{width:min(100%,clamp(140px,35vh,240px));height:auto;aspect-ratio:591/1088}
.hand canvas.hi{position:absolute;inset:0;display:block;width:100%;height:100%}
.foot-demo{display:grid;gap:7px;justify-items:center;margin-top:12px}
.foot-table{width:100%;height:clamp(100px,19vh,160px);background:#4c171c url(assets/welcome-sadu.webp?v=2) center/cover;position:relative;overflow:hidden;border:1px solid #895c43;border-radius:9px}
.foot-table img{position:absolute;width:100%;right:-17%;top:30%;transform:rotate(15deg)}
.foot-table i{display:grid;place-items:center;width:24px;height:34px;position:absolute;left:57%;top:36%;border:1px solid #9e805d;border-radius:3px;transform:rotate(var(--angle));background:ivory;color:#9e2925;font:20px Georgia}
.foot-table i:nth-of-type(1){--angle:-15deg;margin-left:-20px}.foot-table i:nth-of-type(2){--angle:1deg;color:#302019}.foot-table i:nth-of-type(3){--angle:12deg;margin-left:20px}
.playing .foot-table img{animation:knee-in 1.7s both}.playing .foot-table i{animation:knee-drop 1.7s both}
@keyframes knee-in{0%{transform:translate(100%,75%) rotate(26deg)}35%,100%{transform:rotate(15deg)}}
@keyframes knee-drop{0%,42%{opacity:0;transform:translate(-110%,120%) rotate(-45deg)}70%,100%{opacity:1;transform:rotate(var(--angle))}}
@media(max-width:610px){#start .st[data-st=wear] #wearList{grid-template-columns:1fr;grid-template-areas:"preview" "controls";gap:8px;margin:0}
.wr.fhand{position:relative;display:flex;flex-direction:row;justify-content:space-evenly;align-items:center;height:clamp(130px,27dvh,240px)}
.wr.fhand>b{align-self:center;max-width:42%}.wr .hand{height:100%;width:auto;flex:none}
.ward-options{padding:8px}.ward-tabs button{padding:8px 3px;font-size:.8rem}.wcat .wrow{grid-template-columns:repeat(3,minmax(0,1fr))}.wrow .wt{min-height:69px}.wrow .wt img,.wrow .wt .sleeve-swatch,.wrow .wt .none{height:37px}.wrow .wt .from-face{height:18px}.wrow .wt small{font-size:.74rem}}
@media(prefers-reduced-motion:reduce){.playing .foot-table :is(i,img){animation:none}}

.foot-table img{inset:7% auto auto 30%;width:108%;transform-origin:0 0;transform:rotate(45deg)}
.foot-table i{left:54%;top:47%}
@keyframes knee-in{0%{transform:translate(32%,300%) rotate(45deg)}35%,100%{transform:translate(0,0) rotate(45deg)}}

.hand .watch-preview{left:0;width:100%;height:auto;transform:none}
#table-shell:has(> #wrap[style*="--match-rug"]):not(:has(#start:not([hidden]),#stage:not([hidden]),#storyScene:not([hidden]),#giftWin:not([hidden]),#quit:not([hidden]))){width:100%;background:var(--match-frame)}
#wrap:not(:has(#start:not([hidden]),#stage:not([hidden]),#storyScene:not([hidden]),#giftWin:not([hidden]),#quit:not([hidden]))){border-radius:20px;overflow:hidden;background-image:var(--match-rug);background-size:100% 100%;background-position:center;background-repeat:no-repeat}
@media(orientation:landscape){#wrap:not(:has(#start:not([hidden]),#stage:not([hidden]),#storyScene:not([hidden]),#giftWin:not([hidden]),#quit:not([hidden]))){background-size:cover}}
#table-shell:has(#wrap[style*="--match-rug"]) > :is(#hud,#bar){background-color:var(--match-frame)}
#table-shell{--match-frame:#211917}
#hud{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);padding-inline:max(8px,env(safe-area-inset-right),env(safe-area-inset-left))}
#hud>.score{grid-area:1/2;justify-self:center;background:transparent;border:0;border-radius:0;box-shadow:none;color:var(--cream);font-variant-numeric:tabular-nums}
#hud>.hbtns{grid-area:1/3;justify-self:end}
#hud>#contract{grid-area:1/1;justify-self:start}

#hud>.score b{font-size:clamp(1.45rem,4.7vmin,1.8rem);line-height:1}

.fc.portrait-trial{--portrait-size:clamp(92px,13.4vmin,106px)}
.fc.portrait-trial:has([data-seat="1"]){left:min(86%,calc(100% - var(--portrait-size)/2 - 4px))!important}
.fc.portrait-trial:has([data-seat="3"]){left:max(14%,calc(var(--portrait-size)/2 + 4px))!important}
@media(max-height:520px){.fc.portrait-trial{--portrait-size:clamp(59px,14.3vmin,76px)}}
