/* 모아이 마구마구 드라이브 — 게임 스타일 */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  padding:
    max(8px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    0
    max(10px, env(safe-area-inset-left));
}

#hud {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 8px;
}
#mascot { width: 44px; height: 44px; flex: 0 0 auto; }
.prog-wrap { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.prog-wrap .pixel-label { font-size: 10px; }
.prog-bar { height: 12px; background: var(--card); border: 1.5px solid var(--b); border-radius: var(--r-pill); overflow: hidden; }
#prog-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--c-cyan), var(--c-primary)); transition: width .1s linear; }
#newgame { padding: 8px 12px; font-size: 13px; }

#stage { position: relative; flex: 1; min-height: 0; }
#cv { display: block; width: 100%; height: 100%; touch-action: none; }

/* 조작 버튼 */
.ctrl {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: rgba(255, 255, 255, .8);
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  box-shadow: 0 6px 0 rgba(46, 37, 72, .18);
  touch-action: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctrl:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(46, 37, 72, .18); }
#brake { left: max(16px, env(safe-area-inset-left)); }
#gas { right: max(16px, env(safe-area-inset-right)); background: var(--c-primary); color: #fff; }
#brake::before {
  content: '';
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 19px solid currentColor;
}
#gas::before {
  content: '';
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 19px solid currentColor;
}

/* 오버레이 */
.overlay { position: fixed; inset: 0; background: rgba(46, 37, 72, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.go-card { text-align: center; max-width: 320px; width: 100%; animation: fadeInUp .35s ease; }
#over-mascot { width: 84px; height: 84px; margin: 0 auto 10px; }
#over-mascot.sad { animation: shakeX .5s ease; }
#over-mascot.happy { animation: pop .5s ease; }
.go-title { font-family: var(--f-display); font-size: 24px; color: var(--ink); margin-bottom: 6px; }
#restart { margin-top: 16px; width: 100%; }
[hidden] { display: none !important; }
