/* d01 밤의 뾱뾱뾱 — 9/30 최초 프론트(밤 남색·보라·핑크·와인 버튼·3D 이모지)를 메신저 톡방으로 디벨롭 */
:root {
  --bg: #0E0D18;
  --bg-2: #13121F;
  --surface: #1B1930;
  --surface-2: #232040;
  --line: #2C2848;
  --text: #F3F1FB;
  --sub: #A9A4C6;
  --faint: #6F6A8E;
  --purple: #7B5CFA;
  --purple-2: #9C85FF;
  --pink: #FF5C8A;
  --wine: #8E2A3A;
  --gold: #F2C14E;
  --mint: #4ED8A6;
  --me: linear-gradient(135deg, #7B5CFA 0%, #9A6BFF 100%);
  --r: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: #07060D;
  color: var(--text);
  font-family: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }

/* 무대 */
.stage { min-height: 100%; display: flex; justify-content: center; align-items: flex-start; gap: 40px; padding: 0; }
.app {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (min-width: 900px) {
  .stage { padding: 28px 0; align-items: center; min-height: 100vh; }
  .app { height: 844px; max-width: 390px; border-radius: 34px; box-shadow: 0 0 0 10px #1c1a2b, 0 30px 80px rgba(0,0,0,.6); }
}
.side { display: none; width: 300px; color: var(--sub); font-size: 13px; }
@media (min-width: 900px) { .side { display: block; } }
.side h1 { font-size: 20px; color: var(--text); margin-bottom: 6px; }
.side p { margin-bottom: 14px; }
.side .scene-list { display: grid; gap: 8px; }
.side .scene-list button { text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.side .scene-list button:hover { border-color: var(--purple); }
.side .scene-list small { display: block; color: var(--faint); }

/* 장면 바로가기 (모바일) */
.jump { position: relative; z-index: 60; display: flex; justify-content: center; background: #07060D; padding: 3px 0; flex: none; }
.jump > button { font-size: 11px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--sub); }
.jump .menu { display: none; position: absolute; top: 28px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 6px; width: 210px; box-shadow: var(--shadow); }
.jump.on .menu { display: grid; gap: 2px; }
.jump .menu button { text-align: left; padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.jump .menu button:hover { background: rgba(255,255,255,.06); }
@media (min-width: 900px) { .jump { display: none; } }
@media (max-width: 899px) { .view { top: 26px; } }
.embed .jump { display: none; }
.embed .view { top: 0; }

/* 공통 뷰 */
.view { position: absolute; inset: 0; display: none; flex-direction: column; }
.view.on { display: flex; }

/* 워드마크: 최초 프론트의 두꺼운 '뾱뾱뾱' + 보라·핑크 어긋난 그림자 */
.wordmark { font-weight: 900; font-size: 22px; letter-spacing: -0.06em; color: #fff; text-shadow: 1.5px 0 0 var(--pink), -1.5px 0 0 var(--purple); }

/* ── S6 톡방 목록 ── */
.list-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px; }
.bbyok { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.bbyok i { position: relative; width: 18px; height: 16px; display: inline-block; }
.bbyok i::before, .bbyok i::after, .bbyok i b { content: ""; position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, #c6b6ff 35%, #ff8fb1 100%); }
.bbyok i::before { width: 11px; height: 11px; right: 0; top: 0; }
.bbyok i::after { width: 7px; height: 7px; left: 0; bottom: 1px; }
.bbyok i b { width: 6px; height: 6px; left: 6px; top: 9px; }
.bbyok.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.15); } }
.list-title { padding: 6px 18px 10px; display: flex; align-items: baseline; gap: 8px; }
.list-title h2 { font-size: 24px; font-weight: 800; }
.list-title span { color: var(--faint); font-size: 13px; }
.attend { margin: 4px 16px 10px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(120deg, #6C4DF0, #8E62FF 60%, #B76CF2); display: flex; align-items: center; gap: 12px; box-shadow: 0 12px 30px rgba(108, 77, 240, .35); }
.attend .ic { font-size: 30px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.attend b { display: block; font-size: 15px; }
.attend small { color: rgba(255,255,255,.8); font-size: 12px; }
.attend button { margin-left: auto; background: #fff; color: #4b33c8; font-weight: 800; font-size: 13px; padding: 8px 12px; border-radius: 99px; }
.rooms { flex: 1; overflow-y: auto; padding: 4px 8px 90px; }
.room { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; text-align: left; }
.room:hover { background: rgba(255,255,255,.03); }
.room .av { width: 52px; height: 52px; flex: none; border-radius: 19px; overflow: hidden; background-color: #fff; position: relative; }
.room .meta { flex: 1; min-width: 0; }
.room .nm { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.room .nm em { font-style: normal; font-size: 11px; color: var(--sub); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-weight: 600; }
.room .last { color: var(--sub); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room .rt { text-align: right; font-size: 11px; color: var(--faint); display: grid; gap: 4px; justify-items: end; }
.room .cnt { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.room.dim { opacity: .55; }
.group-av { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--surface-2) !important; padding: 4px; }
.group-av span { border-radius: 8px; overflow: hidden; background-color: #fff; }
.group-av span:nth-child(3) { grid-column: span 2; }
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 6px 14px; background: rgba(19, 18, 31, .96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.tabbar button { display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--faint); padding: 4px 0; border-radius: 12px; }
.tabbar button .e { font-size: 21px; filter: grayscale(.4); }
.tabbar button.on { color: var(--text); background: rgba(255,255,255,.05); }
.tabbar button.on .e { filter: none; }

/* 그림 공통 */
.face-halmae { background: #fff url(../img/halmae.jpg) no-repeat; background-size: 300% auto; background-position: 83% 47%; }
.face-ragu { background: #2a2030 url(../img/ragu_dosa.webp) no-repeat center / cover; } /* 11-13 사용자: 사주 결과지 도사 장면 톤으로 */

/* ── S1 촛불 인트로 (최초 프론트의 '한 화면 한 문장') ── */
.intro { background: #000; align-items: center; justify-content: flex-end; padding: 0 20px 26px; text-align: center; }
.intro .brand { position: absolute; top: 22px; left: 0; right: 0; text-align: center; }
.intro .candle { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); font-size: 64px; filter: drop-shadow(0 0 24px rgba(255, 170, 60, .45)); animation: flicker 2.4s infinite ease-in-out; }
/* 생년월일 칸: 휠과 양방향 연동. 평소엔 결과 표시, 누르면 숫자 입력칸으로 */
.bfield { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.bseg { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 3px; height: 58px; padding-top: 12px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: text; transition: box-shadow .15s, background .15s; }
.bseg input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; font-size: 24px; font-weight: 900; text-align: right; caret-color: #F2C14E; font-variant-numeric: tabular-nums; }
.bseg span { flex: 0 0 auto; padding-right: 14px; color: var(--faint); font-size: 14px; font-weight: 700; }
.bseg.edit { background: rgba(242, 193, 78, .08); box-shadow: inset 0 0 0 2px #F2C14E; }
.bseg.edit::after { content: '숫자로 고치기'; position: absolute; top: -9px; left: 10px; padding: 0 6px; border-radius: 6px; background: #F2C14E; color: #1B1930; font-size: 10px; font-weight: 800; line-height: 16px; }
.bseg.fill input { animation: bfill .35s ease-out; }
@keyframes bfill { 0% { color: #F2C14E; transform: translateY(-3px); } 100% { color: #fff; transform: none; } }
.bseg input::placeholder { color: var(--faint); opacity: .6; }
.tpick { scrollbar-width: none; }
.tpick::-webkit-scrollbar, .pick::-webkit-scrollbar { display: none; }
#tWrap.tdim { opacity: .35; pointer-events: none; transition: opacity .2s; }
/* 가입 단계: 조작부를 엄지가 닿는 아래쪽에(질문은 위, 입력·휠·선택지는 '다음' 버튼 바로 위).
   도시 검색(결과 목록이 아래로 펼쳐짐)·마지막 확인(긴 목록)은 위에서부터 */
.sg-body { display: flex; flex-direction: column; }
.sg-body.thumb { margin-top: auto; padding-top: 12px; }
.sg-next { padding-top: 16px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.sg-body:not(.thumb) + .sg-next { margin-top: auto; }
/* 닉네임 중복 확인 상태 + 다시 뽑기 */
.nick-st { min-height: 20px; margin: 8px 0 14px; font-size: 13px; font-weight: 700; color: var(--faint); }
.nick-st.wait { color: var(--faint); }
.nick-st.ok { color: #5BD08A; }
.nick-st.ok::before { content: ''; display: inline-block; width: 1.1em; height: 1.1em; margin-right: 4px; vertical-align: -.2em; background: url(../img/icons/check-mark-2x.png?v=1022c) center / contain no-repeat; }
.nick-st.bad { color: #FF7A7F; }
#recs { min-height: 40px; transition: opacity .2s, transform .2s; }
#recs.rolling { opacity: 0; transform: translateY(4px); }
.nick-roll { margin-top: 10px; }
/* 간편 로그인 버튼: 각 서비스 공식 색·로고(카카오 노랑, 네이버 초록, 구글 흰 바탕 4색 G) */
.sso { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; border: 0; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .12s, filter .12s; }
.sso:active { transform: scale(.98); filter: brightness(.94); }
.sso svg { position: absolute; left: 18px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); }
.sso-kakao { background: #FEE500; color: rgba(0, 0, 0, .85); }
.sso-naver { background: #03C75A; color: #fff; }
.sso-naver svg { width: 20px; height: 20px; }
.sso-google { background: #fff; color: #1f1f1f; }
.sso-google svg { width: 19px; height: 19px; left: 19px; }
.sso-email { background: transparent; color: var(--ink, #ece9ff); box-shadow: inset 0 0 0 1px rgba(236, 233, 255, .22); }
/* 시작 화면 큰 촛불: 몸통은 고정, 불꽃만 바람에 흔들림(불꽃 밑동 기준으로 기울고 늘었다 줄었다) */
.candle-big { position: absolute; top: 27%; left: 50%; width: 150px; height: 150px; margin-left: -75px; }
.candle-big img { position: absolute; inset: 0; width: 100%; height: 100%; }
.candle-big .body { clip-path: inset(31% 0 0 0); filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .5)); }
.candle-big .flame { clip-path: inset(0 0 69% 0); transform-origin: 50% 31%; animation: wind 3.2s infinite ease-in-out; }
.candle-big .cb-glow { position: absolute; left: 50%; top: -8%; width: 150px; height: 150px; margin-left: -75px; border: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255, 176, 70, .45) 0%, rgba(255, 140, 40, .16) 36%, transparent 68%); animation: cbglow 3.2s infinite ease-in-out; }
@keyframes wind {
  0%, 100% { transform: skewX(0deg) scaleY(1); }
  18% { transform: skewX(-7deg) scaleY(1.04) translateX(-2px); }
  32% { transform: skewX(4deg) scaleY(.96); }
  47% { transform: skewX(-11deg) scaleY(1.07) translateX(-3px); }
  58% { transform: skewX(-4deg) scaleY(.98); }
  74% { transform: skewX(6deg) scaleY(1.03) translateX(1px); }
  88% { transform: skewX(-2deg) scaleY(.99); }
}
@keyframes cbglow { 0%, 100% { opacity: .85; transform: scale(1); } 30% { opacity: .65; transform: scale(.94) translateX(-3px); } 50% { opacity: 1; transform: scale(1.06) translateX(-4px); } 75% { opacity: .75; transform: scale(.97) translateX(2px); } }
@media (prefers-reduced-motion: reduce) { .candle-big .flame, .candle-big .cb-glow { animation: none; } }
@keyframes flicker { 50% { filter: drop-shadow(0 0 34px rgba(255, 170, 60, .7)); transform: translateX(-50%) scale(1.03); } }
.intro .who { position: absolute; top: 50%; left: 0; right: 0; color: var(--faint); font-size: 13px; }
.intro .line { font-size: 22px; font-weight: 800; line-height: 1.45; margin-bottom: 22px; min-height: 64px; opacity: 0; transform: translateY(8px); transition: .5s; }
.intro .line.on { opacity: 1; transform: none; }
.intro .btns { display: grid; gap: 10px; width: 100%; }
.btn-wine { width: 100%; padding: 17px; border-radius: 16px; background: var(--cta-bg, var(--wine)); color: var(--cta-fg, #fff); box-shadow: var(--cta-shadow, none); font-weight: 800; font-size: 16px; }
.btn-ghost { width: 100%; padding: 15px; border-radius: 16px; background: var(--ghost-bg, rgba(255,255,255,.06)); color: var(--ghost-fg, var(--sub)); box-shadow: var(--ghost-line, none); font-weight: 700; }
/* 10-22 버튼 색 바리에이션: 인트로(달빛 젤리) 팔레트에 맞춤. html[data-btn] = wine(기본, 10-22 사용자 선택)·pink·lavender·candle·mint */
html[data-btn="pink"] { --cta-bg: linear-gradient(180deg, #ffb3cc 0%, #ff7fab 100%); --cta-fg: #3a0f26; --cta-shadow: 0 8px 22px rgba(255, 127, 171, .38), inset 0 2px 0 rgba(255, 255, 255, .5); }
html[data-btn="lavender"] { --cta-bg: linear-gradient(180deg, #cdbbff 0%, #9d7eff 100%); --cta-fg: #fff; --cta-shadow: 0 8px 22px rgba(157, 126, 255, .42), inset 0 2px 0 rgba(255, 255, 255, .45); }
html[data-btn="candle"] { --cta-bg: linear-gradient(180deg, #ffe4a6 0%, #f4b74c 100%); --cta-fg: #3b2508; --cta-shadow: 0 8px 22px rgba(244, 183, 76, .38), inset 0 2px 0 rgba(255, 255, 255, .55); }
html[data-btn="mint"] { --cta-bg: linear-gradient(180deg, #c8f4e2 0%, #8fdcbd 100%); --cta-fg: #10342a; --cta-shadow: 0 8px 22px rgba(143, 220, 189, .34), inset 0 2px 0 rgba(255, 255, 255, .55); }
html[data-btn="wine"] { --cta-bg: var(--wine); --cta-fg: #fff; --cta-shadow: none; }
html[data-btn="pink"], html[data-btn="lavender"], html[data-btn="candle"], html[data-btn="mint"] { --ghost-bg: rgba(255, 255, 255, .1); --ghost-fg: #f1ecff; --ghost-line: inset 0 0 0 1px rgba(205, 187, 255, .38); }
html[data-btn="wine"] { --ghost-bg: rgba(255,255,255,.06); --ghost-fg: var(--sub); --ghost-line: none; }
/* 시작 화면: 시안 5번 인트로 전면 배경 + 로고 위, 문구·버튼 아래(엄지 영역) */
.intro-x1 { padding: 0 !important; position: relative; min-height: 100%; overflow: hidden; background: #131022; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; }
.intro-x1 .ix-bg, .intro-x1 .ix-lit { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
/* 12초 주기: 0~2초 꺼짐 → 2~4 고민(켜짐) → 4~6 꺼짐 → 6~8 상담 → 8~10 꺼짐 → 10~12 안심. 켜고 끄는 전환은 0.4초 */
.intro-x1 .ix-lit { opacity: 0; animation: 12s linear infinite; }
.intro-x1 .ix-worry { animation-name: ixWorry; }
.intro-x1 .ix-consult { animation-name: ixConsult; }
.intro-x1 .ix-relief { animation-name: ixRelief; }
.intro-x1 .ix-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #110c1f; }
@keyframes ixWorry { 0%, 15% { opacity: 0; } 18.33%, 31.67% { opacity: 1; } 35%, 100% { opacity: 0; } }
@keyframes ixConsult { 0%, 48.33% { opacity: 0; } 51.67%, 65% { opacity: 1; } 68.33%, 100% { opacity: 0; } }
@keyframes ixRelief { 0%, 81.67% { opacity: 0; } 85%, 96.67% { opacity: 1; } 100% { opacity: 0; } }
.intro-x1 .ix-top { position: absolute; top: 26px; left: 0; right: 0; z-index: 2; }
.intro-x1 .ix-logo { font-size: 46px; letter-spacing: .02em; filter: drop-shadow(0 2px 10px rgba(19, 16, 34, .8)); }
.intro-x1 .ix-tag { margin-top: 6px; font-size: 15px; color: #efe8ff; text-shadow: 0 1px 6px rgba(19, 16, 34, .9); }
.intro-x1 .ix-bottom { position: relative; z-index: 2; align-self: stretch; padding: 40px 20px 26px; background: linear-gradient(180deg, rgba(19, 16, 34, 0) 0%, rgba(19, 16, 34, .86) 30%, #131022 100%); }
.intro-x1 .ix-line { font-size: 23px; font-weight: 800; line-height: 1.45; margin-bottom: 6px; color: #fff; }
.intro-x1 .ix-sub { color: #cfc6ea; font-size: 14px; margin-bottom: 18px; }
.intro-x1 .btn-wine, .intro-x1 .btn-ghost { display: block; text-decoration: none; }
.intro-x1 .btn-ghost { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .intro-x1 .ix-lit { animation: none; } .intro-x1 .ix-consult { opacity: 1; } }
.intro .bar { position: absolute; top: 62px; left: 18px; right: 18px; height: 5px; border-radius: 9px; background: #333; overflow: hidden; }
.intro .bar b { display: block; height: 100%; width: 30%; background: var(--pink); border-radius: 9px; transition: width .6s; }

/* ── 톡방 ── */
.room-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 5; }
.room-head .back { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; }
.room-head .back svg { width: 20px; height: 20px; }
.room-head .av { width: 38px; height: 38px; border-radius: 14px; flex: none; position: relative; }
.room-head .av::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--mint); border: 2px solid var(--bg); }
.room-head .t { flex: 1; min-width: 0; }
.room-head .t b { display: block; font-size: 16px; }
.room-head .t small { display: block; color: var(--sub); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-head .snd { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: var(--sub); }
.room-head .snd svg { width: 18px; height: 18px; }
.prog { height: 3px; background: #24213a; }
.prog b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), #FF8FB1); transition: width .5s; }
.target { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 12px; color: var(--sub); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.target .chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 99px; background: var(--surface-2); color: var(--text); font-weight: 600; }
.target .chip i { width: 18px; height: 18px; border-radius: 50%; display: inline-block; background: var(--purple); font-style: normal; font-size: 10px; display: grid; place-items: center; }
.target .chip.new { animation: pop .5s ease; box-shadow: 0 0 0 1px var(--pink) inset; }
.target .prog-t { margin-left: auto; }
.timer { display: none; align-items: center; gap: 8px; padding: 8px 14px; background: #1a1428; border-bottom: 1px solid var(--line); font-size: 12px; }
.timer.on { display: flex; }
.timer b { color: var(--pink); font-variant-numeric: tabular-nums; }
.timer s { color: var(--faint); margin-left: auto; }
.timer em { font-style: normal; color: var(--gold); font-weight: 700; }

.feed { flex: 1; overflow-y: auto; padding: 14px 12px 8px; }
.feed::-webkit-scrollbar { width: 0; }
.day { text-align: center; margin: 6px 0 14px; }
.day span { font-size: 11px; color: var(--sub); background: rgba(255,255,255,.05); padding: 4px 10px; border-radius: 99px; }
.sys { text-align: center; margin: 10px 0; }
.sys span { display: inline-block; font-size: 12px; color: var(--sub); background: rgba(123, 92, 250, .12); border: 1px solid rgba(123, 92, 250, .25); padding: 6px 12px; border-radius: 12px; max-width: 86%; }
.sys.good span { background: rgba(78, 216, 166, .1); border-color: rgba(78, 216, 166, .3); color: #bff3df; }
.sys.warn span { background: rgba(255, 92, 138, .1); border-color: rgba(255, 92, 138, .3); color: #ffd0dd; }
.divider { display: flex; align-items: center; gap: 10px; margin: 16px 4px; color: var(--faint); font-size: 11px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.row { display: flex; gap: 8px; margin-bottom: 6px; align-items: flex-end; animation: rise .32s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.row.bot { align-items: flex-start; }
.row.bot .av { width: 36px; height: 36px; border-radius: 13px; flex: none; }
.row.bot.cont .av { visibility: hidden; height: 0; }
.row .col { display: flex; flex-direction: column; gap: 4px; max-width: 78%; min-width: 0; }
.row .name { font-size: 12px; color: var(--sub); margin-left: 2px; }
.row.bot.cont .name { display: none; }
.row.bot.cont { margin-top: -2px; }
.line-wrap { display: flex; align-items: flex-end; gap: 6px; }
.row.me { justify-content: flex-end; }
.row.me .line-wrap { flex-direction: row-reverse; }
.bub { padding: 10px 13px; border-radius: 4px 18px 18px 18px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; position: relative; }
.row.bot.cont .bub { border-radius: 18px; }
.row.me .bub { background: var(--me); border: 0; border-radius: 18px 4px 18px 18px; color: #fff; }
.tm { font-size: 10px; color: var(--faint); white-space: nowrap; flex: none; }
.tm .rd { color: var(--gold); margin-right: 3px; font-weight: 700; }
.bub mark { background: linear-gradient(transparent 55%, rgba(255, 92, 138, .45) 55%); color: inherit; padding: 0 1px; }
.react { position: absolute; bottom: -10px; right: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; font-size: 12px; animation: pop .4s ease; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.tapback { position: absolute; z-index: 30; display: flex; gap: 2px; padding: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; box-shadow: var(--shadow); animation: pop .25s ease; }
.tapback button { font-size: 20px; width: 36px; height: 36px; border-radius: 50%; }
.tapback button:hover { background: rgba(255,255,255,.08); }

.typing .bub { display: inline-flex; gap: 4px; padding: 13px 14px; }
.typing .bub i { width: 6px; height: 6px; border-radius: 50%; background: var(--sub); animation: dot 1s infinite; }
.typing .bub i:nth-child(2) { animation-delay: .15s; }
.typing .bub i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 30% { transform: translateY(-4px); opacity: 1; } 0%, 60%, 100% { opacity: .35; } }

/* 스포일러 문질러 보기 */
.spoil { position: relative; cursor: pointer; user-select: none; }
.spoil .veil { position: absolute; inset: 0; border-radius: inherit; background-color: #2b2747; background-image: radial-gradient(rgba(255,255,255,.35) 1px, transparent 1.5px), radial-gradient(rgba(255,255,255,.2) 1px, transparent 1.5px); background-size: 6px 6px, 9px 9px; background-position: 0 0, 3px 4px; animation: grain 1.2s steps(4) infinite; display: grid; place-items: center; font-size: 12px; color: #fff; transition: opacity .6s; }
.spoil .veil span { background: rgba(14,13,24,.7); padding: 3px 10px; border-radius: 99px; }
@keyframes grain { to { background-position: 6px 3px, 0 8px; } }
.spoil.open .veil { opacity: 0; pointer-events: none; }

/* 등급 카드 (최초 프론트 '인연의 등급' 막대) */
.grade { width: 100%; background: linear-gradient(160deg, #221d42, #191630); border: 1px solid #332d5c; border-radius: 20px; padding: 16px; }
.grade small { color: var(--sub); font-size: 12px; }
.grade h4 { font-size: 24px; font-weight: 900; margin: 2px 0 10px; letter-spacing: -0.04em; }
.grade h4 em { font-style: normal; color: var(--pink); }
.grade .steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.grade .steps b { height: 7px; border-radius: 9px; background: #2e2a4d; }
.grade .steps b.on { background: var(--pink); }
.grade .lbl { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 6px; font-size: 10px; color: var(--faint); text-align: center; line-height: 1.3; }
.grade .lbl span.here { color: var(--text); font-weight: 800; }
.grade .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.grade .tags span { font-size: 12px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: rgba(0,0,0,.2); }

/* 장면 카드 (결과지 꼭지) */
.scene { width: 100%; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: border-color .3s, box-shadow .3s; }
.scene .art { height: 92px; display: grid; place-items: center; background: radial-gradient(circle at 50% 120%, rgba(123, 92, 250, .45), transparent 65%), #201d3a; position: relative; }
.scene .art .ic { font-size: 40px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); transition: transform .5s; }
.scene .art .no { position: absolute; left: 12px; top: 10px; font-size: 11px; font-weight: 800; color: var(--pink); background: rgba(14,13,24,.6); padding: 3px 8px; border-radius: 99px; }
.scene .art .new { position: absolute; right: 12px; top: 10px; font-size: 10px; font-weight: 900; color: #fff; background: var(--pink); padding: 2px 7px; border-radius: 99px; }
.scene .bd { padding: 12px 14px 14px; }
.scene .lb { font-size: 12px; color: var(--sub); }
.scene h5 { font-size: 17px; line-height: 1.38; font-weight: 800; margin: 2px 0 10px; word-break: keep-all; }
.scene .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.scene .acts button { padding: 9px 12px; border-radius: 12px; font-weight: 700; font-size: 13px; background: var(--surface-2); }
.scene .acts .go { background: var(--pink); color: #fff; animation: glow 2s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 5px rgba(255, 92, 138, .18); } }
.scene .lead { display: none; margin-top: 2px; padding: 12px; border-radius: 14px; background: rgba(255, 92, 138, .08); border: 1px dashed rgba(255, 92, 138, .4); font-weight: 700; line-height: 1.5; word-break: keep-all; }
.scene.open { border-color: rgba(255, 92, 138, .5); box-shadow: 0 0 0 1px rgba(255, 92, 138, .2); }
.scene.open .acts { display: none; }
.scene.open .lead { display: block; animation: rise .4s ease; }
.scene.open .art .ic { transform: scale(1.12) rotate(-6deg); }
.scene.open .new { display: none; }
.scene.locked .bd { position: relative; }
.scene.locked .cens { margin: 2px 0 10px; }
.scene.locked .cens p { filter: blur(5px); color: var(--sub); user-select: none; }
.scene.locked .cens small { color: var(--pink); font-size: 12px; }
.scene.locked .lockt { display: flex; align-items: center; gap: 6px; font-weight: 800; margin-bottom: 4px; }
.scene .unlock { width: 100%; padding: 12px; border-radius: 12px; background: var(--pink); color: #fff; font-weight: 800; }

/* 할매 메모 (근거 카드) */
.memo { width: 100%; border-radius: 16px; background: linear-gradient(170deg, #2a2450, #1e1a3a); border: 1px solid #3a3370; padding: 12px 14px; position: relative; }
.memo .hd { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--purple-2); font-weight: 800; margin-bottom: 8px; }
.memo table { width: 100%; border-collapse: collapse; font-size: 13px; }
.memo td { padding: 5px 0; border-top: 1px dashed rgba(255,255,255,.1); }
.memo td:first-child { color: var(--sub); width: 38%; }
.memo td:last-child { font-weight: 700; }
.memo .hand { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.12); font-size: 14px; color: var(--gold); font-weight: 700; font-style: italic; }
.memo.skel .ln { height: 10px; border-radius: 6px; background: rgba(255,255,255,.08); margin: 9px 0; animation: pulse 1s infinite; }
.memo.skel .ln:nth-child(3) { animation-delay: .2s; width: 80%; }
.memo.skel .ln:nth-child(4) { animation-delay: .4s; width: 60%; }
@keyframes pulse { 50% { opacity: .4; } }
.memo .pen { display: inline-block; animation: write .6s infinite alternate; }
@keyframes write { to { transform: translate(3px, -2px) rotate(8deg); } }
.why { width: 100%; }
.why summary { list-style: none; cursor: pointer; font-size: 12px; color: var(--purple-2); font-weight: 700; padding: 8px 12px; border-radius: 12px; background: rgba(123, 92, 250, .1); display: inline-flex; align-items: center; gap: 6px; }
.why summary::-webkit-details-marker { display: none; }
.why[open] summary { border-radius: 12px 12px 0 0; }
.why p { padding: 10px 12px; background: rgba(123, 92, 250, .1); border-radius: 0 12px 12px 12px; font-size: 13px; color: #d9d2ff; line-height: 1.55; word-break: keep-all; }

/* 되묻기 / 빠른 답장 */
.ask-btns { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 8px 44px; }
.ask-btns button { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--purple); color: var(--purple-2); font-weight: 700; font-size: 13px; background: rgba(123,92,250,.08); }
.ask-btns button:hover { background: rgba(123,92,250,.2); }
.ask-btns.done button { opacity: .35; pointer-events: none; }
.ask-btns.done button.pick { opacity: 1; background: var(--purple); color: #fff; }

/* 스티커: 다이컷 */
.sticker { width: 118px; height: 118px; position: relative; margin: 4px 0; }
.sticker .img { position: absolute; inset: 6px; border-radius: 30px; background: #fff url(../img/ragu.jpg) no-repeat center 28% / 118% auto; border: 4px solid #fff; box-shadow: 0 8px 18px rgba(0,0,0,.4); transform: rotate(-5deg); animation: stk .6s cubic-bezier(.2,1.6,.4,1) both; }
.sticker .word { position: absolute; right: -8px; top: -2px; background: var(--pink); color: #fff; font-weight: 900; font-size: 15px; padding: 4px 10px; border-radius: 12px 12px 12px 2px; transform: rotate(6deg); box-shadow: 0 6px 12px rgba(0,0,0,.3); animation: stk .6s .1s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stk { from { transform: scale(.2) rotate(-25deg); opacity: 0; } }

/* 상품 카드 */
.prod { width: 100%; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.prod .top { display: flex; gap: 12px; padding: 14px; align-items: center; background: linear-gradient(120deg, rgba(123,92,250,.25), rgba(255,92,138,.15)); }
.prod .top .ic { font-size: 34px; }
.prod .top small { color: var(--sub); font-size: 11px; display: block; }
.prod .top b { font-size: 15px; }
.prod p { padding: 10px 14px 0; font-size: 13px; color: #d4d0ea; word-break: keep-all; }
.prod .ft { display: flex; align-items: center; gap: 8px; padding: 12px 14px 14px; }
.prod .ft .badge { font-size: 11px; color: var(--mint); border: 1px solid rgba(78,216,166,.4); padding: 2px 7px; border-radius: 99px; }
.prod .ft .pr { font-weight: 800; }
.prod .ft button { margin-left: auto; padding: 8px 14px; border-radius: 12px; background: var(--purple); font-weight: 800; font-size: 13px; }

/* 결제·환불 카드 */
.pay { width: 100%; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); padding: 14px; }
.pay h6 { font-size: 15px; margin-bottom: 4px; }
.pay p { font-size: 13px; color: var(--sub); margin-bottom: 12px; }
.pay .bal { display: flex; justify-content: space-between; font-size: 13px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); margin-bottom: 10px; }
.pay .bal b { font-variant-numeric: tabular-nums; }
.pay .main { width: 100%; padding: 13px; border-radius: 14px; background: var(--pink); color: #fff; font-weight: 800; margin-bottom: 6px; }
.pay .sub { width: 100%; padding: 11px; border-radius: 14px; background: var(--surface-2); color: var(--sub); font-weight: 700; font-size: 13px; }
.pay .pk { display: none; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.pay.showpk .pk { display: grid; }
.pay .pk div { padding: 10px 6px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); text-align: center; font-size: 12px; }
.pay .pk div b { display: block; font-size: 14px; }
.pay .pk div em { font-style: normal; color: var(--mint); font-size: 11px; }
.pay .pk div.hot { border-color: var(--purple); }
.pay .more { display: block; margin: 8px auto 0; font-size: 12px; color: var(--purple-2); }
.pay.used { opacity: .5; pointer-events: none; }
.coin { position: absolute; z-index: 80; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 15%, #c6b6ff 40%, #ff8fb1 100%); box-shadow: 0 0 14px rgba(255, 143, 177, .8); pointer-events: none; transition: transform .7s cubic-bezier(.5,-0.3,.6,1), opacity .7s; }
.err { width: 100%; border-radius: 16px; background: rgba(255, 92, 138, .08); border: 1px solid rgba(255, 92, 138, .35); padding: 12px 14px; }
.err b { display: block; margin-bottom: 2px; }
.err p { font-size: 13px; color: #ffd0dd; margin-bottom: 10px; }
.err button { padding: 8px 14px; border-radius: 12px; background: var(--pink); color: #fff; font-weight: 800; font-size: 13px; }

/* 선택지 (누구 얘기야?) */
.pick { width: 100%; display: grid; gap: 6px; }
.pick button { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: left; font-weight: 700; }
.pick button:hover { border-color: var(--purple); }
.pick button i { width: 30px; height: 30px; border-radius: 11px; display: grid; place-items: center; font-style: normal; background: var(--surface-2); }
.pick button small { display: block; font-weight: 500; color: var(--faint); font-size: 12px; }
.pick.done button { opacity: .4; pointer-events: none; }
.pick.done button.sel { opacity: 1; border-color: var(--pink); }

/* 하단 빠른 답장 + 입력창 */
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--bg); min-height: 0; }
.quick:empty { display: none; }
.quick::-webkit-scrollbar { height: 0; }
.quick button { flex: none; padding: 8px 13px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; animation: rise .3s ease both; }
.quick button.hot { border-color: var(--pink); color: #ffd0dd; }
.quick button .n { color: var(--pink); font-weight: 900; margin-right: 4px; }
.composer { display: flex; align-items: center; gap: 8px; padding: 8px 10px 12px; background: var(--bg); }
.composer .plus { width: 36px; height: 36px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; color: var(--sub); flex: none; }
.composer .plus svg { width: 18px; height: 18px; }
.composer input { flex: 1; min-width: 0; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); padding: 0 14px; outline: none; }
.composer input:focus { border-color: var(--purple); }
.composer .send { height: 42px; padding: 0 16px; border-radius: 14px; background: var(--pink); font-weight: 800; flex: none; }
.composer .free { position: absolute; right: 12px; bottom: 62px; }

/* 사람 추가 시트 (한 화면 한 질문) */
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); z-index: 40; opacity: 0; pointer-events: none; transition: .25s; }
.sheet-bg.on { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; background: #000; border-radius: 26px 26px 0 0; padding: 14px 18px 22px; transform: translateY(105%); transition: transform .35s cubic-bezier(.2,.9,.3,1); border-top: 1px solid var(--line); }
.sheet.on { transform: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 9px; background: #444; margin: 0 auto 12px; }
.sheet .sbar { height: 4px; border-radius: 9px; background: #333; margin-bottom: 18px; overflow: hidden; }
.sheet .sbar b { display: block; height: 100%; background: var(--pink); width: 33%; transition: width .4s; }
.sheet .q { font-size: 21px; font-weight: 800; margin-bottom: 4px; }
.sheet .h { color: var(--sub); font-size: 13px; margin-bottom: 16px; }
.sheet .fld { width: 100%; height: 54px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); padding: 0 16px; font-size: 17px; outline: none; margin-bottom: 12px; }
.sheet .fld:focus { border-color: var(--purple); }
.sheet .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.sheet .opts button { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; }
.sheet .opts button.on { border-color: var(--pink); background: rgba(255,92,138,.12); }
.sheet .tog { display: flex; align-items: center; gap: 8px; color: var(--sub); font-size: 13px; margin-bottom: 14px; }
.sheet .tog input { accent-color: var(--pink); width: 18px; height: 18px; }
.sheet .note { font-size: 12px; color: var(--faint); margin-top: 10px; text-align: center; }
.step { display: none; }
.step.on { display: block; animation: rise .3s ease; }

/* 토스트 */
.toast { position: absolute; left: 50%; bottom: 120px; transform: translate(-50%, 20px); background: rgba(35, 32, 64, .97); border: 1px solid var(--line); padding: 10px 16px; border-radius: 14px; font-size: 13px; z-index: 70; opacity: 0; pointer-events: none; transition: .3s; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
