html:has(.game-shell){height:100%;overscroll-behavior:none}
.game-shell{margin:0;height:100vh;height:100dvh;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);background:#1e221c linear-gradient(135deg,#352117,#1c2a23);isolation:isolate}
.game-shell:before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(90deg,#181711a8,#1b211993 58%,#21180c97),url(assets/table.webp) center/cover}
.game-shell .mast{height:auto;background:#162820f2;padding:env(safe-area-inset-top) max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left));border-bottom:1px solid #9f8657}
.game-shell .mast-inner{height:clamp(38px,6.8dvh,64px);width:min(1180px,100%);gap:14px}
.game-shell .mast .brand{font-size:clamp(16px,2.2vw,24px);flex:none}
.game-shell .brand svg{width:clamp(24px,3vw,37px);height:auto}
.game-title{font:600 clamp(13px,1.4vw,19px) Crimson,Georgia;color:#ead8b4;margin-right:auto}
.mast-tools{display:flex;align-items:center;gap:8px;margin-left:auto}
.game-shell .guide-button,#sound-button{border:1px solid #807d60;border-radius:4px;color:#efe4c8;background:#26382e;display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:5px 10px}
#sound-button{width:34px;padding:6px}#sound-button svg{width:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#sound-button[aria-pressed=false] .sound-on,#sound-button[aria-pressed=true] .sound-off{display:none}
.game-shell .page{display:grid;grid-template-rows:minmax(0,1fr);width:100%;margin:0 auto;min-height:0;min-width:0;padding:clamp(6px,1.5dvh,15px) max(clamp(6px,2vw,34px),env(safe-area-inset-right)) max(clamp(6px,1.5dvh,15px),env(safe-area-inset-bottom)) max(clamp(6px,2vw,34px),env(safe-area-inset-left))}
.game-shell #app{display:grid;grid-template: minmax(0,1fr)/minmax(0,1fr);width:100%;max-width:1200px;margin:auto;min-width:0;min-height:0;height:100%}
#guide{max-height:calc(100dvh - 16px);width:min(440px,calc(100vw - 18px));padding:clamp(12px,2.5vmin,26px);border:3px double #a98b55;box-shadow:0 12px 80px #100d09a8}
.guide-head,.guide-tabs,.guide-turn{display:flex;align-items:center;gap:8px}.guide-head{justify-content:space-between}.guide-head h2{margin:0;font:600 31px/1.1 Crimson,Georgia}.guide-head .close{min-width:36px;min-height:32px;line-height:1}.guide-tabs{margin:10px 0;border-bottom:1px solid #d5c19c;padding-bottom:7px}.guide-tabs button,.guide-turn button{border:1px solid #b8a782;background:#f3ead6;border-radius:4px;font-size:12px;min-height:34px;padding:5px 10px;color:#413529}.guide-tabs button[aria-pressed=true]{background:var(--forest);color:#fff0cd;border-color:#3f5144}.guide-text{display:grid;align-content:center;gap:5px;min-height:min(180px,38dvh)}.guide-kicker{font-size:10px;letter-spacing:.14em;color:#80633d}.guide-text h3{font:600 26px/1.04 Crimson,Georgia;margin:1px 0}.guide-text p{font:14px/1.45 Inter,Arial;margin:3px 0}.guide-text small{color:#516148;font-size:12px}.guide-turn{justify-content:space-between;margin-top:10px}.guide-qr{display:flex;flex-direction:column;align-items:center;gap:8px}.guide-qr canvas{width:min(215px,32dvh)!important;height:auto!important}.guide-qr a{font-size:13px}
@media(max-width:560px){.game-title{display:none}.game-shell .mast-inner{gap:5px}.game-shell .guide-button{font-size:11px}}
@media(max-height:430px){.game-shell .mast-inner{height:31px}.game-shell .mast .brand{font-size:15px}.game-shell .brand svg{width:22px}.game-shell .guide-button,#sound-button{min-height:26px;height:26px}.game-shell .page{padding:3px 7px max(3px,env(safe-area-inset-bottom))}.guide-head h2{font-size:24px}.guide-tabs{margin:4px 0}.guide-text{min-height:0;gap:2px}.guide-text h3{font-size:22px}.guide-text p{font-size:12px}.guide-turn{margin-top:5px}}
.host-qr{height:100vh;height:100dvh;display:grid;place-items:center;padding:8px}.host-qr .join{margin:0;padding:8px;width:min(100%,540px);display:grid;justify-items:center;align-content:center;gap:6px}.host-qr .join>img{width:clamp(26px,6dvh,60px);height:auto}.host-qr .join p,.host-qr .join h1,.host-qr .join canvas{margin:0}.host-qr .join canvas{width:min(82vw,48dvh,350px)!important;height:auto!important}.host-qr .join a{overflow-wrap:anywhere}.host-qr .join p{font-size:13px}.host-qr .join>p:has(a){max-width:95%}
@media(orientation:landscape) and (max-height:440px){.host-qr .join{max-width:660px;width:100%;grid-template-columns:minmax(180px,1fr) minmax(160px,1fr);grid-template-rows:repeat(6,auto);align-items:center;align-content:center}.host-qr .join canvas{grid-column:2;grid-row:1/7;width:min(42vw,84dvh)!important}.host-qr .join>*:not(canvas){grid-column:1}.host-qr .join h1{font-size:30px}}
