.overlay-modal {
  position: absolute;
  inset: 0;
  background-color: rgba(22, 47, 78, 0.92);
  backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  z-index: 50;
  border-radius: 12px;
  text-align: center;
  padding: 20px 20px 28px;
  box-sizing: border-box;
  overflow-y: auto;
}

.overlay-modal.active {
  display: flex;
}

#highscore-entry-modal {
  justify-content: center;
}

#leaderboard-modal {
  position: fixed;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 680px);
  max-height: 88vh;
  border-radius: 16px;
  padding: 20px 24px 24px;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

#best-board-modal {
  justify-content: flex-start;
  padding-top: 10px;
  padding-bottom: 10px;
}

.initials-wrapper {
  position: relative;
  display: inline-flex;
  gap: 10px;
  margin: 15px 0;
}

.hidden-initials-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 10;
  cursor: pointer;
  font-size: 16px;
}

.initial-tile {
  width: clamp(40px, calc(var(--game-size) * 0.15), 70px);
  height: clamp(40px, calc(var(--game-size) * 0.15), 70px);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(24px, calc(var(--game-size) * 0.1), 48px);
  font-family: Arial, sans-serif;
  font-weight: bold;
  background-color: #fdf6e3;
  color: #1a1a1a;
  border-radius: 6px;
  box-shadow:
    inset 3px 3px 5px rgba(255, 255, 255, 1),
    inset -3px -3px 5px rgba(0, 0, 0, 0.15),
    2px 3px 5px rgba(0, 0, 0, 0.4);
}

/* NEW WINNER OVERLAY STYLES */
.winner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 35, 60, 0.9);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.winner-overlay.active {
  opacity: 1;
}

.winner-title {
  color: var(--highlight);
  margin-bottom: 12px;
  font-size: 36px;
  text-align: center;
  line-height: 1.2;
  padding: 0 20px;
}

.winner-initials {
  font-size: 72px;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 0 0 16px #ffaa00;
  text-align: center;
}