html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  user-select: none;
}

body {
  font-family: "Press Start 2P", monospace;
}

canvas {
  display: block;
  touch-action: none;
}

.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modalOverlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.rulesDialog {
  width: min(720px, 100%);
  border: 2px solid rgba(77, 184, 255, 0.86);
  background: rgba(0, 8, 14, 0.92);
  box-shadow:
    0 0 22px rgba(77, 184, 255, 0.55),
    inset 0 0 16px rgba(77, 184, 255, 0.18);
  color: #fff;
  padding: 28px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.95);
}

.rulesDialog h1 {
  margin: 0 0 22px;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.5;
}

.rulesDialog ol {
  display: grid;
  gap: 16px;
  margin: 0;
  padding-left: 28px;
  font-size: 13px;
  line-height: 1.65;
}

#rulesCloseButton {
  width: 100%;
  margin-top: 28px;
  padding: 18px 22px;
  border: 2px solid rgba(77, 184, 255, 0.82);
  background: #4db8ff;
  color: #000;
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(77, 184, 255, 0.55);
}

#rulesCloseButton:active {
  transform: scale(0.985);
}

#actions {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  z-index: 12;
  display: grid;
  justify-items: center;
  gap: 14px;
}

#startButton,
#botButton {
  box-sizing: border-box;
  min-width: min(42vw, 430px);
  padding: 34px 72px;
  border: 2px solid rgba(77, 184, 255, 0.82);
  background: rgba(2, 18, 28, 0.2);
  color: #ffffff;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(20px, 2.2vw, 34px);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow:
    0 0 14px rgba(77, 184, 255, 0.4),
    inset 0 0 10px rgba(77, 184, 255, 0.22);
  text-shadow:
    0 1px 0 #000,
    0 0 8px rgba(0, 0, 0, 0.95),
    0 0 16px rgba(0, 0, 0, 0.75);
  transition:
    transform 0.2s ease,
    box-shadow 0.3s ease,
    background 0.3s ease,
    color 0.3s ease;
  animation: buttonAura 3s infinite ease-in-out;
}

#startButton:hover,
#botButton:hover,
#botButton:focus-visible {
  background: #4db8ff;
  color: #000;
  text-shadow: none;
  box-shadow:
    0 0 22px rgba(77, 184, 255, 1),
    0 0 56px rgba(77, 184, 255, 0.8);
}

#startButton:active,
#botButton:active {
  transform: scale(0.985);
}

#startButton:disabled {
  cursor: wait;
  opacity: 0.7;
}

#statusText {
  min-height: 14px;
  max-width: min(90vw, 680px);
  margin: 0;
  color: #ff6b6b;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

@keyframes buttonAura {
  0%,
  100% {
    box-shadow:
      0 0 12px rgba(77, 184, 255, 0.35),
      0 0 28px rgba(77, 184, 255, 0.2);
  }
  50% {
    box-shadow:
      0 0 22px rgba(77, 184, 255, 1),
      0 0 60px rgba(77, 184, 255, 0.78);
  }
}

@media (max-width: 700px) {
  .modalOverlay {
    padding: 16px;
  }

  .rulesDialog {
    padding: 20px;
  }

  .rulesDialog h1 {
    font-size: 13px;
  }

  .rulesDialog ol {
    gap: 12px;
    padding-left: 22px;
    font-size: 10px;
  }

  #rulesCloseButton {
    padding: 16px 18px;
    font-size: 14px;
  }

  #startButton,
  #botButton {
    width: calc(100% - 56px);
    min-width: 0;
    padding: 22px 16px;
    font-size: 18px;
  }

  #actions {
    width: 100%;
    bottom: 48px;
  }
}
