@font-face {
  font-family: "VHSGothic";
  src: url("fonts/VHSGothic.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  font-family: "VHSGothic", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: #fff;
}

/* Pixel-art background crossfade with dark overlay */
#bg,
#bgOverlay {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
#bg {
  z-index: -2;
}
#bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  transition: opacity 600ms ease;
  opacity: 1;
}
#bg img.hidden {
  opacity: 0;
  pointer-events: none;
}
#bgOverlay {
  z-index: -1;
  background: rgba(37, 38, 38, 0.65);
  pointer-events: none;
}

/* Animations + fun */
.fade-in-up {
  animation: fadeInUp 0.45s ease-out;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.answer-btn {
  transition: transform 120ms ease, opacity 120ms ease;
}
.answer-btn:active {
  transform: scale(0.98);
}
.sparkle {
  position: absolute;
  font-size: 14px;
  pointer-events: none;
  animation: sparkleUp 600ms ease forwards;
}
@keyframes sparkleUp {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.9);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-24px) scale(1.1);
  }
}

/* Start screen float animation */
.floaty {
  animation: floaty 3s ease-in-out infinite;
}
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Mobile tweaks (keep everything visible without scroll) */
@media (max-width: 640px) {
  #logo {
    max-height: 40px;
    margin-bottom: 0.5rem;
  }
  #questionText {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }
  .answer-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
  }
  #questionPanel {
    padding: 0.75rem !important;
  }
  header {
    padding: 0.5rem !important;
  }
  footer {
    display: none;
  }
  #startCenter {
    max-width: 60vw;
  }
  #startBtnImg {
    max-width: 60vw;
  }
}
@media (max-height: 700px) and (max-width: 640px) {
  #questionText {
    font-size: 0.8rem;
  }
  .answer-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.4rem;
  }
}

/* petites anims utiles */
.floaty {
  animation: floatyTight 3s ease-in-out infinite;
}
@keyframes floatyTight {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.fade-in-up {
  animation: fiu 0.28s ease-out;
}
@keyframes fiu {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* fond crossfade */
#bg,
#bgOverlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
#bgOverlay {
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.2),
    rgba(0, 0, 0, 0.6)
  );
}
#bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease;
}
#bg img.hidden {
  opacity: 0;
}
#bg img:not(.hidden) {
  opacity: 1;
}

.pixel-round {
  image-rendering: pixelated;
  border-radius: 9999px;
  border: 4px solid #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12) inset;
}
.btn-primary {
  background: #ff4684;
  color: #fff;
}
.btn-primary:hover {
  opacity: 0.9;
}
