*{box-sizing:border-box}html,body{height:100%;margin:0}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;background:#021622;color:#e6f7ff;overflow:hidden}
#game{display:block;width:100vw;height:100vh;touch-action:none;outline:none}
#hud{position:fixed;top:0;left:0;right:0;display:flex;justify-content:space-between;gap:.5rem;padding:env(safe-area-inset-top) .75rem .5rem .75rem;z-index:5;background:linear-gradient(180deg,rgba(2,22,34,.75),rgba(2,22,34,0));backdrop-filter:saturate(1.2) blur(2px)}
#hud .left span{margin-right:1rem;font-weight:600}
#hud .right{display:flex;gap:.5rem}
button{appearance:none;border:0;border-radius:.6rem;padding:.5rem .8rem;background:#0a3555;color:#e6f7ff;font-weight:600}
button.primary{background:#0d5e90}
button:active{transform:translateY(1px)}
#overlay{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2rem;background:linear-gradient(180deg,rgba(2,22,34,.85),rgba(2,22,34,.85));z-index:10}
#overlay h1{margin-top:0}
#overlay[hidden]{display:none}
.overlay-buttons{display:flex;gap:.6rem;margin-top:.5рем;flex-wrap:wrap;justify-content:center}
@media (max-width:480px){#hud .left span{margin-right:.6rem}button{padding:.5rem .7rem;font-size:0.95rem}}
@media (prefers-contrast:more){button{outline:2px solid #fff}}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

/* лёгкая тень у HUD, чтобы читабельнее на светлых лучах */
#hud{ box-shadow: 0 2px 12px rgba(0,0,0,.15); }

/* нежные подсказки на кнопках при фокусе */
button:focus-visible{ outline:3px solid rgba(255,255,255,.8); outline-offset:2px; }

/* если у пользователя reduce motion — отключаем blur и анимации UI */
@media (prefers-reduced-motion: reduce){
  #hud{ backdrop-filter:none }
  *{ animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition-duration:0.01ms !important; }
}

/* --- disable long-press selection/callout globally --- */
html, body {
  -webkit-user-select: none;
  -webkit-touch-callout: none;      /* iOS: hide copy/lookup sheet */
  user-select: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent; /* remove grey flash */
}

/* allow selection where you actually want it (inputs, if any) */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* game surfaces / HUD */
#game, #overlay, #hud, #ui, .hud, .overlay {
  touch-action: none;               /* prevent OS gestures */
  -ms-touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
