/* ============================= */
/* Fun Way Page */
/* ============================= */

body {
  background: #111111;
}

.fun-page {
  min-height: 100vh;
  color: #ffffff;
  background:
    radial-gradient(circle at top left, rgba(201, 162, 110, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(255, 199, 107, 0.12), transparent 35%),
    linear-gradient(135deg, #0f0f0f, #1a1714, #2a2119);
  overflow: hidden;
  position: relative;
}

/* ============================= */
/* Navbar */
/* ============================= */

.fun-navbar {
  width: 100%;
  padding: 22px 8%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
}

.fun-logo {
  width: 100px;
  height: auto;
  display: block;
  border-radius: 50%;
}

.fun-nav-links {
  display: flex;
  gap: 30px;
}

.fun-nav-links a {
  color: #ddd3c4;
  font-weight: 700;
  transition: color 0.3s ease;
}

.fun-nav-links a:hover,
.fun-nav-links a.active {
  color: #e6c18a;
}



/* ============================= */
/* Smooth Intro + Photo Shard Blast */
/* ============================= */

.intro-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 8;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  animation: hideIntro 0.6s ease forwards;
  animation-delay: 4.9s;
}

/* Smaller wording while photo is coming */
.coming-text {
  position: absolute;
  top: 24%;
  font-size: 20px;
  font-weight: 700;
  color: #e6c18a;
  letter-spacing: 1px;
  opacity: 0;
  animation: funnyTextFlash 3s ease forwards;
}

.blast-stage {
  width: 420px;
  height: 520px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Smooth photo movement */
.blast-face {
  width: 270px;
  height: auto;
  position: absolute;
  opacity: 0;
  transform: scale(0.04) translateZ(0);
  will-change: transform, opacity;
  filter: drop-shadow(0 25px 55px rgba(0, 0, 0, 0.55));
  animation: smoothFaceCome 4s linear forwards;
}

/* Photo shard container */
.shard-container {
  position: absolute;
  width: 270px;
  height: 340px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(2.7);
  pointer-events: none;
}

/* Small pieces of the actual photo */
.face-shard {
  position: absolute;
  width: var(--w);
  height: var(--h);
  background-image: url("../assets/images/cartoon-face.png");
  background-size: 270px auto;
  background-position: var(--bg-x) var(--bg-y);
  opacity: 0;
  animation: photoShardBlast 1.2s ease-out forwards;
}

/* Final game home appears after blast */
.game-home {
  min-height: calc(100vh - 100px);
  padding: 55px 8% 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 55px;
  opacity: 0;
  transform: translateY(30px);
  animation: showGameHome 1s ease forwards;
  animation-delay: 6.5s;
}

/* Smaller flashing text */
@keyframes funnyTextFlash {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  20% {
    opacity: 1;
    transform: scale(1);
  }

  60% {
    opacity: 1;
    transform: scale(1.04);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

/* Very smooth continuous zoom, no stop-start */
@keyframes smoothFaceCome {
  0% {
    opacity: 0;
    transform: scale(0.04) translateZ(0);
  }

  10% {
    opacity: 1;
  }

  92% {
    opacity: 1;
    transform: scale(2.65) translateZ(0);
  }

  100% {
    opacity: 0;
    transform: scale(2.75) translateZ(0);
  }
}

/* Actual photo pieces blast outward */
@keyframes photoShardBlast {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform:
      translate(var(--move-x), var(--move-y))
      scale(0.75)
      rotate(var(--rotate));
  }
}

@keyframes hideIntro {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes showGameHome {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================= */
/* Final Game Home */
/* ============================= */

.game-home {
  min-height: calc(100vh - 100px);
  padding: 55px 8% 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 55px;
  opacity: 0;
  transform: translateY(30px);
  animation: showGameHome 1s ease forwards;
  animation-delay: 5.1s;
}

/* Left text */
.game-intro {
  max-width: 560px;
}

.fun-small-title {
  color: #c9a26e;
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.game-intro h1 {
  font-size: 58px;
  line-height: 1.08;
  margin-bottom: 22px;
}

.game-intro p {
  color: #e8e1d6;
  font-size: 18px;
  line-height: 1.7;
}

/* Game cards */
.game-menu {
  width: 560px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.game-card {
  background: rgba(24, 22, 20, 0.92);
  border: 1px solid rgba(201, 162, 110, 0.38);
  border-radius: 24px;
  padding: 28px;
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  transition: transform 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
  transform: translateY(-10px) rotate(-1deg);
  border-color: #e6c18a;
  box-shadow: 0 20px 55px rgba(201, 162, 110, 0.20);
}

.game-card span {
  font-size: 34px;
  display: inline-block;
  margin-bottom: 15px;
}

.game-card h2 {
  color: #e6c18a;
  font-size: 24px;
  margin-bottom: 10px;
}

.game-card p {
  color: #ddd3c4;
  font-size: 15px;
  line-height: 1.6;
}

/* Last card centered */
.game-card:last-child {
  grid-column: 1 / 3;
  max-width: 270px;
  justify-self: center;
}

/* ============================= */
/* Animations */
/* ============================= */

/* Funny sentence flash */
@keyframes funnyTextFlash {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }

  20% {
    opacity: 1;
    transform: scale(1);
  }

  45% {
    opacity: 0.45;
    transform: scale(1.04);
  }

  65% {
    opacity: 1;
    transform: scale(1.08);
  }

  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

/* Face comes smoothly from far away */
@keyframes smoothFaceCome {
  0% {
    opacity: 0;
    transform: scale(0.04);
  }

  15% {
    opacity: 1;
    transform: scale(0.18);
  }

  45% {
    opacity: 1;
    transform: scale(0.75);
  }

  75% {
    opacity: 1;
    transform: scale(1.65);
  }

  90% {
    opacity: 1;
    transform: scale(2.35);
  }

  96% {
    opacity: 1;
    transform: scale(2.55);
  }

  100% {
    opacity: 0;
    transform: scale(2.7);
  }
}

/* Small parts blast away */
@keyframes particleBlast {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4);
  }

  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + var(--x)),
        calc(-50% + var(--y))
      )
      scale(1.4)
      rotate(var(--rotate));
  }
}

/* Hide intro animation */
@keyframes hideIntro {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Show final game home */
@keyframes showGameHome {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================= */
/* Mobile Responsive */
/* ============================= */

@media (max-width: 1000px) {
  .game-home {
    flex-direction: column;
    text-align: center;
  }

  .game-intro h1 {
    font-size: 42px;
  }

  .game-menu {
    width: 100%;
    max-width: 560px;
  }
}

@media (max-width: 650px) {
  .fun-navbar {
    flex-direction: column;
    gap: 18px;
  }

  .coming-text {
    top: 25%;
    font-size: 23px;
  }

  .blast-stage {
    width: 260px;
    height: 350px;
  }

  .blast-face {
    width: 230px;
  }

  .game-menu {
    grid-template-columns: 1fr;
  }

  .game-card:last-child {
    grid-column: 1;
    max-width: 100%;
  }
}