*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #05020c;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: Nunito, system-ui, sans-serif;
  color: #f4ecff;
}

.stage {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  /* Notch und Home-Indikator freihalten, resize() rechnet mit diesem Padding */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(120, 50, 160, 0.18), transparent 60%),
    #05020c;
}

#game {
  display: block;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 30px 80px rgba(0, 0, 0, 0.6);
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

:fullscreen #game {
  border-radius: 0;
  box-shadow: none;
}

/* Kleine Bildschirme: Spielfläche randlos */
@media (max-width: 1100px), (max-height: 640px) {
  #game {
    border-radius: 0;
    box-shadow: none;
  }
}

/* Handy im Hochformat: Hinweis zum Drehen */
.rotate {
  display: none;
}

@media (orientation: portrait) and (max-width: 700px) {
  .rotate {
    position: fixed;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 18px;
    padding: 32px;
    text-align: center;
    background: rgba(5, 2, 12, 0.94);
  }

  .rotate svg {
    animation: rotate-hint 2.4s ease-in-out infinite;
  }

  .rotate p {
    margin: 0;
    max-width: 280px;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
  }

  .rotate strong {
    display: block;
    margin-bottom: 6px;
    font-size: 22px;
    font-weight: 900;
    color: #ffcf7a;
  }
}

@keyframes rotate-hint {
  0%, 25% { transform: rotate(0); }
  55%, 100% { transform: rotate(-90deg); }
}

@media (prefers-reduced-motion: reduce) {
  .rotate svg {
    animation: none;
  }
}
