/* 스프린트 러너 — 모바일 풀블리드 UI */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --sky-top: #1a3a4a;
  --sky-mid: #2d6a6a;
  --sky-bot: #e8b86d;
  --ground: #3d2b1f;
  --accent: #f0a030;
  --text: #f5f0e8;
  --text-dim: rgba(245, 240, 232, 0.72);
  --panel: rgba(12, 28, 36, 0.78);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--sky-top);
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 70% 20%, rgba(232, 184, 109, 0.35), transparent 55%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-bot) 100%);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* HUD */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(12px + var(--safe-top)) 18px 8px;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.hud-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-block--right {
  align-items: flex-end;
}

.hud-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
}

.hud-value {
  font-family: "Black Han Sans", sans-serif;
  font-size: 1.65rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* 오버레이 */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 35%, rgba(240, 160, 48, 0.18), transparent 50%),
    rgba(8, 20, 28, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.overlay--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-inner {
  width: min(100%, 340px);
  text-align: center;
  animation: riseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.brand {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}

.title {
  font-family: "Black Han Sans", sans-serif;
  font-size: clamp(2rem, 9vw, 2.75rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 12px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 28px;
}

.result-line {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.result-line strong {
  font-family: "Black Han Sans", sans-serif;
  font-size: 1.55rem;
  color: var(--accent);
  margin-left: 6px;
}

.result-line--sub {
  color: var(--text-dim);
  margin-bottom: 26px;
}

.result-line--sub strong {
  font-size: 1.2rem;
  color: var(--text);
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  min-width: 180px;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 4px;
  background: var(--accent);
  color: #1a140c;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow:
    0 4px 0 #b87218,
    0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #b87218,
    0 4px 10px rgba(0, 0, 0, 0.3);
}

.hint {
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

@media (orientation: landscape) and (max-height: 480px) {
  .title {
    font-size: 1.6rem;
    margin-bottom: 6px;
  }

  .subtitle,
  .hint {
    margin-bottom: 12px;
  }

  .result-line--sub {
    margin-bottom: 14px;
  }

  .btn {
    min-height: 44px;
    padding: 10px 22px;
  }
}
