@font-face {
  font-family: 'jf-openhuninn';
  src: url('../assets/jf-openhuninn-2.1.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--color-bg-outside-stage);
  /* no text/long-press selection anywhere in the game, and no double-tap/pinch zoom gestures
     (touch-action: manipulation drops the browser's double-tap-to-zoom while still allowing
     normal single-finger panning) - see stage.js's preventZoomGestures() for the JS-side belt
     and braces (gesturestart/wheel-ctrl) that CSS alone can't cover on every browser */
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* buttons/inputs don't inherit the body font by default in most browsers - applying it
   everywhere explicitly (rather than relying on inheritance) covers every game UI element */
html, body, button, input, textarea, select {
  font-family: 'jf-openhuninn', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

/* background-image shows through at the edges whenever #level-scene's .screen-shake nudges its
   content a few px off the stage boundary (monster touch / wrong answer) - was a flat blue
   (--color-bg-stage), now the shared far background art instead, per user request */
#game-stage {
  position: fixed;
  top: 50%;
  left: 50%;
  width: var(--stage-width);
  height: var(--stage-height);
  background: var(--color-bg-stage) url('../assets/images/backgrounds/shared/far.png') center / cover no-repeat;
  transform-origin: center center;
  transform: translate(-50%, -50%);
  touch-action: none;
  overflow: hidden;
}

#rotate-hint {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-rotate-hint-bg);
  color: var(--color-rotate-hint-text);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  z-index: 100;
}

#rotate-hint.visible {
  display: flex;
}

/* fade-to-black overlay driven by scene-manager.js's showScene() - duration must match
   TRANSITION_FADE_MS there */
#scene-transition {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
  z-index: 200;
}

#scene-transition.active {
  opacity: 1;
}
