/* 온보딩 — 밀물 진행바 컨셉 (명세 §1) */

.ob {
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--app-bg);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}

/* 진행바: 답할 때마다 물이 차오르고, 보드 아이콘이 그 위를 따라 이동.
   보드 아이콘이 바 위로 9px 튀어나오는데 .ob 가 overflow:hidden 이라,
   진행바를 최상단에 붙이면 아이콘 윗부분이 잘립니다 → 위에 여유를 둡니다. */
.ob__progress {
  position: relative; height: 4px; margin-top: 14px;
  background: rgba(255, 255, 255, .07); flex-shrink: 0;
}
.ob__tide {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, #0A4F6E, #38BDF8);
  transition: width .45s cubic-bezier(.3, .9, .3, 1);
}
.ob__board {
  position: absolute; top: -9px; width: 20px; height: 20px;
  transform: translateX(-50%);
  transition: left .45s cubic-bezier(.3, .9, .3, 1);
  font-size: 15px; line-height: 20px; text-align: center;
}

.ob__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 0; min-height: 44px; flex-shrink: 0;
}
.ob__back {
  background: none; border: none; color: var(--text-muted);
  font-size: 14.5px; cursor: pointer; padding: 8px 4px; min-height: 44px;
}
.ob__step { font-family: var(--font-num); font-size: 12px; color: rgba(255, 255, 255, .4); letter-spacing: .5px; }

.ob__body { flex: 1; padding: 18px 18px 28px; display: flex; flex-direction: column; }

/* 온보딩 버튼은 글로우(퍼지는 그림자) 없이 깔끔하게 */
.ob .btn-primary { box-shadow: none; }

.ob__q      { font-size: 24px; font-weight: 800; color: var(--text-strong); line-height: 1.4; margin: 6px 0 6px; }
.ob__qsub   { font-size: 14.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }
/* 한 화면에 질문이 둘 있는 경우(연령대+성별 / 활동지역+보드유형)의 질문 문구.
   선택지(15.5px)와 확실히 구분되도록 키웁니다. */
.ob__flabel { font-size: 19px; font-weight: 700; color: var(--text-strong); line-height: 1.4; margin: 0 0 6px; }
.ob__fsub   { font-size: 13.5px; color: var(--text-dim); margin-bottom: 12px; }
.ob__field  { margin-bottom: 30px; }

.ob__opts      { display: flex; flex-direction: column; gap: 9px; }
.ob__opts.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
/* 2열 그리드에서 마지막 항목만 두 칸 전체를 차지 (예: 성별의 "밝히지 않음") */
.ob__opts--spanlast > :last-child { grid-column: 1 / -1; }
/* 그리드 항목은 가로로만 긴 얇은 박스가 되지 않도록 세로도 넉넉하게 */
.ob__opts.grid .ob__opt { min-height: 64px; justify-content: center; }

.ob__opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 15px 16px; min-height: 52px;
  border: 1.5px solid var(--line-12); border-radius: 14px;
  background: var(--surface-card); color: var(--text-quiet);
  font-size: 15.5px; font-weight: 600; text-align: left; cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}
.ob__opt:hover { border-color: rgba(255, 255, 255, .22); }
.ob__opt.is-on {
  border-color: var(--accent-forecast);
  background: rgba(94, 198, 240, .14);
  color: var(--accent-forecast);
  font-weight: 700;
}
.ob__opt small { font-size: 12.5px; font-weight: 500; color: var(--text-dim); }
.ob__opt.is-on small { color: rgba(94, 198, 240, .75); }

.ob__freetext {
  width: 100%; margin-top: 9px; padding: 13px 14px;
  border: 1.5px solid rgba(94, 198, 240, .35); border-radius: 12px;
  background: var(--surface-card); color: var(--text-strong);
  font-size: 14.5px; outline: none;
}

/* 구간 분할형 트랙 — 막대 10개(폭은 구간 레벨 수에 비례).
   input[type=range] 는 트랙을 칸으로 쪼갤 수 없어서, 트랙을 div 로 그리고
   트랙이 투명한 range 를 그 위에 겹쳐 올립니다(드래그·접근성은 그대로). */
.ob__trackwrap { position: relative; height: 8px; margin-top: 24px; }

.ob__track { display: flex; gap: 3px; height: 100%; }
.ob__seg {
  position: relative; overflow: hidden;
  border-radius: 2px; flex-basis: 0; min-width: 2px;
  /* background(램프 색 조각)는 JS 가 구간별로 넣습니다 */
}
/* 아직 안 찬 부분만 오른쪽에서 어두운 회색으로 덮습니다.
   반투명(rgba(255,255,255,.13))은 밑에 깔린 램프 그라데이션이 비쳐 탁한 파스텔로 보였습니다
   → 불투명한 어두운 회색으로 완전히 덮습니다. */
.ob__seg i {
  position: absolute; right: 0; top: 0; bottom: 0;
  background: #3a3a3d;
  transition: width .16s ease;
}

/* 트랙 위에 겹치는 range — 트랙은 투명, 손잡이만 보이게 */
.ob__slider {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 100%; height: 28px; margin: 0; padding: 0;
  -webkit-appearance: none; appearance: none;
  background: transparent; outline: none; cursor: pointer;
}
.ob__slider::-webkit-slider-runnable-track { height: 8px; background: transparent; border: none; }
.ob__slider::-moz-range-track { height: 8px; background: transparent; border: none; }
.ob__slider::-webkit-slider-thumb {
  -webkit-appearance: none; margin-top: -10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #f2f2f3; border: 3px solid #1A8AAF; cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.ob__slider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: #f2f2f3; border: 3px solid #1A8AAF; cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.ob__slider:active::-webkit-slider-thumb { cursor: grabbing; }

/* 슬라이더 왼쪽 끝 구간 이름 — 손잡이(28px)가 바 위아래로 11px 튀어나오므로 여백을 넉넉히 */
.ob__axis { font-size: 12.5px; color: var(--text-muted); margin-top: 20px; }

/* 실력 문구 드럼 */
.ob__drum {
  position: relative;
  height: 226px;                    /* 중앙 + 위아래 1문장 온전히 + 2번째가 절반쯤 걸침 */
  margin: 4px 0 22px;               /* 슬라이더 그룹과 문장 그룹을 가깝게 */
  /* 원근이 얕으면 translateZ 가 칸을 부풀려 좌우로 잘립니다.
     확대율 = perspective / (perspective − RADIUS). 2600px 이면 약 1.1배. */
  perspective: 2600px;
  overflow: hidden;
  touch-action: none;               /* 세로 스와이프를 페이지 스크롤에 뺏기지 않게 */
  cursor: grab;
  -webkit-user-select: none; user-select: none;
}
.ob__drum.is-dragging { cursor: grabbing; }
.ob__drumInner { position: absolute; inset: 0; transform-style: preserve-3d; }

.ob__cell {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 52px; margin-top: -26px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 0 22px;
  font-size: 14.5px; line-height: 1.5; color: var(--text-dim);
  /* 줄바꿈 허용 — nowrap/ellipsis 를 쓰면 긴 문장이 좌우로 잘립니다 */
  white-space: normal; overflow: visible; word-break: keep-all;
  backface-visibility: hidden;
  transition: transform .3s cubic-bezier(.2, .85, .3, 1),
              opacity .3s ease, color .2s ease, font-size .2s ease;
  will-change: transform, opacity;
}
.ob__cell.is-active { font-size: 17px; font-weight: 700; color: var(--text-strong); }

/* 마지막 문장(최고 단계)은 슬라이더 바와 같은 그라데이션 + 다른 문장의 1.25배 크기 */
.ob__cell--cosmic.is-active {
  font-size: 21.25px; font-weight: 800;   /* 17px × 1.25 */
  background: linear-gradient(90deg, #1A8AAF, #F5B942);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.ob__drum::before,
.ob__drum::after {
  content: ''; position: absolute; left: 0; right: 0; height: 34px;
  pointer-events: none; z-index: 2;
}
.ob__drum::before { top: 0;    background: linear-gradient(var(--app-bg), transparent); }
.ob__drum::after  { bottom: 0; background: linear-gradient(transparent, var(--app-bg)); }

@media (prefers-reduced-motion: reduce) {
  .ob__cell { transition: opacity .15s ease; }
}

/* ── 웰컴 ── */
.ob__welcome { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 18px 40px; text-align: center; }
.ob__brand   { font-size: 13px; font-weight: 700; letter-spacing: 3px; color: var(--accent-forecast); margin-bottom: 18px; }
.ob__hero    { font-size: 32px; font-weight: 800; line-height: 1.4; color: var(--text-strong); margin-bottom: 16px; }
.ob__lede    { font-size: 15.5px; line-height: 1.7; color: var(--text-muted); margin-bottom: 34px; }

/* ── 완료(진단) ── */
.ob__done { text-align: center; align-items: stretch; }

.ob__check {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(94, 198, 240, .14); color: var(--accent-forecast);
  display: flex; align-items: center; justify-content: center;
  margin: 30px auto 26px;
}
.ob__donetitle { font-size: 26px; font-weight: 800; color: var(--text-strong); margin: 0 0 16px; }
.ob__donelede  { font-size: 14.5px; line-height: 1.7; color: var(--text-muted); margin: 0 0 40px; }

/* 요약 카드 — 숫자 줄은 넣지 않습니다 */
.ob__summary {
  background: var(--surface-card); border: 1px solid var(--line-10);
  border-radius: var(--r-mid); padding: 22px 20px; margin-bottom: 46px;
}
.ob__sumline { font-size: 16px; font-weight: 700; color: var(--accent-forecast); line-height: 1.5; white-space: nowrap; overflow-x: auto; }
/* 입문시기 줄 / 활동기간·평균세션 줄 — 값 조합이 길어도 줄바꿈되지 않고 한 줄을 유지합니다.
   (실제 최장 조합도 375px 폭에서 넘치지 않는 걸 확인했지만, 혹시 넘치면 줄바꿈 대신 가로 스크롤로 흡수) */
.ob__sumsub  { font-size: 14px; color: var(--text-quiet); line-height: 1.6; margin-top: 10px; white-space: nowrap; overflow-x: auto; }

/* 크게 표시되는 자리 — 밴드명 + 진단 문구만 */
.ob__bandline { font-size: 16px; line-height: 1.7; color: var(--text-quiet); margin-bottom: 12px; }
.ob__band     { font-size: 38px; font-weight: 800; letter-spacing: -.5px; line-height: 1.25; color: var(--text-strong); }
.ob__banddiv  { width: 44px; height: 2px; border-radius: 1px; margin: 20px auto; background: linear-gradient(90deg, #1A8AAF, #5ec6f0); }

/* 밴드 아래 재조정 안내 — 작은 괄호 문구, 요약 카드와의 사이 간격만 확보 */
.ob__donenote { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin-bottom: 30px; }

/* 버튼 영역은 화면 하단에 고정하고, 남는 세로 공간은 그 위에서 자연스럽게 흡수합니다.
   구분선(border-top)이 안내 문구와 버튼 사이를 갈라줍니다. */
.ob__donefoot {
  margin-top: auto; padding-top: 22px;
  border-top: 1px solid var(--line-08);
}
.ob__profilelink {
  display: inline-block; margin-top: 14px;
  font-size: 13.5px; color: var(--text-muted); text-decoration: underline;
  padding: 8px 4px; min-height: 40px;
}
.ob__profilelink:hover { color: var(--accent-forecast); }

.ob__err { font-size: 13.5px; color: #ffb9b0; text-align: center; margin-top: 12px; line-height: 1.6; }
