/* Five complete shortcuts and half of the next one make the horizontal scroll visible. */
body.hud-shortcuts-ready{
 --hud-movement-bottom:calc(148px + env(safe-area-inset-bottom));
 --hud-tools-bottom:calc(240px + env(safe-area-inset-bottom));
}
body #app #hud-shortcuts{
 position:absolute;left:50%;bottom:calc(var(--hud-bottom) + 62px);z-index:8;
 width:min(272px,calc(80vw - 19.2px));height:40px;box-sizing:border-box;transform:translateX(-50%);
 padding:0;border:1px solid var(--hud-edge);border-radius:11px;background:var(--hud-surface);
 color:var(--hud-text);box-shadow:inset 0 1px 0 #ffffff08;
 backdrop-filter:var(--hud-blur);-webkit-backdrop-filter:var(--hud-blur);overflow:hidden;
}
#hud-shortcuts .hud-shortcuts-track{
 display:flex;align-items:stretch;width:100%;height:100%;padding:0;margin:0;gap:0;
 overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;touch-action:pan-x;
 scrollbar-width:none;-webkit-overflow-scrolling:touch;scroll-behavior:smooth;
}
#hud-shortcuts .hud-shortcuts-track::-webkit-scrollbar{display:none}
body #app #hud-shortcuts .hud-shortcut{
 flex:0 0 calc(100% / 5.5);width:calc(100% / 5.5);min-width:0;max-width:none;min-height:38px;height:38px;
 display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1px;box-sizing:border-box;
 margin:0;padding:1px 2px;border:0!important;border-radius:0;background:transparent!important;
 color:var(--hud-text)!important;box-shadow:none!important;backdrop-filter:none;-webkit-backdrop-filter:none;
 font:500 9px/1.1 var(--ui-font);letter-spacing:-.025em;text-align:center;text-shadow:0 1px 2px #0003;
 touch-action:pan-x;transition:color .15s,opacity .15s;
}
body #app #hud-shortcuts .hud-shortcut>svg{
 display:block;flex:none;width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;
 stroke-linecap:round;stroke-linejoin:round;
}
body #app #hud-shortcuts .hud-shortcut>span{
 display:flex;align-items:center;justify-content:center;min-height:18px;max-width:100%;
 white-space:normal;overflow-wrap:anywhere;line-height:9px;overflow:hidden;
}
body #app #hud-shortcuts .hud-shortcut[data-shortcut=language]>svg{width:17px;height:11px;stroke:none}
body #app #hud-shortcuts .hud-shortcut:is(:hover,[aria-pressed=true],[aria-expanded=true]){
 color:var(--hud-gold)!important;background:transparent!important;
}
body #app #hud-shortcuts .hud-shortcut:active{opacity:.7}
body #app #hud-shortcuts .hud-shortcut:disabled{opacity:.35;cursor:default}
body #app #hud-shortcuts .hud-shortcut:focus-visible{outline:2px solid var(--hud-gold);outline-offset:-3px;border-radius:9px}
body #app #hud-shortcuts #hud-shortcuts-add>svg{width:13px;height:13px;transform:translateX(-7px)}
body #app #hud-shortcuts #hud-shortcuts-add>span{display:none}
body.hud-shortcuts-ready #visitor-social button.social-say-toggle{display:none!important}
body.hud-shortcuts-ready #visitor-social .social-presets{
 left:50%;right:auto;bottom:calc(var(--hud-bottom) + 120px);transform:translateX(-50%);
 width:min(320px,calc(100vw - 24px));max-height:calc(100dvh - 220px);box-sizing:border-box;
}
body.hud-shortcuts-ready #app #allocation-launcher{bottom:calc(136px + env(safe-area-inset-bottom))}
body.hud-shortcuts-ready #app #niche-navigation{bottom:calc(var(--hud-bottom) + 122px)}
body.hud-shortcuts-ready #app #niche-tribute{top:auto;bottom:calc(var(--hud-bottom) + 184px)}
body.hud-shortcuts-ready #app #toast{bottom:calc(var(--hud-bottom) + 122px)}

body #app #grove-return{
 position:absolute;right:max(12px,env(safe-area-inset-right));top:calc(max(8px,env(safe-area-inset-top)) + 60px);z-index:9;
 display:flex;align-items:center;justify-content:center;gap:4px;width:auto;min-width:68px;height:34px;min-height:34px;
 padding:5px 8px;border-radius:11px;box-sizing:border-box;font:500 10px/1.2 var(--ui-font);white-space:nowrap;
}
body #app #grove-return svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
body #app #grove-return[hidden],body:not([data-scene=grove]) #app #grove-return{display:none!important}
body.panel-open #app #grove-return,
body[data-hud-menu-open=true] #app #grove-return,
body[data-hud-shortcuts-open=true] #app #grove-return,
body[data-admin-ui-hidden=true] #app #grove-return,
body[data-niche-ui-hidden=true] #app #grove-return,
body[data-petting=true] #app #grove-return,
body[data-constellation=true] #app #grove-return,
body[data-offering=true] #app #grove-return,
body[data-tribute-ceremony=true] #app #grove-return,
body:has(dialog[open]) #app #grove-return{visibility:hidden;pointer-events:none}

body #hud-shortcuts-dialog{
 width:min(380px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
 box-sizing:border-box;margin:auto;padding:14px 16px 12px;overflow:auto;overscroll-behavior:contain;
 border:1px solid var(--hud-edge);border-radius:20px;background:rgba(27,32,29,.96);color:var(--hud-text);
 font:400 13px/1.5 var(--ui-font);box-shadow:0 16px 48px #0005;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
}
#hud-shortcuts-dialog::backdrop{background:#08110d80}
#hud-shortcuts-dialog .hud-shortcuts-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
#hud-shortcuts-dialog h2{margin:0;font-size:17px;font-weight:600;line-height:1.35;letter-spacing:-.035em}
body #hud-shortcuts-dialog #hud-shortcuts-close{
 display:grid;place-items:center;flex:none;width:40px;height:40px;min-height:40px;padding:9px;margin-right:-6px;
 border:0;background:transparent!important;color:var(--hud-text)!important;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;
}
#hud-shortcuts-close svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
#hud-shortcuts-dialog .hud-shortcuts-description{margin:3px 0 5px;font-size:12px;color:var(--hud-muted);line-height:1.65}
#hud-shortcuts-dialog .hud-shortcuts-count{display:block;text-align:right;margin:0 0 10px;color:var(--hud-gold);font-size:11px;font-variant-numeric:tabular-nums}
#hud-shortcuts-dialog .hud-shortcut-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
body #hud-shortcuts-dialog .hud-shortcut-options button{
 display:grid;grid-template-columns:20px minmax(0,1fr);align-items:center;gap:2px 8px;
 min-width:0;min-height:52px;padding:8px;border:1px solid #e7e9e41f;border-radius:10px;
 background:transparent!important;color:var(--hud-text)!important;text-align:left;font:500 12px/1.35 var(--ui-font);
 box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;
}
#hud-shortcuts-dialog .hud-shortcut-options button>svg{grid-column:1;grid-row:1 / span 2;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#hud-shortcuts-dialog .hud-shortcut-options button[data-shortcut-option=language]>svg{stroke:none}
#hud-shortcuts-dialog .hud-shortcut-options button>span{grid-column:2;min-width:0;overflow-wrap:anywhere}
#hud-shortcuts-dialog .hud-shortcut-options button>small{grid-column:2;color:inherit;opacity:.75;font-size:9px;line-height:1.2}
body #hud-shortcuts-dialog .hud-shortcut-options button[aria-pressed=true]{border-color:#e7c97980;color:var(--hud-gold)!important;background:#e7c9790b!important}
body #hud-shortcuts-dialog .hud-shortcut-options button:hover{border-color:#e7c97980;background:#ffffff06!important}
body #hud-shortcuts-dialog button:focus-visible{outline:2px solid var(--hud-gold);outline-offset:1px}
#hud-shortcuts-dialog .hud-shortcuts-status{margin:9px 0 0;min-height:18px;font-size:11px;color:#f0c7ba;line-height:1.6}

body.panel-open #app #hud-shortcuts,
body[data-petting=true] #app #hud-shortcuts,
body[data-constellation=true] #app #hud-shortcuts,
body[data-admin-ui-hidden=true] #app #hud-shortcuts,
body[data-niche-ui-hidden=true] #app #hud-shortcuts,
body[data-tribute-ceremony=true] #app #hud-shortcuts,
body[data-offering=true] #app #hud-shortcuts,
body[data-pebble-open=true] #app #hud-shortcuts,
body:has(#seo-content[open]) #app #hud-shortcuts,
body:has(dialog[open]) #app #hud-shortcuts,
body[data-hud-menu-open=true] #app #hud-shortcuts{visibility:hidden;pointer-events:none}
body[data-hud-shortcuts-open=true] #app :is(#movement,#gift-bag,#sns-links,#support-launcher,#constellation-entry,#allocation-launcher),
body[data-hud-shortcuts-open=true] #niche-photo-controls{visibility:hidden}

/* The grove keeps its care panel; the same shortcut strip sits directly above it. */
body.hud-shortcuts-ready[data-scene=grove]{--hud-movement-bottom:calc(128px + env(safe-area-inset-bottom));--hud-tools-bottom:calc(220px + env(safe-area-inset-bottom))}
body.hud-shortcuts-ready[data-scene=grove] #app #hud-shortcuts{bottom:calc(max(12px,env(safe-area-inset-bottom)) + var(--hud-grove-height,56px) + 6px)}
body.hud-shortcuts-ready[data-scene=grove] #visitor-social .social-presets{bottom:calc(128px + env(safe-area-inset-bottom));max-height:calc(100dvh - 220px)}
body.hud-shortcuts-ready[data-scene=grove] #tree-rest-action{bottom:calc(128px + env(safe-area-inset-bottom))}
body.hud-shortcuts-ready[data-scene=grove] #app #toast{bottom:calc(128px + env(safe-area-inset-bottom))}
@media(max-width:360px){body #app #hud-shortcuts{width:calc(80vw - 12.8px)}}
@media(max-height:620px){body.hud-shortcuts-ready:not([data-scene=grove]){--hud-movement-bottom:calc(128px + env(safe-area-inset-bottom));--hud-tools-bottom:calc(220px + env(safe-area-inset-bottom))}}
@media(max-height:500px) and (min-width:620px){
 body.hud-shortcuts-ready{--hud-movement-bottom:calc(122px + env(safe-area-inset-bottom));--hud-tools-bottom:calc(132px + env(safe-area-inset-bottom))}
 body.hud-shortcuts-ready #app #allocation-launcher{bottom:var(--hud-bottom)}
 body.hud-shortcuts-ready #visitor-social .social-presets{left:var(--hud-left);bottom:calc(132px + env(safe-area-inset-bottom));transform:none;width:252px;max-height:calc(100dvh - 210px)}
 body.hud-shortcuts-ready[data-scene=grove]{--hud-movement-bottom:calc(84px + env(safe-area-inset-bottom));--hud-tools-bottom:calc(150px + env(safe-area-inset-bottom))}
 body.hud-shortcuts-ready[data-scene=grove] #app #hud-shortcuts{left:auto;right:calc(12px + min(170px,24vw));transform:translateX(50%);width:min(272px,44vw)}
 body.hud-shortcuts-ready[data-scene=grove] #tree-rest-action{left:calc(var(--hud-left) + 100px);bottom:calc(84px + env(safe-area-inset-bottom));transform:none}
 body.hud-shortcuts-ready[data-scene=grove] #visitor-social .social-presets{bottom:calc(68px + env(safe-area-inset-bottom));max-height:calc(100dvh - 146px)}
}
@media(prefers-reduced-motion:reduce){#hud-shortcuts .hud-shortcuts-track{scroll-behavior:auto}body #app #hud-shortcuts .hud-shortcut{transition:none}}
