.game-shell {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at top, #020617, #020617);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 1);
}

canvas#game {
  border-radius: 14px;
  background: radial-gradient(circle at top, #020617, #020617);
}

.game-overlay {
  position: absolute;
  inset: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at 20% 0%,
    rgba(248, 113, 113, 0.22),
    rgba(15, 23, 42, 0.98)
  );
  border-radius: 14px;
  backdrop-filter: blur(6px);
}

.game-overlay.hidden {
  display: none;
}

.overlay-card {
  text-align: center;
  max-width: 320px;
  padding: 1.4rem 1.6rem 1.3rem;
  border-radius: 16px;
  border: 1px solid rgba(248, 113, 113, 0.6);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 1);
}

.overlay-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
}

.overlay-card p {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: #cbd5f5;
}

.game-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-swatch.pac {
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #fde047, #facc15);
}

.legend-swatch.pellet {
  border-radius: 999px;
  background: #e5e7eb;
}

.legend-swatch.rose {
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #fb7185, #e11d48);
}

.legend-swatch.heart {
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #f97373, #db2777);
}

@media (max-width: 640px) {
  .game-shell {
    padding: 0.75rem;
  }

  canvas#game {
    width: 100%;
    height: auto;
  }
}

