/* ============================================================================
   shorts.css — 러너온 쇼츠(/shorts) 세로 전체화면 피드 + 내 기록 「쇼츠로 공유」 창
   색은 --ro-* 토큰(다크 대응). 지도 위 글자는 어두운 막(scrim) 위라 흰 글자를 쓴다(테마 무관 영역).
   ⚠ 클래스 접두사는 sh- / ro-shs- (광고 차단기가 숨기는 ad 접두사 금지)
   ⚠ 슬라이드는 section 이 아니라 div (site.css 전역 section{padding} 회피)
   ========================================================================== */
.sh { position: fixed; inset: 0; z-index: 1000; background: #05080d; color: #fff; overflow: hidden; font-feature-settings: "tnum"; }
.sh-top { position: absolute; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0)); pointer-events: none; }
.sh-top > * { pointer-events: auto; }
.sh-top__back { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.sh-top__t { font-size: 16px; font-weight: 900; letter-spacing: -.2px; margin: 0; }
.sh-top__s { font-size: 11.5px; opacity: .75; }
.sh-top__sp { flex: 1; }
.sh-top__link { color: #fff; font-size: 12.5px; font-weight: 800; text-decoration: none; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.14); }

.sh-feed { position: absolute; inset: 0; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.sh-feed::-webkit-scrollbar { display: none; }
.sh-slide { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; padding: 0; margin: 0; }

/* 지도 무대 — CSS 원근으로 살짝 눕혀 입체감(타일 추가 비용 없음) */
.sh-stage { position: absolute; inset: 0; perspective: 1100px; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #13233d 0%, #05080d 70%); }
.sh-map { position: absolute; left: -12%; right: -12%; top: 2%; bottom: -14%; transform: rotateX(32deg); transform-origin: 50% 70%; transition: transform 1.2s ease; }
.sh-slide.is-done .sh-map { transform: rotateX(18deg); }
.sh-map .leaflet-container, .sh-map.leaflet-container { background: transparent; }
.sh-map .leaflet-control-attribution { font-size: 9px; background: rgba(0,0,0,.4); color: rgba(255,255,255,.75); }
.sh-map .leaflet-control-attribution a { color: rgba(255,255,255,.85); }
.sh-scrim { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 52%, rgba(0,0,0,.78) 100%); z-index: 5; }
.sh-ph { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; }
.sh-ph .ro-skeleton { width: 60%; height: 40%; border-radius: 24px; opacity: .25; }

/* 상단 HUD — 진행 중 거리 · 페이스 */
.sh-hud { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 62px); left: 14px; right: 74px; z-index: 10; display: flex; gap: 8px; flex-wrap: wrap; }
.sh-chip { background: rgba(8,12,20,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 8px 11px; min-width: 78px; }
.sh-chip b { display: block; font-size: 19px; font-weight: 900; line-height: 1.1; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.sh-chip span { font-size: 10.5px; font-weight: 700; opacity: .78; }
.sh-chip--live b { color: #7dffb6; }

/* 하단 정보 */
.sh-info { position: absolute; left: 14px; right: 78px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); z-index: 10; }
.sh-who { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.sh-av { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--ro-primary-500, #4E8FFF); display: grid; place-items: center; font-weight: 900; font-size: 14px; flex-shrink: 0; border: 2px solid rgba(255,255,255,.7); }
.sh-av img { width: 100%; height: 100%; object-fit: cover; }
.sh-nick { font-weight: 900; font-size: 14px; }
.sh-date { font-size: 11.5px; opacity: .75; }
.sh-why { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(78,143,255,.35); margin-bottom: 6px; }
.sh-title { font-size: 17px; font-weight: 900; margin: 0 0 4px; line-height: 1.3; text-shadow: 0 1px 3px rgba(0,0,0,.5); word-break: keep-all; }
.sh-cap { font-size: 13.5px; line-height: 1.45; opacity: .92; margin: 0 0 8px; white-space: pre-line; word-break: break-word; max-height: 4.4em; overflow: hidden; }
.sh-stats { display: flex; gap: 12px; font-size: 12.5px; font-weight: 800; opacity: .92; flex-wrap: wrap; }

/* km 스플릿 막대 */
.sh-splits { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin-top: 10px; }
.sh-splits i { flex: 1; min-width: 3px; max-width: 14px; border-radius: 3px 3px 0 0; background: rgba(255,255,255,.35); transition: background .2s, transform .2s; }
.sh-splits i.is-best { background: #34d399; }
.sh-splits i.is-on { background: #fff; transform: scaleY(1.08); }

/* 오른쪽 버튼 열 */
.sh-side { position: absolute; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); z-index: 12; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.sh-btn { border: 0; background: none; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 800; padding: 0; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.sh-btn__ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(8,12,20,.5); border: 1px solid rgba(255,255,255,.16); }
.sh-btn svg { width: 24px; height: 24px; }
.sh-btn.is-on .sh-btn__ic { background: #ff3b6b; border-color: #ff3b6b; }
.sh-btn:focus-visible .sh-btn__ic { outline: 2px solid #fff; outline-offset: 2px; }
.sh-replay { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 62px); right: 12px; z-index: 12; }

.sh-end { position: relative; height: 100dvh; scroll-snap-align: start; display: grid; place-items: center; padding: 24px; }
.sh-end .ro-empty-state { background: rgba(255,255,255,.06); border-radius: 20px; padding: 28px 22px; text-align: center; color: #fff; max-width: 360px; }
.sh-end h2 { font-size: 18px; margin: 0 0 8px; }
.sh-end p { font-size: 13.5px; opacity: .85; margin: 0 0 16px; line-height: 1.5; }
.sh-cta { display: inline-block; padding: 11px 18px; border-radius: 999px; background: var(--ro-primary-500, #4E8FFF); color: #fff; font-weight: 900; text-decoration: none; font-size: 14px; }

/* 댓글 시트 — 테마 토큰(밝은/다크) */
.sh-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; max-height: 72vh; display: flex; flex-direction: column;
  background: var(--ro-surface, #fff); color: var(--ro-text, #0f172a); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.35);
  transform: translateY(105%); transition: transform .25s ease; padding-bottom: env(safe-area-inset-bottom, 0px); }
.sh-sheet.is-open { transform: none; }
.sh-sheet__bar { display: flex; align-items: center; padding: 14px 16px 10px; border-bottom: 1px solid var(--ro-border, #e5e9f0); }
.sh-sheet__t { font-weight: 900; font-size: 15px; flex: 1; }
.sh-sheet__x { border: 0; background: var(--ro-bg-soft, #f1f5f9); color: var(--ro-text, #0f172a); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; }
.sh-sheet__list { flex: 1; overflow-y: auto; padding: 6px 16px; min-height: 140px; }
.sh-cm { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ro-border-soft, #eef2f7); }
.sh-cm .sh-av { width: 30px; height: 30px; font-size: 12px; color: #fff; border: 0; }
.sh-cm__b { flex: 1; min-width: 0; }
.sh-cm__h { font-size: 12px; color: var(--ro-text-sub, #64748b); display: flex; gap: 8px; align-items: center; }
.sh-cm__h b { color: var(--ro-text, #0f172a); font-weight: 800; }
.sh-cm__txt { font-size: 14px; line-height: 1.45; white-space: pre-line; word-break: break-word; margin-top: 2px; }
.sh-cm__act { margin-left: auto; border: 0; background: none; color: var(--ro-text-sub, #64748b); font-size: 11.5px; cursor: pointer; padding: 2px 4px; }
.sh-sheet__form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--ro-border, #e5e9f0); }
.sh-sheet__form textarea { flex: 1; resize: none; height: 42px; border: 1px solid var(--ro-border, #e5e9f0); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; background: var(--ro-bg, #fff); color: var(--ro-text, #0f172a); }
.sh-sheet__form button { border: 0; border-radius: 12px; padding: 0 16px; background: var(--ro-primary-500, #4E8FFF); color: #fff; font-weight: 900; cursor: pointer; }
.sh-sheet__form button:disabled { opacity: .5; }
.sh-sheet__form[hidden], .sh-sheet__login[hidden], .ro-shs[hidden] { display: none; }
.sh-sheet__login { padding: 12px 16px; font-size: 13.5px; color: var(--ro-text-sub, #64748b); border-top: 1px solid var(--ro-border, #e5e9f0); }
.sh-sheet__login a { color: var(--ro-primary-600, #3A78EE); font-weight: 800; }
.sh-sheet__empty { padding: 30px 0; text-align: center; color: var(--ro-text-sub, #64748b); font-size: 13.5px; }
.sh-dim { position: fixed; inset: 0; z-index: 1090; background: rgba(0,0,0,.35); display: none; }
.sh-dim.is-open { display: block; }

/* 검색엔진·JS 꺼짐용 본문(첫 편 요약) */
.sh-seo { position: absolute; left: 14px; right: 14px; bottom: 120px; z-index: 2; }
.sh-seo h1 { font-size: 20px; margin: 0 0 6px; }
.sh-seo p { margin: 0; opacity: .85; font-size: 14px; }

@media (min-width: 900px) {
  .sh-feed { left: 50%; width: min(520px, 100vw); transform: translateX(-50%); }
  .sh-slide { border-left: 1px solid rgba(255,255,255,.06); border-right: 1px solid rgba(255,255,255,.06); }
}
@media (prefers-reduced-motion: reduce) {
  .sh-map { transform: none !important; transition: none; }
}

/* ── 내 기록 「쇼츠로 공유」(공유 버튼 + 창) — 일반 페이지 위라 테마 토큰만 ── */
.ro-shs { margin: 12px 0 4px; }
.ro-shs__btn { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 900; font-size: 14px; cursor: pointer;
  background: linear-gradient(135deg, #ff3b6b, #ff7a45); color: #fff; }
.ro-shs__btn.is-shared { background: var(--ro-success-50, #ecfdf5); color: var(--ro-success-700, #047857); border: 1px solid var(--ro-success-200, #a7f3d0); }
.ro-shs__note { font-size: 12px; color: var(--ro-text-sub, #64748b); margin-top: 6px; }
.ro-shs__modal { position: fixed; inset: 0; z-index: 1150; display: none; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.45); }
.ro-shs__modal.is-open { display: flex; }
.ro-shs__panel { width: min(520px, 100%); background: var(--ro-surface, #fff); color: var(--ro-text, #0f172a); border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); max-height: 90vh; overflow-y: auto; }
@media (min-width: 640px) { .ro-shs__modal { align-items: center; } .ro-shs__panel { border-radius: 20px; } }
.ro-shs__panel h3 { margin: 0 0 4px; font-size: 17px; font-weight: 900; }
.ro-shs__panel .ro-shs__sub { margin: 0 0 14px; font-size: 12.5px; color: var(--ro-text-sub, #64748b); line-height: 1.5; }
.ro-shs__panel label { display: block; font-size: 12.5px; font-weight: 800; margin: 12px 0 6px; color: var(--ro-text, #0f172a); }
.ro-shs__panel input[type=text], .ro-shs__panel textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--ro-border, #e5e9f0); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; background: var(--ro-bg, #fff); color: var(--ro-text, #0f172a); }
.ro-shs__panel textarea { min-height: 70px; resize: vertical; }
.ro-shs__vis { display: flex; gap: 8px; }
.ro-shs__vis label { flex: 1; margin: 0; border: 1px solid var(--ro-border, #e5e9f0); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.ro-shs__vis input { accent-color: var(--ro-primary-500, #4E8FFF); }
.ro-shs__safe { margin-top: 12px; font-size: 12px; line-height: 1.55; color: var(--ro-text-sub, #64748b); background: var(--ro-bg-soft, #f8fafc); border-radius: 12px; padding: 10px 12px; }
.ro-shs__row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.ro-shs__row button, .ro-shs__row a { flex: 1; text-align: center; border-radius: 12px; padding: 12px; font-weight: 900; font-size: 14px; cursor: pointer; text-decoration: none; border: 1px solid var(--ro-border, #e5e9f0); background: var(--ro-surface, #fff); color: var(--ro-text, #0f172a); }
.ro-shs__row .is-p { background: var(--ro-primary-500, #4E8FFF); border-color: var(--ro-primary-500, #4E8FFF); color: #fff; }
.ro-shs__row .is-d { color: var(--ro-danger-600, #dc2626); }

/* embed(광장 오버레이 iframe) — 우측 위 닫기 */
.sh-top__close { color: #fff; font-size: 12.5px; font-weight: 800; padding: 7px 14px; border-radius: 999px; border: 0; background: rgba(0,0,0,.45); cursor: pointer; }
.sh-top__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
