* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background: #081108;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-shell {
  position: relative;
  width: min(100vw, 480px);
  height: min(100vh, 860px);
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    #74c7ff 0%,
    #bfeaff 24%,
    #a0d77f 36%,
    #4a8a2c 58%,
    #274d19 100%
  );
  border: 2px solid rgba(0, 255, 140, 0.18);
  box-shadow:
    0 0 22px rgba(0, 255, 140, 0.15),
    inset 0 0 20px rgba(0, 255, 140, 0.06);
}

.sky-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 12%,
      rgba(0, 255, 170, 0.14),
      transparent 22%
    ),
    radial-gradient(
      circle at 20% 24%,
      rgba(255, 255, 255, 0.14),
      transparent 16%
    );
  pointer-events: none;
  z-index: 1;
}

.sky {
  position: absolute;
  inset: 0;
  height: 44%;
  overflow: hidden;
  z-index: 2;
}

.cloud {
  position: absolute;
  width: 110px;
  height: 42px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50px;
  box-shadow:
    25px -10px 0 8px rgba(255, 255, 255, 0.95),
    60px -5px 0 12px rgba(255, 255, 255, 0.95),
    85px 0 0 6px rgba(255, 255, 255, 0.95);
  opacity: 0.9;
}

.c1 {
  top: 60px;
  left: -160px;
  animation: cloudMove 18s linear infinite;
}

.c2 {
  top: 115px;
  left: -200px;
  transform: scale(1.22);
  animation: cloudMove 23s linear infinite;
}

.c3 {
  top: 26px;
  left: -170px;
  transform: scale(0.9);
  animation: cloudMove 20s linear infinite 4s;
}

.mountains {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 49%;
  height: 130px;
  z-index: 2;
  background:
    linear-gradient(
        135deg,
        transparent 25%,
        #64875f 25%,
        #64875f 50%,
        transparent 50%
      )
      0 0/120px 120px,
    linear-gradient(
        225deg,
        transparent 25%,
        #7a9d73 25%,
        #7a9d73 50%,
        transparent 50%
      )
      60px 0/120px 120px;
  opacity: 0.85;
}

.trees {
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: repeat-x;
  z-index: 3;
}

.trees-back {
  bottom: 34%;
  height: 120px;
  background-image:
    radial-gradient(circle at 20px 80px, #2d5b1f 0 28px, transparent 29px),
    radial-gradient(circle at 80px 75px, #2d5b1f 0 25px, transparent 26px),
    linear-gradient(#5a3c20, #5a3c20);
  background-size: 120px 120px;
  background-position:
    0 0,
    0 0,
    18px 88px;
  opacity: 0.78;
}

.trees-front {
  bottom: 22%;
  height: 140px;
  background-image:
    radial-gradient(circle at 25px 75px, #1d4913 0 35px, transparent 36px),
    radial-gradient(circle at 95px 70px, #1d4913 0 30px, transparent 31px),
    linear-gradient(#5b3416, #5b3416);
  background-size: 140px 140px;
  background-position:
    0 0,
    0 0,
    24px 90px;
  opacity: 0.95;
}

.future-lines {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(
      120deg,
      transparent 0%,
      rgba(0, 255, 170, 0.06) 30%,
      transparent 48%
    ),
    linear-gradient(
      60deg,
      transparent 0%,
      rgba(0, 255, 170, 0.05) 40%,
      transparent 58%
    );
  animation: futureShift 7s linear infinite;
}

.hud {
  position: absolute;
  top: 14px;
  left: 10px;
  right: 10px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.card {
  flex: 1;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 255, 170, 0.18);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  backdrop-filter: blur(5px);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.14),
    inset 0 0 8px rgba(0, 255, 170, 0.08);
}

.card span {
  display: block;
  font-size: 12px;
  color: #546054;
}

.card strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  color: #197a4a;
  text-shadow: 0 0 8px rgba(0, 255, 170, 0.15);
}

.game-world {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 10;
}

.road {
  position: absolute;
  left: 50%;
  bottom: -32px;
  width: 92%;
  height: 56%;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, #9a6334 0%, #75461f 38%, #583214 100%);
  border-top-left-radius: 40% 18%;
  border-top-right-radius: 40% 18%;
  box-shadow:
    inset 0 8px 0 rgba(255, 255, 255, 0.08),
    0 -6px 18px rgba(0, 0, 0, 0.12);
}

.road-lines {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 92%;
  height: 56%;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 22px,
    rgba(255, 255, 255, 0.65) 22px 32px,
    transparent 32px 64px
  );
  clip-path: polygon(18% 0%, 82% 0%, 100% 100%, 0% 100%);
  opacity: 0.48;
  animation: roadMove 0.35s linear infinite;
}

.lane-glow {
  position: absolute;
  bottom: 0;
  width: 33.333%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.lane-1 {
  left: 0;
}
.lane-2 {
  left: 33.333%;
}
.lane-3 {
  left: 66.666%;
}

.player {
  position: absolute;
  width: 96px;
  height: 136px;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  transition:
    left 0.12s ease,
    bottom 0.03s linear;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));
}

.player img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  animation: runBounce 0.18s infinite alternate;
}

.player.jump img {
  animation: none;
  transform: translateY(-6px) scale(1.03);
}

.player.collect img {
  animation: collectGlow 0.28s ease;
}

.obstacle {
  position: absolute;
  border-radius: 14px;
  background: linear-gradient(to bottom, #afb6bf, #68707a);
  border: 3px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.24),
    inset 0 0 10px rgba(255, 255, 255, 0.12);
  z-index: 16;
}

.obstacle::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 170, 0.18);
}

.obstacle.small {
  width: 62px;
  height: 58px;
}

.obstacle.big {
  width: 90px;
  height: 102px;
}

.coin {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    #fff9bf 0%,
    #ffd447 48%,
    #d29900 100%
  );
  border: 2px solid #fff2a6;
  box-shadow:
    0 0 12px rgba(255, 215, 0, 0.75),
    0 0 24px rgba(0, 255, 170, 0.15);
  z-index: 18;
  animation: coinSpin 0.6s linear infinite;
}

.coin.collecting {
  animation: coinCollect 0.35s ease forwards;
}

.collect-popup {
  position: absolute;
  color: #fff7b0;
  font-weight: 700;
  font-size: 22px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  z-index: 50;
  pointer-events: none;
  animation: popupRise 0.6s ease forwards;
}

.controls {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  gap: 10px;
}

.controls button,
.box button {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color: white;
  background: linear-gradient(to bottom, #38b66d, #237148);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.2),
    0 0 12px rgba(0, 255, 170, 0.14);
}

.controls button {
  min-width: 76px;
  height: 50px;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(3px);
}

.overlay.show {
  display: flex;
}

.box {
  width: min(88%, 340px);
  background: rgba(255, 255, 255, 0.93);
  color: #234614;
  border: 1px solid rgba(0, 255, 170, 0.15);
  border-radius: 20px;
  padding: 24px 18px;
  text-align: center;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.24),
    inset 0 0 10px rgba(0, 255, 170, 0.06);
}

.box h1,
.box h2 {
  margin-bottom: 10px;
}

.box p {
  margin-top: 8px;
}

@keyframes runBounce {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-8px);
  }
}

@keyframes roadMove {
  from {
    background-position-y: 0;
  }
  to {
    background-position-y: 64px;
  }
}

@keyframes coinSpin {
  0% {
    transform: scale(1) rotateY(0deg);
  }
  50% {
    transform: scale(1.1) rotateY(180deg);
  }
  100% {
    transform: scale(1) rotateY(360deg);
  }
}

@keyframes coinCollect {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.45);
    opacity: 1;
  }
  100% {
    transform: scale(0.2);
    opacity: 0;
  }
}

@keyframes popupRise {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(-45px);
    opacity: 0;
  }
}

@keyframes cloudMove {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(720px);
  }
}

@keyframes futureShift {
  from {
    transform: translateX(-20px);
  }
  to {
    transform: translateX(20px);
  }
}

@keyframes collectGlow {
  0% {
    filter: drop-shadow(0 0 0 rgba(255, 215, 0, 0));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.8));
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(255, 215, 0, 0));
  }
}

@media (max-width: 520px) {
  .game-shell {
    width: 100vw;
    height: 100vh;
    border: none;
  }

  .player {
    width: 96px;
    height: 136px;
  }

  .card strong {
    font-size: 20px;
  }
}

/* Entro Style Hear  */

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(0, 255, 170, 0.14), transparent 25%),
    linear-gradient(
      to bottom,
      #08160c 0%,
      #0d2917 35%,
      #183c20 65%,
      #091108 100%
    );
  animation: introFadeIn 0.8s ease;
}

.intro-screen.hide {
  animation: introFadeOut 0.7s ease forwards;
}

.intro-bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(255, 255, 255, 0.12),
      transparent 18%
    ),
    radial-gradient(circle at 50% 55%, rgba(0, 255, 170, 0.12), transparent 24%);
  pointer-events: none;
}

.intro-particles::before,
.intro-particles::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1.6px),
    radial-gradient(circle, rgba(0, 255, 170, 0.8) 1px, transparent 1.6px);
  background-size:
    90px 90px,
    140px 140px;
  background-position:
    0 0,
    30px 40px;
  opacity: 0.22;
  animation: introParticlesMove 10s linear infinite;
}

.intro-particles::after {
  opacity: 0.14;
  transform: scale(1.2);
  animation-duration: 15s;
}

.intro-content {
  position: relative;
  z-index: 2;
  width: min(92%, 420px);
  padding: 28px 20px;
  text-align: center;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 170, 0.18);
  backdrop-filter: blur(10px);
  box-shadow:
    0 0 40px rgba(0, 255, 170, 0.14),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.intro-character {
  width: 160px;
  max-width: 60%;
  display: block;
  margin: 0 auto 18px;
  filter: drop-shadow(0 0 18px rgba(0, 255, 170, 0.35))
    drop-shadow(0 10px 20px rgba(0, 0, 0, 0.22));
  animation: introFloat 2.2s ease-in-out infinite;
}

.intro-title {
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.05;
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    0 0 12px rgba(0, 255, 170, 0.22),
    0 4px 14px rgba(0, 0, 0, 0.24);
  margin-bottom: 10px;
}

.intro-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.86);
  letter-spacing: 0.12em;
  margin-bottom: 22px;
}

.intro-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.intro-buttons button {
  min-width: 120px;
  height: 48px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  color: white;
  background: linear-gradient(to bottom, #35c97f, #1f7d4b);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.22),
    0 0 16px rgba(0, 255, 170, 0.14);
}

.intro-buttons .skip-btn {
  background: linear-gradient(to bottom, #7f8d86, #56615b);
}

@keyframes introFadeIn {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes introFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes introFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes introParticlesMove {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(70px);
  }
}
