* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  height: 100vh;
  background: linear-gradient(to bottom, #e3f2fd, #ffffff);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}

body.dark-theme {
  background: linear-gradient(to bottom, #1a237e, #303f9f);
  color: #ffffff;
}

.header {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  margin-bottom: 20px;
}

.profile-links a {
  color: #1976d2;
  text-decoration: none;
  margin-right: 15px;
  font-weight: bold;
}

.profile-links a:hover {
  text-decoration: underline;
}

.theme-toggle button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle button:hover {
  background: rgba(0, 0, 0, 0.1);
}

body.dark-theme .theme-toggle button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-wrapper {
  position: relative;
  border: 2px solid #222;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

body.dark-theme .game-wrapper {
  border-color: #ddd;
  background: #2d2d2d;
}

canvas {
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

button {
  padding: 12px 28px;
  font-size: 18px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  background: #4caf50;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

button:hover {
  background: #43a047;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}