body {
  background: #181818;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  margin: 0;
}

#game-title {
  text-align: center;
  color: #fff;
  font-family: 'Segoe UI', 'Courier New', Courier, monospace;
  font-size: 2.5rem;
  letter-spacing: 2px;
  margin: 36px 0 18px 0;
  text-shadow: 0 2px 8px #000a;
}

#game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

#player-name {
  padding: 4px 12px;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #888;
  outline: none;
  width: 120px;
}
#player-name:focus {
  border: 1.5px solid #0057ff;
}

#difficulty {
  padding: 4px 10px;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #888;
}

.canvas-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 0;
}

#pong {
  background: #222;
  display: block;
  border: 4px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 16px #000a;
}

#score {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 2.5rem;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 1px 0 #000, 0 2px 8px #000a;
  z-index: 2;
}

#timer {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  color: #eee;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.4rem;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 1px 0 #000, 0 2px 8px #000a;
  z-index: 2;
}

#buttons {
  margin: 16px auto 0 auto;
  text-align: center;
}

#buttons button {
  font-size: 1.2rem;
  margin: 0 6px;
  padding: 4px 18px;
  border: none;
  border-radius: 5px;
  background: #333;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
#buttons button:disabled {
  background: #555;
  color: #aaa;
  cursor: not-allowed;
}
#buttons button:not(:disabled):hover {
  background: #0057ff;
}

#history {
  margin-top: 20px;
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.1rem;
  max-width: 800px;
  background: #222b;
  border-radius: 8px;
  padding: 12px 22px 8px 22px;
  display: none;
}
#history table {
  width: 100%;
  border-spacing: 0;
  margin-top: 6px;
}
#history th, #history td {
  text-align: center;
  padding: 2px 6px;
}
#history th {
  color: #7fd6ff;
  font-weight: 500;
  font-size: 1.08em;
}