@font-face {
  font-family: 'Pretendard';
  src: url('../assets/fonts/PretendardVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: 'Pretendard', 'Malgun Gothic', sans-serif;
  --font-display: var(--font-sans);
  --font-en: var(--font-sans);

  --ink: #2B1B12;
  --cream: #FFF8E7;
  --wood-light: #D98A42;
  --wood-mid: #B86728;
  --wood-dark: #7A3E12;
  --gold-light: #FFE56B;
  --gold-mid: #F5B727;
  --gold-dark: #B77409;
  --sky-top: #5CC8FF;
  --sky-bot: #C5F0FF;
  --green-light: #6CE063;
  --green-mid: #33B63D;
  --green-dark: #1E7D28;
  --orange-light: #FF9C52;
  --orange-mid: #FF6B24;
  --orange-dark: #BA3B08;
  --blue-light: #5EC2FF;
  --blue-mid: #2889F0;
  --blue-dark: #1655A8;
  --red-mid: #F25050;
  --red-dark: #A82323;
  --purple-mid: #965CF6;
  --purple-dark: #5B27BA;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #23395B 0%, #101A2B 100%);
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.5;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
  pointer-events: none;
}

.hidden { display: none !important; }

/* Centered 9:16 Letterboxed Viewport */
.game-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-shell {
  position: relative;
  width: 390px;
  height: 844px;
  flex: none;
  transform-origin: center center;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 100%);
  box-shadow: 0 0 0 4px #1E293B, 0 24px 60px rgba(0, 0, 0, 0.55);
  border-radius: 20px;
}

@media (max-width: 500px) {
  .game-shell { border-radius: 0; box-shadow: none; }
}

.scene-root {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.scene-enter {
  animation: sceneFadeZoom 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sceneFadeZoom {
  from { opacity: 0.2; transform: scale(1.03); }
  to   { opacity: 1; transform: scale(1); }
}

/* Particle Overlay inside 9:16 Shell */
#fx-canvas {
  position: absolute;
  inset: 0;
  width: 390px;
  height: 844px;
  pointer-events: none;
  z-index: 80;
}
