* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  position: fixed;          /* lock the page so mobile can't scroll/bounce */
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1020;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  /* cursor is hidden by JS only during active play (we draw a crosshair then);
     a normal cursor shows on menus/shop/results so buttons are clickable. */
  touch-action: none;
}

/* ---- HTML overlays (initials entry + update banner) ---- */
#update-banner {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 50%;
  transform: translateX(-50%);
  margin-top: 10px;
  background: #1b5fd8;
  color: #fff;
  font: bold 15px "Trebuchet MS", sans-serif;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  z-index: 30;
  -webkit-user-select: none;
  user-select: none;
}

#initials-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 26, 0.72);
  z-index: 40;
}
#initials-modal[hidden] { display: none; }

.modal-card {
  background: #16213e;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 22px 26px 20px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  max-width: 86vw;
}
#initials-title {
  font: bold 28px "Trebuchet MS", sans-serif;
  color: #ffe9a8;
}
.modal-sub {
  margin: 6px 0 14px;
  color: #cde;
  font: 15px "Trebuchet MS", sans-serif;
}
#initials-input {
  width: 180px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 14px;
  font: bold 40px "Trebuchet MS", monospace;
  padding: 8px 0 8px 14px;     /* offset the trailing letter-spacing */
  border-radius: 10px;
  border: 2px solid #7adfff;
  background: #0b1020;
  color: #fff;
  outline: none;
}
#initials-error {
  min-height: 18px;
  margin-top: 8px;
  color: #ff8a8a;
  font: 13px "Trebuchet MS", sans-serif;
}
.modal-buttons {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  justify-content: center;
}
.modal-buttons button {
  font: bold 18px "Trebuchet MS", sans-serif;
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  color: #fff;
}
#initials-ok { background: #1f9d6b; }
#initials-skip { background: #5a6478; }

/* sound toggle — fixed bottom-left, always available */
#sound-toggle {
  position: fixed;
  left: calc(12px + env(safe-area-inset-left, 0));
  bottom: calc(12px + env(safe-area-inset-bottom, 0));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(10, 16, 32, 0.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 30;
  -webkit-user-select: none;
  user-select: none;
}

/* feedback modal reuses .modal-card / .modal-buttons */
#feedback-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 26, 0.72);
  z-index: 40;
}
#feedback-modal[hidden] { display: none; }
#feedback-title {
  font: bold 26px "Trebuchet MS", sans-serif;
  color: #ffe9a8;
}
#feedback-text, #feedback-name {
  width: min(78vw, 420px);
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  border: 2px solid #7adfff;
  background: #0b1020;
  color: #fff;
  font: 16px "Trebuchet MS", sans-serif;
  padding: 10px 12px;
  outline: none;
}
#feedback-text { resize: vertical; margin-bottom: 10px; }
#feedback-error {
  min-height: 18px;
  margin-top: 8px;
  color: #ff8a8a;
  font: 13px "Trebuchet MS", sans-serif;
}
#feedback-send { background: #1f9d6b; }
#feedback-cancel { background: #5a6478; }
