@font-face {
  font-family: 'Innogy';
  src: url('/ui/fonts/Innogy-Regular.otf') format('opentype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Innogy';
  src: url('/ui/fonts/Innogy-Bold.otf') format('opentype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Innogy';
  src: url('/ui/fonts/Innogy-BoldItalic.otf') format('opentype');
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

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

:root {
  --blitzy-safe-top: env(safe-area-inset-top, 0px);
  --blitzy-safe-right: env(safe-area-inset-right, 0px);
  --blitzy-safe-bottom: env(safe-area-inset-bottom, 0px);
  --blitzy-safe-left: env(safe-area-inset-left, 0px);
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #0d0620;
  overflow: hidden;
  font-family: 'Innogy', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-synthesis: none;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: fixed;
  inset: 0;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

#game-container {
  position: fixed;           /* Ankerpunkt fuer Canvas + DOM-Overlay */
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  background: #1a0a2e;       /* Fallback-Hintergrund wenn Canvas transparent */
  overflow: hidden;
}

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

canvas {
  position: absolute;        /* Phaser zentriert das Canvas, Container clippt Ueberstand */
  z-index: 1;
  display: block;
  touch-action: none;
  inset: 0;
  margin: auto;
  max-width: none;
  max-height: none;
  image-rendering: auto;
  image-rendering: optimizeQuality;
  image-rendering: -webkit-optimize-contrast;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* ── Rotate-to-landscape overlay ──────────────────────────────── */
.rotate-notice {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(circle at top, rgba(255, 204, 0, 0.16), transparent 36%),
    linear-gradient(180deg, #09040f 0%, #130a24 100%);
  color: #ffcc00;
  font-family: 'Innogy', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-align: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px;
  pointer-events: auto;
}

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

.rotate-notice .rotate-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rotate-notice .rotate-subtitle {
  font-size: 13px;
  font-weight: 400;
  color: #8899bb;
}

.rotate-fullscreen-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffda44 0%, #ffab00 100%);
  color: #1a0a2e;
  font-family: 'Innogy', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 24px;
  min-width: 220px;
  box-shadow: 0 12px 30px rgba(255, 171, 0, 0.25);
}

.rotate-fullscreen-btn[hidden] {
  display: none;
}

body.blitzy-mobile-blocked .rotate-notice {
  display: flex;
}

body.blitzy-mobile-blocked #game-container {
  visibility: hidden;
}

@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; }
}
