html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #111;
}

#container {
  width: 100vw;
  height: 100vh;
}

#hud {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: system-ui, sans-serif;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  padding: 10px 12px;
  border-radius: 10px;
  user-select: none;
}

#titleRow {
  font-weight: 700;
  margin-bottom: 6px;
}

#touchControls {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) scale(0.8);
  transform-origin: bottom center;
  display: grid;
  grid-template-columns: 64px 64px 64px;
  grid-template-rows: 64px 64px;
  gap: 10px;
  pointer-events: none; /* buttons will re-enable */
}

.btn {
  pointer-events: auto;
  font-size: 20px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  backdrop-filter: blur(6px);
}

/* Hide touch controls on desktop-ish pointers */
@media (hover: hover) and (pointer: fine) {
  #touchControls {
    display: none;
  }
}

/* === WIN SCREEN (leave here even if not added yet) === */
#winScreen {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#winCard {
  font-family: system-ui, sans-serif;
  color: white;
  background: rgba(20, 20, 20, 0.9);
  padding: 24px 28px;
  border-radius: 16px;
  max-width: 520px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

#winCard h1 {
  margin: 0 0 10px 0;
  font-size: 26px;
}

#winCard p {
  margin: 0 0 18px 0;
  font-size: 16px;
  opacity: 0.9;
}

#winCard button {
  font-size: 16px;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

#btnBackToMenu {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

#btnBackToMenu:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Main Menu Overlay */
#menuScreen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(8px);
  z-index: 50;
}

#menuCard {
  width: min(520px, calc(100vw - 32px));
  background: rgba(20, 24, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 18px 16px;
  color: white;
  font-family: system-ui, sans-serif;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#menuTitle {
  margin: 0 0 6px 0;
  font-size: 34px;
  letter-spacing: 0.5px;
}

#menuSubtitle {
  margin: 0 0 14px 0;
  opacity: 0.9;
}

.menuRow {
  margin: 12px 0;
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 12px;
}

.menuInline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#difficultySelect {
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

#difficultySelect option {
  color: black;
}

.radioPill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
}

.radioPill input {
  accent-color: #66ffcc;
}

#btnStart {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: rgba(102, 255, 204, 0.85);
  color: #0b0f14;
}

#btnStart:hover {
  filter: brightness(1.05);
}

.menuHint {
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.85;
  text-align: center;
}

#levelScreen {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 30;
}

.rngOption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(120, 0, 0, 0.08);
  color: #ddd;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

/* eery glow on hover */
.rngOption:hover {
  background: rgba(120, 0, 0, 0.14);
  box-shadow: 0 0 10px rgba(180, 30, 30, 0.15);
}

.rngOption input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #777;
  background: #111;
  position: relative;
  cursor: pointer;
}

.rngOption input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
