html, body {
  margin: 0;
  padding: 0;
  background: #0c1420;
  height: 100%;
  overscroll-behavior: contain;        /* без pull-to-refresh и перескролла */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;                   /* запрет выделения */
  -webkit-tap-highlight-color: transparent;
}

#game {
  touch-action: manipulation;          /* тап = клик, без zoom/двойного тапа */
}
#mobileButtons {
  position: fixed; left: 0; right: 0; bottom: 14px; pointer-events: none;
}
#mobileButtons button {
  width: 35px; height: 35px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,.08); color:#fff; font-size:18px;
  margin: 0 10px; pointer-events: auto;
}
#btnLeft  { position: absolute; left: 16px; }
#btnRight { position: absolute; right: 16px; }

:root{--bg:#0b1420;--pane:#152233;--text:#e6f0ff;--brand:#18c29c;--ghost:#113049}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Inter,Roboto,Arial}
#game{display:block;margin:0 auto;max-width:100vw;max-height:100vh;background:url('assets/background.png') center/cover no-repeat}
#hud{position:fixed;left:10px;top:56px;font-size:28px;font-weight:700;text-shadow:0 2px 4px #0008}
#hud #score::before{content:'Score: ';opacity:.85;font-weight:500}
#topbar{position:fixed;left:0;right:0;top:0;height:44px;display:flex;align-items:center;justify-content:space-between;
  padding:0 12px;background:#0e1b2a;border-bottom:1px solid #0f2b42;z-index:5}
#topbar .brand{font-weight:800;letter-spacing:.2px}
#playerBadge{opacity:.9}
dialog.dlg{border:none;background:var(--pane);color:var(--text);padding:18px 20px;border-radius:12px;max-width:520px;width:92%}
dialog::backdrop{background:#0008}
h3{margin:.2rem 0 1rem}
menu{display:flex;gap:10px;justify-content:center;margin-top:10px}
.btn{background:var(--brand);color:#021a16;border:none;border-radius:10px;padding:10px 16px;font-weight:700;cursor:pointer}
.btn-ghost{background:var(--ghost);color:#bfe8ff}
.rules{display:flex;gap:14px;align-items:center}
.rules .legend{width:72px;height:auto;border-radius:8px;border:1px solid #0004;background:#001a}
.leaders{padding-left:20px}
.leaders li{display:flex;justify-content:space-between;padding:6px 4px}
input{width:100%;padding:10px;border-radius:10px;border:1px solid #27405d;background:#0e1b2a;color:var(--text)}
