/* Structural layout. Material, type and state treatments live in lucky.css. */
* { box-sizing:border-box; }
html,body { margin:0; height:100%; overflow:hidden; touch-action:manipulation; }
button { cursor:pointer; padding:0; }
button,input,textarea { font:inherit; }
[hidden] { display:none !important; }
#app { position:fixed; inset:0; }
#scene { position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; }
#fx-layer { position:absolute; inset:0; overflow:hidden; z-index:6; pointer-events:none; }
#hud { position:absolute; inset:0; pointer-events:none; z-index:8; }
#hud-top { position:absolute; top:calc(20px + var(--safe-t)); left:0; right:var(--shop-w); min-height:110px; }
#logo-space { display:none; }
#pickup-slot { position:absolute; left:8px; top:52px; pointer-events:auto; }
#pickup-slot:empty { display:none; }
#counter { position:absolute; left:50%; transform:translateX(-50%); pointer-events:auto; }
#chips { display:flex; align-items:center; }
#goal { position:absolute; top:104px; left:50%; transform:translateX(-50%); display:none; align-items:center; pointer-events:auto; }
#goal.show { display:flex; }
#goal .ginfo { display:flex; align-items:center; gap:8px; }
#goal .gbar { position:relative; flex:none; overflow:hidden; }
#goal .gbar i { position:absolute; inset:0 auto 0 0; width:calc(var(--p,0)*100%); }
#crown-slot { position:absolute; left:16px; top:108px; display:flex; flex-direction:column; gap:8px; pointer-events:auto; }
#hud-buttons { position:absolute; right:20px; top:0; display:flex; flex-direction:column; align-items:stretch; z-index:30; pointer-events:auto; }
.hud-btn { display:flex; align-items:center; gap:8px; flex:none; }
.hud-menu { align-self:flex-end; justify-content:center; }
#hud-buttons .hud-btn:not(.hud-menu) { display:none; }
#hud-buttons.open .hud-btn:not(.hud-menu) { display:flex; }
#buff-tray { position:absolute; left:18px; top:180px; display:flex; flex-direction:column; align-items:flex-start; gap:6px; max-width:175px; pointer-events:auto; }
.buff { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.buff .sweep,.buff .pips { display:none; }
#roll-wrap { position:absolute; left:0; right:var(--shop-w); bottom:26px; display:flex; justify-content:center; pointer-events:none; }
#roll-btn { position:relative; display:flex; flex-direction:column; justify-content:center; align-items:center; pointer-events:auto; }
#roll-btn .ring { position:absolute; inset:-9px; width:calc(100% + 18px); height:calc(100% + 18px); transform:rotate(-90deg); pointer-events:none; }
#shop { position:absolute; top:20px; right:16px; width:calc(var(--shop-w) - 32px); max-height:calc(100% - 40px); display:flex; flex-direction:column; z-index:7; }
#shop-tabs { flex:none; display:flex; gap:4px; }
.tab { position:relative; flex:1 1 0; min-width:0; display:flex; flex-direction:column; justify-content:center; align-items:center; }
.tab-ico { position:relative; display:inline-grid; place-items:center; }
#shop-head { flex:none; display:flex; align-items:center; gap:8px; }
#shop-title { flex:1; min-width:0; }
#shop-title>.ico { display:none; }
#buy-mode { display:flex; flex:none; gap:2px; }
#shop-close { display:none; flex:none; place-items:center; }
#shop-body { flex:0 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; }
#shop-summary { display:none; }
#shop-more { flex:none; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.row { display:grid; grid-template-columns:56px minmax(0,1fr) 100px; align-items:center; gap:10px; }
.row .thumb { position:relative; display:grid; place-items:center; width:56px; height:58px; }
.row .thumb img { width:100%; height:100%; object-fit:contain; }
.row .thumb.combo-pat { display:flex; flex-wrap:wrap; align-content:center; justify-content:center; gap:2px; }
.row .mid { min-width:0; display:flex; flex-direction:column; gap:5px; }
.row .top { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px; }
.row .bar { position:relative; overflow:hidden; }
.row .bar i { position:absolute; inset:0 auto 0 0; width:calc(var(--p,0)*100%); }
.row .eff { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px; }
.row .need { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.row .need .bar { flex:1; }
.buy { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; overflow:hidden; }
.buy .p { display:flex; align-items:center; gap:4px; }
.buy .fill { position:absolute; inset:auto auto 0 0; width:calc(var(--p,0)*100%); }
.buy.can .fill { display:none; }
#toasts,#toasts-minor { position:absolute; left:18px; bottom:22px; z-index:9; pointer-events:none; max-width:min(310px,calc(100vw - var(--shop-w) - 32px)); }
#toasts { bottom:92px; }
.toast,.toast-minor { display:flex; align-items:center; gap:10px; }
#modal-root { position:absolute; inset:0; z-index:30; display:none; place-items:center; padding:calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); }
#modal-root.show { display:grid; }
.modal { width:min(520px,100%); max-height:100%; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:16px; flex:none; }
.modal>.body { min-height:0; overflow:auto; overscroll-behavior:contain; }
.modal>.actions { display:flex; justify-content:flex-end; gap:10px; flex:none; }
.mbtn { display:inline-flex; justify-content:center; align-items:center; gap:8px; }
.ico { display:inline-flex; width:1em; height:1em; line-height:0; vertical-align:-.14em; flex:none; }
.ico svg { width:100%; height:100%; }
.screen-reader-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
#pointer { display:none; }
body.shop-hidden:not(.phone) { --shop-w:0px; }
body.shop-hidden:not(.phone) #shop { visibility:hidden; }
body.phone { --shop-w:0px; }
body.phone #hud-top { top:calc(10px + var(--safe-t)); right:0; }
body.phone #counter { max-width:calc(100vw - 122px); }
body.phone #goal { top:88px; max-width:calc(100vw - 24px); }
body.phone.sheet #goal { display:none; }
body.phone #hud-buttons { right:10px; }
body.phone #crown-slot { left:10px; top:132px; }
body.phone #buff-tray { left:10px; top:180px; }
body.phone #shop { top:auto; bottom:0; left:0; right:0; width:100%; max-height:none; padding-bottom:var(--safe-b); }
body.phone #shop-summary { display:flex; align-items:center; gap:12px; height:84px; flex:none; padding:10px 16px; }
body.phone #shop-open { flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:4px; height:60px; justify-content:center; }
body.phone:not(.sheet) #shop-head,body.phone:not(.sheet) #shop-body,body.phone:not(.sheet) #shop-tabs,body.phone:not(.sheet) #shop-more { display:none; }
body.phone.sheet #shop { height:var(--phone-sheet-height,46%); }
body.phone.sheet #shop-summary { display:none; }
body.phone #shop-head { order:0; padding-right:92px; display:flex; flex-wrap:wrap; min-height:90px; }
body.phone #shop-title { flex:1; }
body.phone #buy-mode { order:3; }
body.phone #shop-close { display:grid; }
body.phone #shop-tabs { order:1; }
body.phone #shop-more { order:2; }
body.phone #shop-body { order:3; flex:1; }
body.phone #roll-wrap { right:0; bottom:calc(104px + var(--safe-b)); }
body.phone.sheet #roll-wrap { left:auto; right:16px; bottom:calc(var(--phone-sheet-height,46%) - 74px + var(--safe-b)); }
body.phone #toasts,body.phone #toasts-minor { left:10px; bottom:calc(204px + var(--safe-b)); max-width:calc(100vw - 20px); }
body.phone.sheet #toasts,body.phone.sheet #toasts-minor { display:none; }
body.short:not(.phone) { --shop-w:320px; }
body.short #hud-top { top:10px; }
body.short #goal,body.short #crown-slot { display:none; }
body.short #buff-tray { top:82px; }
body.short #roll-wrap { left:auto; right:calc(var(--shop-w) + 16px); bottom:18px; }
body.short #shop { top:10px; right:10px; width:calc(var(--shop-w) - 20px); max-height:calc(100% - 20px); }
@media(max-width:350px) { .row { grid-template-columns:40px minmax(0,1fr) 88px; gap:7px; } .row .thumb { width:40px; } }
