@charset "UTF-8";

body {
  margin: 0;
  overflow: hidden;
  background: #050510;
  color: white;
  user-select: none;
  font-family: "Inter", "Roboto", sans-serif;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 18% 70%,
      rgba(0, 255, 255, 0.12),
      transparent 26%
    ),
    radial-gradient(
      circle at 72% 40%,
      rgba(255, 90, 0, 0.16),
      transparent 28%
    ),
    radial-gradient(circle at 50% 100%, #2d112d 0%, #090912 74%);
}

.bg-layer {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent 30%);
  background-size:
    24px 24px,
    100% 100%;
  opacity: 0.45;
}

.ambient-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
}

.ambient-glow.cyan {
  left: -8vw;
  bottom: 8vh;
  width: 24vw;
  height: 24vw;
  background: rgba(0, 255, 255, 0.18);
}

.ambient-glow.orange {
  right: 8vw;
  top: 8vh;
  width: 28vw;
  height: 28vw;
  background: rgba(255, 85, 0, 0.12);
}

/* Timer UI */
.timer-ui {
  position: absolute;
  left: 2vw;
  top: 2vh;
  width: 200px;
  padding: 12px 20px;
  background: rgba(10, 15, 30, 0.6);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
  letter-spacing: 2px;
}

.spawn-pad {
  position: absolute;
  left: 0;
  bottom: 17vh;
  width: 18vw;
  min-width: 180px;
  height: 3.2vh;
  min-height: 22px;
  background: linear-gradient(to right, #18d7ff, #18a8ff);
  box-shadow: 0 0 28px rgba(24, 215, 255, 0.45);
}

.stone-bridge {
  position: absolute;
  left: 43vw;
  top: 73vh;
  width: 21vw;
  min-width: 220px;
  height: 2.8vh;
  min-height: 20px;
  background: #9b6666;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

.main-support {
  position: absolute;
  left: 62.8vw;
  top: 24vh;
  width: 15px;
  height: 60vh;
  background: #9b6666;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}
/* Red pin on main-support */
.main-support::before {
  content: "";
  position: absolute;
  left: 0;
  top: -30px;
  width: 100%;
  height: 30px;
  background: #ff180d;
  box-shadow: 0 0 12px rgba(255, 24, 13, 0.35);
}

.right-frame {
  position: absolute;
  left: 77vw;
  top: 24vh;
  width: 15px;
  height: 60vh;
  background: #6d6d6d;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
}
/* Red pin on right-frame */
.right-frame::before {
  content: "";
  position: absolute;
  left: 0;
  top: -30px;
  width: 100%;
  height: 30px;
  background: #ff180d;
  box-shadow: 0 0 12px rgba(255, 24, 13, 0.35);
}

.top-beam {
  position: absolute;
  left: calc(62.8vw + 15px);
  top: 24vh;
  width: calc(14.2vw - 15px); /* between main-support and right-frame */
  height: 1.9vh;
  min-height: 14px;
  background: linear-gradient(to right, #9b6666 0 70%, #6d6d6d 70% 100%);
}

.mid-ledge {
  position: absolute;
  left: 62.8vw;
  top: 58vh;
  width: calc(14.2vw + 15px);
  height: 1.9vh;
  min-height: 14px;
  background: linear-gradient(to right, #9b6666 0 68%, #6d6d6d 68% 100%);
}

/* Red pin on mid-ledge protruding from left edge */
.mid-ledge::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(to right, #ff180d 0 78%, #cb2c2c 78% 100%);
  box-shadow: 0 0 10px rgba(255, 24, 13, 0.3);
  z-index: 20; /* 사다리보다 앞에 오도록 */
}

.ladder {
  position: absolute;
  right: 37.2vw; /* Flush against main-support at 62.8vw */
  top: 24vh;
  width: 4.2vw;
  min-width: 44px;
  height: 49vh; /* extends down to stone-bridge 73vh */
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 4.3vh,
      rgba(0, 0, 0, 0.45) 4.3vh,
      rgba(0, 0, 0, 0.45) 4.55vh
    ),
    rgba(220, 220, 220, 0.88);
  box-shadow:
    inset 1px 0 0 rgba(0, 0, 0, 0.42),
    inset -1px 0 0 rgba(0, 0, 0, 0.42);
  z-index: 5;
}

.lava-fall,
.ice-water {
  position: absolute;
  left: calc(62.8vw + 15px);
  width: calc(14.2vw - 15px);
}

.lava-fall {
  top: 25.9vh; /* just under top-beam */
  height: 32.1vh; /* until mid-ledge 58vh */
  background: linear-gradient(to bottom, #ff8768, #ff6248);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.ice-water {
  top: 59.9vh; /* just under mid-ledge */
  height: 24vh; /* until 83.9vh */
  background: linear-gradient(to bottom, #4f88e8, #3c78de);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.bottom-bar {
  position: absolute;
  left: 62.8vw; /* aligns with main-support */
  top: 83.9vh;
  width: calc(14.2vw + 15px); /* aligns with mid-ledge and goal-ledge */
  height: 2.8vh;
  background: #5a5a5a;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.25);
  border-top: 2px solid #3c78de;
}

/* Goal ledge at aligned bottom with ice-water! 
   "ice-water 요소의 bottom위치와 동일한 위치에 있도록 하였으면 좋겠어 (coin, sword가 떨어질 때 바쳐줄 수 있는 레이아웃 형태)"
 */
.goal-ledge {
  position: absolute;
  right: 0;
  top: 83.9vh; /* same height as bottom-bar / bottom of ice-water */
  width: calc(23vw - 15px);
  height: 1.9vh;
  min-height: 14px;
  background: #6d6d6d;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
}

.goal-location {
  position: absolute;
  left: 100%;
  top: 0;
  width: calc(23vw - 15px);
  height: 100%;
  background: #6d6d6d;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
}

.treasure-pile {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 100%; /* goal-location의 바로 윗상단에 안착 */
  width: 100px;
  height: 60px;
  z-index: 20;
}

.coins-container {
  position: absolute;
  bottom: 0px;
  left: 10px;
  width: 80px;
  height: 38px; /* 절반 잘린 형태 구현 */
  overflow: hidden;
  z-index: 21; /* higher than sword */
}

.coins {
  position: absolute;
  left: 2px;
  bottom: -38px; /* hide bottom half */
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    #ffff74 0,
    #f8ff00 58%,
    #c7c800 100%
  );
  box-shadow: 0 0 24px rgba(248, 255, 0, 0.48);
}

.sword {
  position: absolute;
  left: 48px; /* inside the coin */
  bottom: 10px; /* half buried in coins */
  width: 8px;
  height: 86px;
  background: linear-gradient(to bottom, #f2f2f2, #a9a9a9);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.18);
  z-index: 19; /* behind coin container */
  transform: rotate(15deg);
  transform-origin: bottom center;
}

.sword-hilt {
  position: absolute;
  left: -11px;
  top: 18px;
  width: 30px;
  height: 8px;
  background: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.gem {
  position: absolute;
  left: 10px;
  top: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff87;
  box-shadow: 0 0 12px rgba(0, 255, 135, 0.4);
}

/* Character fixing position to be directly on the spawn pad. */
.character {
  position: absolute;
  left: 8vw; /* centered on spawn-pad */
  bottom: 20.2vh;
  width: 42px;
  height: 80px;
  background: #222;
  border: 2px solid #00ffff;
  border-radius: 20px 20px 10px 10px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 30;
}

.character-head {
  position: relative;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border: 2px solid #00ffff;
  border-radius: 50%;
  background: #111;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.character-eye {
  position: absolute;
  top: 10px;
  right: 5px;
  width: 8px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 10px #fff,
    0 0 18px #00ffff;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle,
    transparent 55%,
    rgba(0, 0, 0, 0.82) 100%
  );
  pointer-events: none;
  z-index: 100;
}

@media (max-width: 960px) {
  .timer-ui {
    top: 1vh;
    left: 1vw;
    padding: 8px 12px;
    font-size: 18px;
  }

  .spawn-pad {
    width: 28vw;
    bottom: 20vh;
  }

  .character {
    left: 14vw;
    bottom: 23.2vh; /* adjusted for spawn pad */
  }

  .stone-bridge {
    left: 39vw;
    top: 73vh;
    width: 28vw;
  }

  .ladder {
    left: auto;
    right: 34vw;
    height: 49vh;
  }

  .main-support {
    left: 66vw;
    height: 62vh;
  }

  .right-frame {
    left: 83vw;
    height: 62vh;
  }

  .top-beam {
    left: calc(66vw + 15px);
    width: calc(17vw - 15px);
  }

  .mid-ledge {
    left: 66vw;
    width: calc(17vw + 15px);
  }

  .lava-fall,
  .ice-water {
    left: calc(66vw + 15px);
    width: calc(17vw - 15px);
  }

  .bottom-bar {
    left: 66vw;
    width: calc(17vw + 15px);
  }

  .goal-location,
  .goal-ledge {
    width: calc(17vw - 15px);
  }

  .goal-ledge {
    top: 83.9vh;
  }
}
