body {
  margin: 0;
  background: #111;
  color: #fff;
  font-family: 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
}
.main-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 18px;
}
h1 {
  margin-bottom: 10px;
  font-size: 2.7rem;
  letter-spacing: 3px;
  font-weight: 900;
  text-shadow: 0 2px 12px #000;
}
#pong {
  display: block;
  background: #111;
  border: 4px solid #fff;
  border-radius: 12px;
  box-shadow: 0 0 15px #0006;
  margin-top: 8px;
  margin-bottom: 12px;
  width: 96vw;
  max-width: 900px;
  height: auto;
  aspect-ratio: 16 / 10;
}
#scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 94vw;
  max-width: 880px;
  margin: 0 0 16px 0;
  font-size: 1.5rem;
  user-select: none;
}
#scoreboard .player {
  flex: 1 1 33%;
  text-align: center;
}
#scoreboard .round {
  flex: 1 1 33%;
  text-align: center;
  font-size: 1.2rem;
}
#menu {
  margin: 10px 0 24px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
#menu button {
  padding: 11px 30px;
  background: #1c1c1c;
  color: #fff;
  border: 2px solid #32e6e6;
  border-radius: 8px;
  font-size: 1.1rem;
  margin: 3px 0;
  box-shadow: 0 2px 10px #0003;
  cursor: pointer;
  transition: background .17s, border-color .17s;
}
#menu button:hover {
  background: #32e6e6;
  color: #1c1c1c;
  border-color: #fff;
}
.overlay {
  position: fixed;
  top: 0; left: 0;
  height: 100vh; width: 100vw;
  background: rgba(20,22,36,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
}
.overlay-content {
  background: #23243c;
  color: #fff;
  border-radius: 18px;
  padding: 28px 34px 24px 34px;
  min-width: 330px;
  max-width: 92vw;
  box-shadow: 0 2px 40px #0008;
  text-align: center;
  font-size: 1.2rem;
}
.overlay-content h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 2.2rem;
  letter-spacing: 1px;
}
.overlay-content label, .overlay-content select, .overlay-content input {
  font-size: 1rem;
  margin: 7px 0;
}
.overlay-content button {
  margin: 14px 7px 0 7px;
  padding: 9px 26px;
  background: #32e6e6;
  border: none;
  border-radius: 7px;
  font-size: 1.1rem;
  cursor: pointer;
  color: #1c1c1c;
  transition: background .18s;
}
.overlay-content button:hover { background: #44f; color: #fff; }
.hidden { display: none !important; }
#helpOverlay ul {
  text-align: left;
  margin: 0 auto 14px auto;
  max-width: 360px;
  font-size: 1.04rem;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 2.2rem;
  transform: translateX(-50%);
  min-width: 190px;
  max-width: 80vw;
  text-align: center;
  background: #222e;
  color: #ffeb3b;
  border: 2px solid #ffeb3b;
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 1.25rem;
  font-weight: bold;
  z-index: 99;
  box-shadow: 0 2px 22px #0008;
  opacity: 1;
  transition: opacity .24s;
}
.toast.hidden { opacity: 0; pointer-events: none; }
@media (max-width: 650px) {
  h1 { font-size: 2rem; }
  #scoreboard { font-size: 1.05rem; }
  .overlay-content { min-width: 60vw; font-size: 1rem; }
  #pong { border-width: 2px; }
}