/* ===== Pixel Font Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: #0b0b1a;
  font-family: 'Press Start 2P', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ===== Game Wrapper ===== */
#game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 100vw;
  max-height: 100vh;
}

/* ===== Title ===== */
#game-title {
  color: #ffda45;
  font-size: 18px;
  text-align: center;
  text-shadow:
    0 0 6px #ff6bef,
    0 0 20px #ff6bef;
  letter-spacing: 2px;
  animation: title-glow 2s ease-in-out infinite alternate;
}

@keyframes title-glow {
  from {
    text-shadow:
      0 0 6px #ff6bef,
      0 0 20px #ff6bef;
  }
  to {
    text-shadow:
      0 0 10px #45fffc,
      0 0 30px #45fffc;
  }
}

/* ===== Canvas ===== */
#game-canvas {
  border: 3px solid #ff6bef;
  border-radius: 6px;
  box-shadow:
    0 0 12px #ff6bef88,
    0 0 40px #ff6bef33,
    inset 0 0 30px #0005;
  background: #0d0d24;
  display: block;
  image-rendering: pixelated;
  max-width: 100vw;
  max-height: 100vh;
}

/* ===== Hint Text ===== */
#game-hint {
  color: #45fffc;
  font-size: 9px;
  text-align: center;
  opacity: 0.7;
  letter-spacing: 1px;
  animation: hint-blink 3s ease-in-out infinite;
}

@keyframes hint-blink {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.3; }
}

/* Hide title and hint on mobile to maximize canvas space */
@media (pointer: coarse) {
  #game-title {
    display: none;
  }
  #game-hint {
    display: none;
  }
  #game-wrapper {
    gap: 0;
  }
}

/* Also hide on very small screens regardless of pointer */
@media (max-height: 700px) {
  #game-title {
    display: none;
  }
  #game-hint {
    display: none;
  }
  #game-wrapper {
    gap: 0;
  }
}

/* ===== Screen-shake class (applied via JS) ===== */
#game-canvas.shake {
  animation: screen-shake 0.3s ease-out;
}

@keyframes screen-shake {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-4px, 3px); }
  40%  { transform: translate(3px, -4px); }
  60%  { transform: translate(-3px, 2px); }
  80%  { transform: translate(2px, -2px); }
  100% { transform: translate(0, 0); }
}
