.qm{max-width:420px;margin:0 auto;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;color:#f4ead2}
.qm *{box-sizing:border-box}
.qm-hud{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;background:#141b31;color:#f4ead2;border-radius:12px 12px 0 0;padding:8px 10px 6px;font:700 15px/1.2 system-ui,sans-serif}
.qm-hud .qm-lv{justify-self:start}
.qm-hud .qm-score{justify-self:center;font-variant-numeric:tabular-nums;font-size:19px}
.qm-mute{justify-self:end;min-width:44px;min-height:44px;padding:0 12px;border:2px dashed #e9dcc0;border-radius:10px;background:transparent;color:#f4ead2;font:700 13px system-ui,sans-serif;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.qm-timebar{height:10px;background:#0b1022;margin:0;overflow:hidden}
.qm-bar{display:block;height:100%;width:100%;transform-origin:left center;background:#d9a21b;will-change:transform}
.qm-bar.low{background:#d6493d}
.qm-timetxt{position:absolute;right:8px;top:-1px;font:800 11px/1 system-ui,sans-serif}
.qm-stage{position:relative;background:#1d2744;border-radius:0 0 12px 12px;overflow:hidden;min-height:300px}
.qm-canvas{display:block;margin:0 auto;touch-action:none;-ms-touch-action:none;cursor:grab}
.qm-hint{min-height:2.6em;margin:8px 2px 0;font:600 14px/1.3 system-ui,sans-serif;color:#4a4233;text-align:center}
.qm-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));background:rgba(14,19,38,.72)}
.qm-overlay[hidden]{display:none}
.qm-card{width:100%;max-width:340px;background:#efe6d2;color:#2a2438;border-radius:12px;padding:18px 16px 16px;text-align:center;outline:2px dashed #9b8a66;outline-offset:-8px;box-shadow:0 6px 0 rgba(0,0,0,.35)}
.qm-card h2{font:800 24px/1.1 system-ui,sans-serif;margin:0 0 6px;letter-spacing:-.01em}
.qm-card p{font:600 14px/1.4 system-ui,sans-serif;margin:0 0 12px;color:#4a4233}
.qm-row{display:flex;align-items:center;justify-content:center;gap:10px;margin:0 0 10px}
.qm-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;min-width:48px;padding:0 18px;border:0;border-radius:10px;background:#b83a32;color:#fff8e8;font:800 17px system-ui,sans-serif;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;box-shadow:0 3px 0 #6e1f1a}
.qm-btn:active{transform:translateY(2px);box-shadow:0 1px 0 #6e1f1a}
.qm-btn.alt{background:#2f8f9d;box-shadow:0 3px 0 #1a525b}
.qm-btn.alt:active{box-shadow:0 1px 0 #1a525b}
.qm-btn.ghost{background:#d8cbab;color:#2a2438;box-shadow:0 3px 0 #a99a74}
.qm-btn.wide{width:100%}
.qm-btn:disabled{opacity:.4;cursor:default}
.qm-btn:focus-visible,.qm-mute:focus-visible{outline:3px solid #fff;outline-offset:2px;box-shadow:0 0 0 6px #1d2744}
.qm-stack{display:grid;gap:10px}
.qm-lvl{font:800 18px system-ui,sans-serif;min-width:96px;text-align:center}
.qm-small{font:600 13px/1.35 system-ui,sans-serif;color:#5b503c;margin:0}
.qm-how{font:600 13px/1.4 system-ui,sans-serif;margin:0 0 12px;color:#4a4233}
@media (prefers-reduced-motion:reduce){.qm *{transition:none!important;animation:none!important}}
@media (max-height:620px){.qm-card{padding:12px}.qm-card h2{font-size:20px}}
/* full screen: native or immersive. Stage fills the screen under the dock, the canvas is sized in main.js */
html.pip-immersive .game-wrap.pip-stage,html.pip-native .game-wrap.pip-stage{display:flex;flex-direction:column;overflow:hidden!important;padding-left:8px!important;padding-right:8px!important;padding-bottom:max(6px,env(safe-area-inset-bottom))!important}
html.pip-native .game-wrap.pip-stage{padding-top:calc(var(--pip-dock-h,52px) + 8px)!important}
html.pip-immersive .qm,html.pip-native .qm{flex:1 1 auto;min-height:0;max-width:none;width:100%;display:flex;flex-direction:column;margin:0}
html.pip-immersive .qm-stage,html.pip-native .qm-stage{flex:1 1 0;min-height:0;display:flex;align-items:center;justify-content:center}
html.pip-immersive .qm-hint,html.pip-native .qm-hint{min-height:1.4em;margin:4px 2px 0;color:#d8cbab;font-size:13px}
html.pip-immersive .qm-hud,html.pip-native .qm-hud{padding:4px 10px}
html.pip-immersive .qm-overlay,html.pip-native .qm-overlay{overflow:auto;align-items:safe center}
html.pip-immersive .pip-stage>.pip-actions,html.pip-native .pip-stage>.pip-actions{display:none}
@media (orientation:landscape) and (max-height:520px){
  html.pip-immersive .qm-hint,html.pip-native .qm-hint{display:none}
  html.pip-immersive .qm-how,html.pip-native .qm-how,html.pip-immersive .qm-small,html.pip-native .qm-small{display:none}
  html.pip-immersive .qm-card,html.pip-native .qm-card{max-width:420px;padding:10px 14px}
  html.pip-immersive .qm-stack,html.pip-native .qm-stack{grid-template-columns:1fr 1fr}
  html.pip-immersive .qm-card h2,html.pip-native .qm-card h2{font-size:20px}
}
