/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a2e;
  font-family: "Pacifico", cursive;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

/* ── Game Wrapper ─────────────────────────────────────────────────────────── */
#game-wrapper {
  position: relative;
  /* Skaliert auf die größtmögliche Größe ohne Seitenverhältnis (620:480) zu brechen */
  width: min(100vw, calc(100vh * 620 / 480));
  height: min(100vh, calc(100vw * 480 / 620));
  overflow: hidden;
  border-radius: 0;
  box-shadow: 0 0 60px rgba(0, 200, 255, 0.2);
}

/* Desktop: auf 620×480 deckeln und abgerundete Ecken */
@media (min-width: 700px) {
  #game-wrapper {
    width: min(620px, calc(100vh * 620 / 480));
    height: min(480px, calc(100vw * 480 / 620));
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(0, 200, 255, 0.25), 0 0 0 3px rgba(255,255,255,0.08);
  }
}

canvas {
  display: block;
  /* Spiellogik läuft intern auf 620×480 – CSS streckt die Ausgabe auf Wrapper-Größe */
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* ── Secret Message Overlay ───────────────────────────────────────────────── */
#secret-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.4s ease;
}

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

#secret-box {
  background: linear-gradient(135deg, #0f3460, #16213e);
  border: 2px solid rgba(255, 215, 0, 0.6);
  border-radius: 20px;
  padding: 6% 8%;
  text-align: center;
  max-width: 85%;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.2), inset 0 0 20px rgba(255,255,255,0.03);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#secret-emoji {
  font-size: clamp(32px, 10vw, 64px);
  margin-bottom: 12px;
  animation: bounce 1s infinite alternate ease-in-out;
}

#secret-title {
  font-family: "Pacifico", cursive;
  font-size: clamp(14px, 4vw, 22px);
  color: #FFD700;
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

#secret-text {
  font-family: sans-serif;
  font-size: clamp(12px, 3vw, 15px);
  color: #cce4ff;
  line-height: 1.6;
  margin-bottom: 24px;
}

#secret-close {
  font-family: "Pacifico", cursive;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1a1a2e;
  border: none;
  border-radius: 50px;
  padding: 10px 28px;
  font-size: clamp(12px, 3vw, 15px);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(255, 165, 0, 0.4);
}

#secret-close:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 28px rgba(255, 165, 0, 0.6);
}

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}
