/*========================
  Root Variables
========================*/
:root {
  --bg: #e9f2ff;           /* Background gradient start */
  --ground: #7aa2d6;       /* Ground color */
  --card: #ffffff;          /* Card / container background */
  --muted: #5b6b7a;        /* Muted text color */
}

/*========================
  Global Styles
========================*/
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  background: linear-gradient(180deg, var(--bg), #cfe7ff);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

/*========================
  Wrapper Container
========================*/
.wrap {
  width: 100%;
  max-width: 900px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(10, 30, 60, 0.12);
  overflow: hidden;
}

/*========================
  Header
========================*/
header {
  padding: 12px 18px;
  border-bottom: 1px solid #eef5ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h2 {
  font-size: 16px;
  color: #0b2a4a;
}

/*========================
  HUD / Stats
========================*/
.hud {
  display: flex;
  gap: 12px;
  align-items: center;
}

.stat {
  background: #f2f8ff;
  padding: 6px 10px;
  border-radius: 8px;
  color: #0b2a4a;
  font-weight: 600;
  min-width: 80px;
  text-align: center;
}

/*========================
  Game Area
========================*/
.game-area {
  position: relative;
  height: 420px;
  background: linear-gradient(180deg, #bfe0ff 0%, #9fcfff 60%);
  overflow: hidden;
}

/* Sky layer (background elements like sun, clouds) */
.sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Ground */
.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(0deg, var(--ground), #00000098);
  display: flex;
  align-items: center;
  padding-left: 18px;
  z-index: 2;
  
  /* Extra styling */
  border-top: 10px solid rgba(255,255,255,0.3); /* upper shine line */
  box-shadow: 0 -4px 12px rgba(0,0,0,0.4) inset; /* inner shadow */
  overflow: hidden;
}

/* Road stripes effect */
.ground::before {
  content: "";
  position: absolute;
  top: -5%;
  left: 0;
  width: 200%;
  height: 10px;
  background: repeating-linear-gradient(
    to right,
    rgb(255,255,255) 0 40px,
    transparent 40px 80px
  );
  animation: moveRoad 0.4s linear infinite;
  opacity: 0.8;
}

@keyframes moveRoad {
  from { transform: translateX(0); }
  to   { transform: translateX(-80px); }
}
/* Track (optional reference line) */
.track {
  position: relative;
  width: 100%;
  height: 1px;
}

/*========================
  Player / Character
========================*/
.player {
  position: absolute;
  left: 72px;
  bottom: 80px;
  width: 64px;
  height: 64px;
  transform-origin: center bottom;
  transition: transform 0.08s linear;
  z-index: 3;
}

.player svg {
  width: 100%;
  height: 100%;
}

/*========================
  Obstacles
========================*/
.obstacles {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;         
  bottom: -35px;    /* ← bas thoda neeche */
  pointer-events: none;
  z-index: 3;
}

.obstacle {
  position: absolute;
  bottom: 90px;
  width: 84px;
  height: 60px;
  will-change: transform; /* Hint for smoother animation */
}

.obstacle.small {
  width: 60px;
  height: 60px;
  bottom: 90px;
}

.obstacle svg,
.obstacle img {
  width: 100%;
  height: 100%;
}

/*========================
  Score Overlay
========================*/
/* .overlay {
  position: absolute;
  right: 16px;
  top: 12px;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  color: #05223a;
}
 */
/* Centered Messages */
.center-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.center-msg .text {
  background: rgba(235,0,0,0.256);
  padding: 10px 14px;
  border-radius: 10px;
  color: #05223a;
  font-weight: 700;
  pointer-events: auto;
}

/*========================
  Footer & Buttons
========================*/
footer {
  padding: 10px 18px;
  border-top: 1px solid #eef5ff;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

button {
  background: #0b66c2;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

button.alt {
  background: #f0f6ff;
  color: #0b66c2;
  border: 1px solid #cfe0ff;
}

/*========================
  Clouds Animation
========================*/
.cloud {
  position: absolute;
  width: 120px;
  height: 60px;
  animation: moveCloud 10s linear infinite;
  z-index: 1;
}

#cloud1 {
  top: 50px;
  left: -350px;
}

#cloud2 {
  top: 120px;
  left: -100px;
  animation-delay: 0s;
}
#cloud3 {
  top: -10px;
  left: -200px;
}
@keyframes moveCloud {
  100% {
    transform: translateX(0);
  }
  0% {
    transform: translateX(200vw);
  }
}

/* Sun */
#sun {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(60%);
  width: 80px;
  height: 80px;
  z-index: 1;
}

/*========================
  Responsive
========================*/
@media (max-width: 520px) {
  .game-area {
    height: 360px;
  }

  .player {
    left: 48px;
    width: 56px;
    height: 56px;
  }

  .obstacle {
    width: 64px;
    height: 64px;
  }
}
/*========================
  mountain
========================*/
.mountain {
  position: relative;
  bottom: -150px;
  width: 200%; /* double width for seamless scroll */
  height: 120px;
  background: linear-gradient(to top, #2f6aa0, #ffffff 40%, #7aa2d6 100%); /* top white for snow effect */
  clip-path: polygon(
    0% 100%, 10% 70%, 20% 85%, 30% 60%, 40% 80%, 50% 55%, 
    60% 75%, 70% 65%, 80% 80%, 90% 70%, 100% 100%, 
    100% 100%, 0% 100%
  ); 
  animation: slideMountain 30s linear infinite, fadeMountain 30s ease-in-out infinite;
  filter: blur(20px);       /* mountain blur */
  opacity: 0.95;          
}

@keyframes slideMountain {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%); /* exact half of width for seamless loop */
  }
}

@keyframes fadeMountain {
  0%, 100% {
    opacity: 0;   /* fade out */
  }
  25%, 75% {
    opacity: 0.95;  /* fade in */
  }
  50% {
    opacity: 1;   /* fully visible */
  }
}
/*========================
  MONXtag
========================*/
/* .MONXtag{
  color: white;
} */