/* 잔디 달리기 — site.css·assets/hall.css 위에 이 페이지에 필요한 것만 (D안: 흰 바탕·검정 글자·회색 1개 + 강조색은 주 버튼·진행 막대) */

/* 시작 전 제목 */
.rn-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1.25; margin-top: 4px; }
.rn-head p { color: var(--body); font-size: 14.5px; line-height: 1.6; margin-top: 8px; }

/* 게임 중 점수 줄 */
.rn-hud { display: flex; align-items: flex-end; gap: 24px; margin-top: 2px; }
.rn-hud small { display: block; color: var(--sub); font-size: 13px; line-height: 1.3; }
.rn-hud b { display: flex; align-items: center; gap: 1px; font-size: 30px; font-weight: 700; letter-spacing: -.8px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rn-hud b i { font-style: normal; font-size: 17px; font-weight: 600; align-self: flex-end; padding-bottom: 4px; }
.rn-hud .sn b { gap: 6px; }
.rn-hud .sn img { display: block; width: 30px; height: auto; }
.rn-hud .best { margin-left: auto; text-align: right; }
.rn-hud .best b { font-size: 20px; color: var(--body); justify-content: flex-end; }
.rn-hud .best b i { font-size: 14px; padding-bottom: 2px; }

/* 달리기 판: 설계 화면 390×340을 폭에 맞춰 늘이고 줄임. 페이지 좌우 여백까지 써서 넓게 */
.rn-stage {
  position: relative; width: calc(100% + 48px); margin: 14px 0 0 -24px; aspect-ratio: 390 / 340;
  background: #f6ead8; overflow: hidden;
  touch-action: none; overscroll-behavior: contain; outline: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
/* 시작 전·끝난 뒤는 판 위에서도 화면 스크롤 */
.rn-stage.idle { touch-action: pan-y; overscroll-behavior: auto; cursor: pointer; }
.rn-stage canvas { display: block; width: 100%; height: 100%; }
.rn-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--text); }

/* 진행 막대 (거실 ─ 골목 ─ 공원) */
.rn-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--sub); }
.rn-bar .lb { flex: none; }
.rn-bar .lb.on { color: var(--text); font-weight: 700; }
.rn-bar .tr { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rn-bar .tr i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; }
.rn-hint { text-align: center; margin-top: 16px; }
.rn-hint b { display: block; font-size: 15.5px; font-weight: 700; }
.rn-hint small { display: block; color: var(--sub); font-size: 12.5px; margin-top: 4px; }

/* 시작 전 조작 안내 */
.rn-how { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; font-size: 15px; font-weight: 600; }
.rn-how span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rn-how img { display: block; width: 46px; height: auto; }
.rn-how .dot { color: var(--sub); }
.rn-sub { text-align: center; color: var(--sub); font-size: 13px; margin-top: 4px; }
.rn-ctl .btn { margin-top: 14px; }

/* 끝 화면 */
.rn-end { margin-top: 6px; }
.rn-end-top { display: flex; gap: 16px; align-items: center; }
.rn-end-top img { width: 116px; height: auto; flex: none; }
.rn-end-top h2 { font-size: 26px; font-weight: 700; letter-spacing: -.8px; line-height: 1.3; }
.rn-end-top p { color: var(--sub); font-size: 14px; margin-top: 2px; }
.rn-end-sc { margin-top: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.rn-end-sc small { display: block; color: var(--sub); font-size: 13px; }
.rn-end-sc > div:first-child > b { display: block; font-size: 36px; font-weight: 700; letter-spacing: -1px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rn-end-sc .r { text-align: right; font-size: 14.5px; color: var(--body); line-height: 1.6; }
.rn-end-sc .r span { display: flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.rn-end-sc .r b { font-weight: 600; color: var(--text); }
.rn-end-sc .r img { display: block; width: 22px; height: auto; }
.rn-end .gr-save { margin-top: 18px; border-top: 0; padding-top: 0; }
.rn-end .rn-links { justify-content: flex-start; gap: 24px; }
.rn-end .rn-links button { color: var(--body); text-decoration: underline; text-underline-offset: 3px; font-size: 14.5px; }
.rn-end .gr-save:not([hidden]) ~ .rn-again { display: none; }
.rn-end > .rn-again { margin-top: 18px; }

@media (max-width: 359px) {
  .wrap.rn { padding-left: 20px; padding-right: 20px; }
  .rn-stage { width: calc(100% + 40px); margin-left: -20px; }
  .rn-hud { gap: 16px; }
  .rn-hud b { font-size: 26px; }
  .rn-hud .best b { font-size: 18px; }
  .rn-how { gap: 6px; font-size: 13.5px; }
  .rn-how img { width: 38px; }
  .rn-end-top img { width: 96px; }
  .rn-end-top h2 { font-size: 22px; }
}
