html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ff4d1f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.df {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 440px;
}

.df__hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.df__hud > p {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.df__ico {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #17141a;
}

.df__label {
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.4;
  color: #17141a;
}

.df__num {
  font-weight: 800;
  font-size: clamp(13px, 3.6vw, 17px);
  line-height: 1;
  color: #17141a;
  font-variant-numeric: tabular-nums;
}

.df__lives {
  display: flex;
  align-items: center;
  gap: 4px;
}

.df__life {
  width: 13px;
  height: 13px;
  color: #17141a;
  opacity: 0.18;
  transition: opacity 220ms ease-out;
}

.df__life svg {
  display: block;
  width: 100%;
  height: 100%;
}

.df__life.is-on {
  opacity: 1;
}

.df__field {
  position: relative;
  overflow: hidden;
  height: clamp(96px, 56vh, 188px);
  border: 2px solid rgba(23, 20, 26, 0.3);
  border-radius: 16px;
  background: rgba(23, 20, 26, 0.07);
  touch-action: none;
  cursor: pointer;
}

.df__field:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.df__field::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.3);
}

.df__player {
  position: absolute;
  left: 0;
  bottom: 9px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: rgba(255, 247, 230, 0.16);
  border-radius: 50%;
  will-change: transform;
}

.df__rocket {
  width: 26px;
  height: 26px;
  color: #fff7e6;
  transform: rotate(-45deg);
}

.df__rock {
  position: absolute;
  top: -34px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #17141a;
  will-change: transform;
  animation-name: dfFall;
  animation-duration: var(--t, 1200ms);
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes dfFall {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(340px);
  }
}
.df__player.is-hit {
  animation-name: dfHit;
  animation-duration: 160ms;
  animation-iteration-count: 4;
  animation-timing-function: ease-out;
}

@keyframes dfHit {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.12;
  }
}
.df__hint {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffffff;
  color: #17141a;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.4;
  white-space: nowrap;
}

.df__hint[hidden] {
  display: none;
}

.df__over {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(23, 20, 26, 0.6);
}

.df__over[hidden] {
  display: none;
}

.df__overPanel {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 16px;
  background: #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.df__overTitle {
  margin: 0;
  font-weight: 800;
  font-size: clamp(14px, 4vw, 18px);
  line-height: 1.2;
  color: #17141a;
}

.df__overScore {
  margin: 0;
  font-weight: 800;
  font-size: clamp(15px, 4.4vw, 20px);
  line-height: 1.2;
  color: #c93000;
}

.df__restart {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 999px;
  padding: 4px 12px;
  background: #0a4fe8;
  color: #fff7e6;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 12px);
  line-height: 1.6;
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.df__restart .df__ico {
  color: #fff7e6;
}

.df__restart:hover {
  transform: translateY(-2px) scale(1.04);
}

.df__restart:active {
  transform: translateY(0) scale(0.97);
}

.df__restart:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.df.is-demo .df__rock--demo {
  left: var(--x0, 20%);
  animation-name: dfFallDemo;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-delay: var(--d0, 0ms);
  animation-fill-mode: both;
}

@keyframes dfFallDemo {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(320px);
  }
}
.df.is-demo .df__player {
  animation-name: dfSway;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes dfSway {
  0% {
    transform: translateX(var(--cx, 150px));
  }
  24% {
    transform: translateX(calc(var(--cx, 150px) - 92px));
  }
  52% {
    transform: translateX(calc(var(--cx, 150px) + 12px));
  }
  78% {
    transform: translateX(calc(var(--cx, 150px) + 86px));
  }
  100% {
    transform: translateX(var(--cx, 150px));
  }
}
@media (max-width: 340px) {
  .df {
    gap: 4px;
  }
  .df__field {
    height: clamp(88px, 48vh, 140px);
  }
  .df__player {
    width: 30px;
    height: 30px;
  }
  .df__rocket {
    width: 22px;
    height: 22px;
  }
  .df__rock {
    width: 20px;
    height: 20px;
  }
  .df__overPanel {
    padding: 8px 12px;
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .df.is-demo .df__rock--demo {
    animation: none !important;
    top: var(--y0, 40%) !important;
  }
  .df.is-demo .df__player {
    animation: none !important;
  }
  .df__rock {
    animation-timing-function: steps(8, end) !important;
  }
  .df__player.is-hit {
    animation: none !important;
    opacity: 0.35 !important;
  }
  .df__life, .df__restart {
    transition: none !important;
  }
}
