* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  background: #0d0620;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
}

#game-container {
  position: relative;        /* Ankerpunkt für absolut positionierte GIF-Ebene */
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a0a2e;       /* Fallback-Hintergrund wenn Canvas transparent */
}

/* GIF-Hintergrund-Ebene (Größe + Position werden per JS auf Canvas gesetzt) */
#level1-gif-bg {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: 0 0;
}

canvas {
  position: relative;        /* Damit z-index wirkt */
  z-index: 1;
  display: block;
  touch-action: none;
}

/* ── Rotate-to-landscape overlay ──────────────────────────────── */
.rotate-notice {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0d0620;
  color: #ffcc00;
  font-family: Arial, sans-serif;
  font-size: 18px;
  text-align: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
}

.rotate-notice .rotate-icon {
  font-size: 60px;
  display: inline-block;
  animation: tilt90 1.6s ease-in-out infinite alternate;
}

@keyframes tilt90 {
  from { transform: rotate(0deg);  }
  to   { transform: rotate(90deg); }
}

/* Show overlay (and hide canvas) only in portrait on small screens */
@media screen and (orientation: portrait) and (max-width: 900px) {
  .rotate-notice { display: flex; }
  #game-container { visibility: hidden; }
}
