/* Game pages: a slim bar (home, title, fullscreen, menu) above the game. The
   menu drawer holds the description and how to play. */
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:var(--game-bg,#101215);color:#eef0f4;font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;-webkit-text-size-adjust:100%}
button{font:inherit;color:inherit}
#app{position:fixed;inset:0;display:flex;flex-direction:column;background:var(--game-bg,#101215)}
.bar{flex:none;height:46px;display:flex;align-items:center;gap:10px;padding:0 8px 0 12px;padding-top:env(safe-area-inset-top);height:calc(46px + env(safe-area-inset-top));background:#17141c;border-bottom:1px solid rgba(255,255,255,.07)}
.bar .home{display:flex;align-items:center;gap:8px;color:#fff;text-decoration:none;font-weight:800;font-size:15px;flex:none}
.bar .home img{width:28px;height:28px;border-radius:8px}
.bar .title{flex:1;min-width:0;font-weight:600;color:#cfc8d8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}
.bar .title::before{content:"/";margin-right:10px;color:#6c6475}
.bar .actions{display:flex;gap:4px;flex:none}
.icon-btn{width:38px;height:38px;border:0;border-radius:10px;background:transparent;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:#e8e3ef}
.icon-btn:hover,.icon-btn:focus-visible{background:rgba(255,255,255,.1)}
.icon-btn svg{width:22px;height:22px}
#stage{flex:1;min-height:0;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;padding-bottom:env(safe-area-inset-bottom)}
#frame{position:relative;width:100%;height:100%}
#stage[data-layout="portrait"] #frame{width:auto;height:100%;aspect-ratio:9/16;max-width:100%}
@supports not (aspect-ratio:1){#stage[data-layout="portrait"] #frame{width:min(100%,56.25vh)}}
#canvas{display:block;position:absolute;inset:0;width:100%;height:100%;outline:none;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
#status{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;text-align:center;background:var(--game-bg,#101215);z-index:2}
#status[hidden]{display:none}
#status img{width:84px;height:84px;border-radius:22px}
.track{width:min(260px,70vw);height:6px;border-radius:999px;background:rgba(255,255,255,.12);overflow:hidden}
#status-bar{height:100%;width:0;background:#c9b8ff;border-radius:999px;transition:width .2s}
.track.indeterminate #status-bar{width:40%!important;animation:slide 1.2s ease-in-out infinite}
@keyframes slide{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}

/* Menu drawer */
#menu{position:absolute;inset:0;z-index:10;display:flex;justify-content:flex-end;background:rgba(8,6,12,.55)}
#menu[hidden]{display:none}
.drawer{width:min(400px,100%);height:100%;overflow-y:auto;background:#f7f6f9;color:#232027;padding:18px 20px calc(24px + env(safe-area-inset-bottom));box-shadow:-10px 0 40px rgba(0,0,0,.35);animation:drawer .18s ease-out}
@keyframes drawer{from{transform:translateX(40px);opacity:0}}
.drawer-head{display:flex;align-items:center;gap:14px;margin-bottom:12px}
.drawer-head img{width:64px;height:64px;border-radius:16px;flex:none}
.drawer-head h2{margin:0;font-size:21px;line-height:1.2}
.drawer-head p{margin:2px 0 0;color:#6f6a75;font-size:13px}
.drawer-head .icon-btn{margin-left:auto;color:#232027;align-self:flex-start}
.drawer-head .icon-btn:hover{background:rgba(0,0,0,.06)}
.drawer h3{font-size:15px;margin:20px 0 6px;padding-left:9px;border-left:4px solid #2a2233}
.drawer p,.drawer li{color:#45404b;font-size:14px}
.drawer ol{padding-left:20px;margin:6px 0}
.drawer li{margin:4px 0}
.menu-actions{display:grid;gap:8px;margin:16px 0 6px}
.menu-actions button,.menu-actions a{display:flex;align-items:center;gap:10px;width:100%;border:1px solid #dedbe2;background:#fff;border-radius:14px;padding:11px 14px;font-weight:700;font-size:14px;text-decoration:none;color:#232027;cursor:pointer;text-align:left}
.menu-actions .primary{background:#2a2233;border-color:#2a2233;color:#fff}
.menu-actions svg{width:18px;height:18px;flex:none}
.more{display:flex;gap:12px;overflow-x:auto;padding-bottom:4px}
.more a{flex:none;width:84px;text-align:center;text-decoration:none;color:#232027;font-size:12px;font-weight:600}
.more img{display:block;width:84px;height:84px;border-radius:18px;object-fit:cover;margin-bottom:4px}
.drawer footer{margin-top:22px;color:#8a8590;font-size:12px}
.drawer footer a{color:#8a8590}
html.zh .en,html.en .zh{display:none!important}
@media(max-width:420px){.bar .home span{display:none}}
