/* 첫 시작(U5, 정책서 11절). 보호자 화면은 guardian.css 의 g-* 를, 아이 화면은 v4 토큰을 읽어 쓴다. 색·글꼴·크기는 tokens.css 이름만 쓴다. */

/* ── 공통 ── */
.w-preview { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--text-mute); font-size: var(--fs-small); text-align: center; }
.w-input { width: 100%; min-height: var(--touch); padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: 17px; box-sizing: border-box; }
.w-input:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; }
.w-err { margin: 6px 0 0; color: var(--text); font-weight: 600; }
.w-err[hidden] { display: none; }

/* ── 보호자 화면 ── */
.w-parent { max-width: 560px; margin-inline: auto; }
.w-head { margin: 4px 0 12px; }
.w-head h1 { margin: 2px 0 4px; font-family: var(--f-head); font-size: var(--fs-title); line-height: 1.3; }
.w-step { margin: 0; color: var(--text-mute); font-size: var(--fs-small); }
.w-sub { margin: 0; }
.w-hint { margin: 2px 0 8px; }
.w-label { margin: 14px 0 0; font-size: 15px; }
.w-days { display: grid; gap: 8px; }
.w-day { display: grid; grid-template-columns: 1.6em 1fr; gap: 8px; align-items: center; }
.w-dayname { font-size: 17px; text-align: center; }
.w-pub { display: grid; gap: 6px; margin-bottom: 12px; }

/* ── 아이 화면 ── */
.screen.w-kid { display: flex; flex-direction: column; gap: 14px; min-height: 100dvh; padding-bottom: 0; }
.w-guide { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.w-guide__pic { flex: none; width: 84px; height: 84px; }
.w-guide .ui-bubble { font-size: 17px; line-height: 1.5; }
.w-line { display: block; }
.w-me { display: flex; justify-content: center; align-items: flex-end; min-height: 150px; }
.w-bar { position: sticky; bottom: 0; margin: auto calc(-1 * var(--gutter)) 0; display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-3) var(--gutter) calc(var(--sp-3) + var(--sab)); background: linear-gradient(180deg, rgba(10, 17, 40, 0), rgba(10, 17, 40, 0.96) 28%); }
.w-bar .ui-btn { min-width: 150px; }
.w-bar .ui-btn--sub { margin-right: auto; min-width: 0; }
.w-input--kid { font-size: 20px; text-align: center; min-height: 56px; }

/* 친구 고르기 */
.w-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.w-card { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 132px; padding: 8px 6px 10px; border-radius: var(--radius-lg); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.w-card:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; }
.w-card.is-picked { border-color: var(--lamp); border-width: 2px; background: color-mix(in srgb, var(--lamp) 14%, var(--surface)); box-shadow: 0 0 12px var(--lamp-glow); }
.w-card__pic { width: 96px; height: 96px; }
.w-card__name { font-size: 17px; font-weight: 700; }
.w-card__tag { color: var(--text-mute); font-size: var(--fs-small); line-height: 1.35; text-align: center; }

/* 첫 걸음 별 */
.w-star { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--lamp); }
.w-star .ui-icon { width: 56px; height: 56px; filter: drop-shadow(0 0 10px var(--lamp-glow)); }
.w-star__text { color: var(--text); font-size: 17px; font-weight: 700; }

@media (prefers-reduced-motion: no-preference) {
  .w-card.is-picked .w-card__pic { animation: w-pop 0.3s ease-out; }
  @keyframes w-pop { 0% { transform: scale(0.92); } 100% { transform: scale(1); } }
}

/* ── 여는 장면(#open, src/ui/scene/opening.js)과 친구 고르기(K1)가 같이 쓰는 그림 ── */
.op-scene, .pk-scene { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.op-stars { position: absolute; left: 0; top: 0; }
.op-ground { position: absolute; height: 2px; border-radius: 1px; background: #1F2B66; }
.op-house { position: absolute; }
.op-prop { position: absolute; display: block; height: auto; pointer-events: none; }
.op-orb { position: absolute; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; opacity: 0; z-index: 4;
  background: radial-gradient(circle, #FFF8DC 0, #FFE29A 22%, rgba(255, 196, 90, 0.55) 42%, rgba(255, 196, 90, 0) 70%); }
.pk-pic { display: block; background-repeat: no-repeat; background-size: 400% 100%; }
.op-friend { position: absolute; z-index: 5; }

/* ── 친구 고르기(K1): 집은 위, 아래에 옆으로 미는 한 줄(시안 B) ── */
.screen.w-pick { position: fixed; inset: 0; min-height: 0; padding: 0; overflow: hidden; background: radial-gradient(120% 60% at 50% 55%, #111A3D 0%, #0A1128 70%); }
.pk-guide { position: absolute; left: 16px; right: 16px; margin: 0; text-align: center; font-size: 20px; font-weight: 700; line-height: 1.35; color: var(--text); text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7); z-index: 3; }
.pk-strip { position: absolute; left: 0; right: 0; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; z-index: 3;
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); mask: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); }
.pk-strip::-webkit-scrollbar { display: none; }
.pk-fr { flex: none; display: flex; flex-direction: column; align-items: center; padding: 0 0 4px; border: 0; border-radius: 16px; background: transparent; color: var(--text); font: inherit; cursor: pointer; scroll-snap-align: center; -webkit-tap-highlight-color: transparent; transition: opacity 0.3s ease, filter 0.3s ease; }
.pk-fr:focus-visible { outline: 3px solid var(--lamp); outline-offset: -4px; }
.pk-fr__name { margin-top: 2px; font-size: 15px; font-weight: 700; line-height: 1.2; min-height: 20px; }
.pk-fr.is-dim { opacity: 0.32; filter: saturate(0.45) brightness(0.8); }
.pk-fr.is-out .pk-pic { visibility: hidden; }
.pk-hero { position: absolute; z-index: 4; transform-origin: 50% 89.94%; pointer-events: none; }
.pk-sheet { position: absolute; left: 50%; bottom: calc(16px + var(--sab)); width: min(calc(100% - 32px), 460px); z-index: 6; box-sizing: border-box; border-radius: 24px; padding: 16px 16px 4px; text-align: center;
  background: rgba(19, 31, 74, 0.92); box-shadow: inset 0 0 0 1px rgba(200, 215, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 -10px 40px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, calc(100% + 40px)); visibility: hidden; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.3s; }
.pk-sheet.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) 0.12s, visibility 0s; }
.pk-sheet__name { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.25; }
.pk-sheet__tag { margin: 2px 0 10px; font-size: 15px; color: var(--text-mute); }
.pk-sheet__ask { margin: 0 0 12px; font-size: 20px; font-weight: 700; }
.pk-sheet__btns { display: grid; gap: 0; }
.pk-sheet__btns .ui-btn--text { margin: 0 auto; min-height: 48px; }
.pk-sheet.is-done { padding-bottom: 16px; }
.pk-sheet.is-done :is(.pk-sheet__tag, .pk-sheet__btns) { display: none; }
.pk-sheet.is-done .pk-sheet__ask { margin: 0; }
html[data-motion="reduce"] :is(.pk-sheet, .pk-sheet.is-on, .pk-fr) { transition: none; }
@media (prefers-reduced-motion: reduce) { :is(.pk-sheet, .pk-sheet.is-on, .pk-fr) { transition: none; } }

/* ── 어른 확인 문제(PA) ── */
.w-gate__card { text-align: center; }
.w-gate__q { margin: 4px 0 8px; font-size: 26px; font-weight: 800; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.w-gate__ans { display: block; min-height: 48px; margin: 0 auto; max-width: 200px; padding: 6px 12px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 26px; font-weight: 700; line-height: 36px; box-sizing: border-box; font-variant-numeric: tabular-nums; }
.w-gate__pad { margin-top: 12px; }
.w-gate .g-pin-key--ok { font-size: 15px; font-weight: 800; background: var(--gl-main, var(--accent)); color: var(--lamp-ink, #2A1B00); border-color: transparent; }
