* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

canvas {
  display: block;
  image-rendering: crisp-edges;
}

#game-wrapper {
  position: relative;
  display: inline-block;
}

/* Overlay shared styles */
#auth-overlay,
#account-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#auth-overlay.hidden,
#account-overlay.hidden {
  display: none;
}

.overlay-card {
  background: #1a1a2e;
  border: 2px solid #F39C12;
  border-radius: 16px;
  padding: 26px 24px;
  text-align: center;
  width: 82%;
  max-width: 290px;
}

.overlay-card h2 {
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 16px;
}

.overlay-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: Arial, sans-serif;
  border: 2px solid #444;
  border-radius: 8px;
  background: #0B0C1E;
  color: #fff;
  text-align: center;
  outline: none;
  margin-bottom: 10px;
}

.overlay-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.overlay-input:focus {
  border-color: #F39C12;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 10px 28px;
  font-size: 16px;
  font-family: Arial, sans-serif;
  font-weight: bold;
  background: #F39C12;
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 12px;
}

.btn-primary:hover {
  background: #e67e22;
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 10px 28px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  font-weight: bold;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.error-text {
  color: #e74c3c;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 10px;
  min-height: 0;
}

.error-text:empty {
  display: none;
}

.overlay-links {
  margin-bottom: 12px;
}

.overlay-links a {
  display: block;
  color: #F39C12;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  margin-bottom: 6px;
  cursor: pointer;
}

.overlay-links a:hover {
  text-decoration: underline;
}

.account-info {
  color: rgba(255, 255, 255, 0.85);
  font-family: Arial, sans-serif;
  font-size: 15px;
  margin-bottom: 10px;
}

/* Hide display name field in sign-in mode */
#auth-name.hidden {
  display: none;
}

/* Lobby overlay */
#lobby-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#lobby-overlay.hidden {
  display: none;
}

.lobby-code {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 18px !important;
  font-weight: bold;
}

.lobby-divider {
  color: rgba(255, 255, 255, 0.5);
  font-family: Arial, sans-serif;
  font-size: 13px;
  margin: 12px 0;
}
