* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Custom UI font (polish). Drop a woff2 into assets/ named `fredoka.woff2` (the free
   "Fredoka" from Google Fonts is a nice rounded fit) and it's used game-wide — the
   canvas UI stacks all list "Fredoka" first. Until the file exists it falls back to the
   system stack. Self-contained: a LOCAL file, never a CDN (CrazyGames self-containment). */
@font-face {
  font-family: "Fredoka";
  src: url("assets/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

html, body {
  width: 100%;
  height: 100%;
  /* dvh = the *dynamic* viewport, so the canvas fills the area left when a mobile
     browser's URL bar collapses on scroll, and resizes as it does. */
  height: 100dvh;
  overflow: hidden;
  background: #0b1020;
  font-family: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  /* Stop iOS rubber-band / double-tap zoom / long-press callouts during play. */
  overscroll-behavior: none;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#game-wrap {
  position: fixed;
  inset: 0;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

#hint {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(10, 16, 32, 0.6);
  color: #cdd7ee;
  font-size: 13px;
  letter-spacing: 0.2px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  white-space: nowrap;
}

#hint strong {
  color: #ffd166;
  font-weight: 700;
}

/* On touch devices the on-screen buttons are labelled, so the keyboard hint is
   redundant (and would overlap the controls). Hide it for coarse pointers. */
@media (pointer: coarse), (hover: none) {
  #hint {
    display: none;
  }
  #game {
    cursor: none;
  }
}

/* CrazyGames responsive banner — bottom-center, shown only on non-gameplay screens
   (JS toggles display via portal.showBanner/clearBanner). Never over active gameplay. */
#banner-container {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 300px;
  min-height: 50px;
}

/* Loading splash — covers ES-module load + any portal SDK handshake, then fades out. */
#splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 38%, #15294a 0%, #0b1020 70%);
  color: #cdd7ee;
  transition: opacity 0.45s ease;
}
#splash.hidden {
  opacity: 0;
  pointer-events: none;
}
.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.splash-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: #eef7ff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.splash-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(127, 210, 255, 0.25);
  border-top-color: #7fd2ff;
  animation: splash-spin 0.8s linear infinite;
}
.splash-sub {
  font-size: 13px;
  color: #8fb6d6;
  letter-spacing: 0.3px;
}
@keyframes splash-spin {
  to {
    transform: rotate(360deg);
  }
}
