/* ============ Phone mockup ============ */
.phone-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 600px;
}
/* [D1] iPhone 18 Pro 비율 (애플 공식 사양: 본체 150.0 × 71.9mm, 6.3형 2622×1206)
   폭(--pw) 하나로 모든 치수를 비례 계산한다 — 크기는 .fvisual·.cs-visual·반응형에서 --pw 만 바꾼다.
   - 높이 = 폭 × 2.086 (150 / 71.9)
   - 베젤 = 폭 × 3.6% (≈2.6mm), 본체 모서리 = 폭 × 16.4%, 화면 모서리 = 본체 모서리 − 베젤
   - 다이나믹 아일랜드: 폭 13.49mm(18 Pro, 17 Pro 20.76mm 대비 약 35% 축소) = 본체 폭의 18.8%,
     높이 ≈ 6.2mm(본체 폭의 8.6%, 공개된 18 Pro 높이 수치가 없어 기존 모델 높이 유지), 화면 위에서 폭의 2.5%
   - 상태바: 시간·아이콘이 아일랜드 세로 중앙에 오도록 높이 = 2 × (2.5% + 4.3%) = 폭의 13.6% */
.phone {
  --pw: 302px;
  --bezel: calc(var(--pw) * 0.036);
  --island-w: calc(var(--pw) * 0.188);
  --island-h: calc(var(--pw) * 0.086);
  --island-top: calc(var(--pw) * 0.025);
  --sbar-h: calc(var(--pw) * 0.136);
  position: relative;
  width: var(--pw);
  height: calc(var(--pw) * 2.086);
  border-radius: calc(var(--pw) * 0.164);
  background: linear-gradient(160deg, #2a2748, #171430);
  padding: var(--bezel);
  box-shadow:
    var(--shadow),
    0 0 0 2px rgba(255, 255, 255, 0.06) inset;
  z-index: 3;
}
.phone::before {
  /* dynamic island (iPhone 18 Pro 크기) */
  content: '';
  position: absolute;
  top: calc(var(--bezel) + var(--island-top));
  left: 50%;
  transform: translateX(-50%);
  width: var(--island-w);
  height: var(--island-h);
  background: #05040b;
  border-radius: 999px;
  z-index: 6;
}
.phone .screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--pw) * 0.128);
  overflow: hidden;
  background: var(--base);
}
.phone.float {
  animation: float 6s ease-in-out infinite;
}
.phone.tilt {
  transform: rotate(-4deg);
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-18px) rotate(-4deg);
  }
}
.phone-badge {
  position: absolute;
  z-index: 5;
  background: rgba(20, 18, 37, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  animation: float 6.8s ease-in-out infinite;
}
.phone-badge .pill-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--grad);
  font-size: 16px;
}
.phone-badge b {
  font-size: 13px;
  color: #fff;
  display: block;
}
.phone-badge small {
  font-size: 11px;
  color: var(--muted);
}
.pb-1 {
  /* [B1] 아이폰 화면 속 노시헌 얼굴(그림 위쪽 가운데)을 가리지 않도록 코트·가슴 높이로 내림 (60 → 168px) */
  top: 168px;
  left: -42px;
}
.pb-2 {
  /* [D2][G3] 히어로 아이폰 왼쪽 아래 — [B1] 새 메시지 배지를 내린 만큼 함께 내려 간격 유지 */
  bottom: 56px;
  left: -48px;
  animation-delay: 0.8s;
}
/* [R2] 2단 레이아웃에서 .wrap(max 1200px)이 뷰포트를 꽉 채우는 구간(≤1248px)에서는
   오른쪽 여백이 24px뿐이라 right:-40px 배지가 화면 밖으로 18px 잘림 → stage 안쪽에 맞춤 */

/* ---- In-app screen bits (shared) ---- */
.app {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-size: 12px;
}
/* [D1] 상태바: 실제 iPhone 처럼 시간은 아일랜드 왼쪽 공간, 아이콘은 오른쪽 공간의 가운데에 두고
   아일랜드와 같은 세로 중앙선에 맞춘다. 화면 콘텐츠는 상태바 아래까지 깔린다(.app-scroll 참고). */
.sbar {
  flex: none;
  height: var(--sbar-h);
  display: grid;
  grid-template-columns: 1fr var(--island-w) 1fr;
  align-items: center;
  justify-items: center;
  padding: 0 calc(var(--pw) * 0.02);
  font-size: calc(var(--pw) * 0.043);
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 7;
}
.sbar .time {
  letter-spacing: 0.01em;
  line-height: 1;
}
.sbar svg {
  display: block;
  grid-column: 3;
  width: calc(var(--pw) * 0.19);
  height: auto;
}
.app-scroll {
  flex: 1;
  overflow: hidden;
  position: relative;
  /* [D1] 콘텐츠·배경을 상태바 밑까지 끌어올리고(실제 iPhone 처럼 띠가 생기지 않게),
     내용은 ::before 여백만큼 상태바 아래에서 시작 — .bleed 화면(캐릭터 그림)은 그림이 화면 맨 위부터 */
  margin-top: calc(var(--sbar-h) * -1);
}
.app-scroll::before {
  content: '';
  display: block;
  flex: none;
  height: var(--sbar-h);
}
.app-scroll.bleed::before {
  display: none;
}
/* 그림이 상태바 밑까지: 그림 높이에 상태바 높이를 더하고, 위쪽 버튼은 상태바 아래로 */
.app-scroll.bleed > .cd-hero:first-child {
  box-sizing: content-box;
  padding-top: var(--sbar-h);
}
.app-scroll.bleed .cd-topbar {
  top: calc(var(--sbar-h) + 4px);
}
.tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 600;
  margin-right: 5px;
}

/* screen: character detail */
.cd-hero {
  height: 270px;
  position: relative;
  background: radial-gradient(120% 90% at 60% 0%, #b23de0 0%, #7b0fc9 42%, #2b0187 100%);
}
.cd-hero .ghost {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 120px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.14);
}
.cd-topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}
.cd-round {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(20, 18, 37, 0.5);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
}
.cd-body {
  padding: 16px 16px 0;
  margin-top: -30px;
  position: relative;
  z-index: 2;
}
.cd-name {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cd-name .heart {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: rgba(20, 18, 37, 0.6);
  font-size: 15px;
  line-height: 1;
}
.cd-desc {
  color: var(--muted);
  margin: 8px 0 10px;
  font-size: 12px;
}
.cd-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-top: 12px;
}
.cd-card h5 {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  display: flex;
  justify-content: space-between;
}
.cd-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}
.scene {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
}
.scene .radio {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  flex: none;
}
.scene.active {
  border-color: var(--accent);
  background: rgba(248, 87, 180, 0.08);
}
.scene.active .radio {
  border-color: var(--accent);
  background: var(--accent);
}
.scene b {
  font-size: 12px;
  color: #fff;
  font-weight: 700;
}
.scene small {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
}

/* screen: chat */
/* 채팅 화면 배경(캐릭터 그림을 옅게) — [V2-1] pricing.css 삭제와 함께 이곳으로 옮김 */
.app-scroll.chat-bg {
  background:
    linear-gradient(180deg, rgba(29, 27, 65, 0.84), rgba(20, 18, 37, 0.965)),
    url('../../images/characters/noshiheon.jpg'); /* 기본값 — 화면마다 인라인으로 캐릭터 그림 지정 */
  background-size: cover;
  background-position: center 12%;
}
.ct-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--line);
}
.ct-top .ava {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 15px;
}
.ct-top .nm {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}
.ct-top .on {
  font-size: 10px;
  color: #5ce6a8;
}
.ct-mem {
  margin: 12px 14px;
  background: rgba(123, 15, 201, 0.16);
  border: 1px solid rgba(201, 164, 245, 0.3);
  border-radius: 12px;
  padding: 9px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10.5px;
  color: var(--violet-soft);
}
.bubbles {
  padding: 4px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bub {
  max-width: 80%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 11.5px;
  line-height: 1.55;
}
.bub.ai {
  background: rgba(255, 255, 255, 0.07);
  border-top-left-radius: 5px;
  align-self: flex-start;
  color: var(--ink);
}
.bub.me {
  background: var(--grad);
  color: #fff;
  border-top-right-radius: 5px;
  align-self: flex-end;
}
.bub .narr {
  color: var(--violet-soft);
  font-style: italic;
}
.ct-input {
  margin: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 11px;
}
.ct-input .send {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #fff;
}

/* ---- real character illustrations ---- */
.cd-hero.imgd {
  background-size: cover;
  background-position: center 14%;
}
.cd-hero.imgd .ghost {
  display: none;
}
.cd-hero.imgd::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(20, 18, 37, 0.5) 0%,
    rgba(20, 18, 37, 0.12) 22%,
    rgba(29, 27, 65, 0.5) 70%,
    var(--base) 100%
  );
}
.ava-img {
  background-size: cover;
  background-position: center 18%;
}
.char-art.imgd {
  background-size: cover;
  background-position: center 16%;
}
.char-art.imgd .big {
  display: none;
}
.char-art.imgd .heart {
  z-index: 2;
}
.char-art.imgd::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(20, 18, 37, 0) 48%, rgba(20, 18, 37, 0.42) 100%);
}
.pill-ico.img {
  background-image: url('../../images/characters/noshiheon.jpg'); /* [A2] 히어로 '새 메시지' 배지 = 노시헌 */
  background-size: cover;
  background-position: center 20%;
  font-size: 0;
}

/* ---- [V2] 캐릭터 상세 하단 고정 CTA (화면정의서 CHAR-001 "대화 시작하기") ---- */
.cd-cta {
  margin: 14px 0 16px;
  background: var(--grad);
  border-radius: 999px;
  padding: 11px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

/* ---- [V2] 채팅 안내 칩: 기억(.ct-mem 기본) · 첫 장면 · 페르소나 / 시스템 알림 ---- */
.ct-mem.ct-scene {
  background: rgba(248, 87, 180, 0.12);
  border-color: rgba(248, 87, 180, 0.32);
  color: var(--petal);
}
.ct-mem.ct-persona {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--ink);
}
.ct-sys {
  align-self: center;
  margin-top: 2px;
  background: rgba(248, 87, 180, 0.14);
  border: 1px solid rgba(248, 87, 180, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--petal);
}

/* Memory Collection 화면(03 추억)에서 쓰는 진행률 막대 */
.rel-bar {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.rel-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
}

/* ---- [V2] screen: Memory Collection (화면정의서 CHAT-004) ---- */
.mc {
  padding: 6px 16px 14px;
  /* [M5] 아래 안내(.mc-next)를 화면 아래에 붙여 아이폰·갤럭시 모두 같은 모양으로 끝나게 */
  display: flex;
  flex-direction: column;
}
.mc-head h4 {
  font-size: 16px;
  color: #fff;
}
.mc-head small {
  font-size: 10.5px;
  color: var(--muted);
}
.mc-count {
  margin: 12px 0 6px;
  font-size: 12px;
  color: var(--muted);
}
.mc-count b {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
}
.mc-grid {
  margin: 14px 0 12px;
  display: grid;
  /* [M5] minmax(0, 1fr): 긴 단계명이 칸을 넓히지 않도록 세 칸 폭을 같게 (1fr 만 쓰면 73.75 / 62.8 / 62.8px 로 들쭉날쭉) */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 8px;
}
.mc-item {
  min-width: 0;
}
.mc-item b {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-art {
  position: relative;
  aspect-ratio: 10 / 11; /* [M5] 3:4 → 10:11 — 3×3 과 아래 안내가 아이폰(가장 짧은 화면)에도 모두 들어가도록 */
  border-radius: 10px;
  background-size: cover;
  background-position: center 20%;
  border: 1px solid var(--line);
}
/* [M5] 남은 1장 안내 — 컬렉션 아래 빈 공간을 채우고 두 폰을 같은 구성으로 */
.mc-next {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}
.mc-next span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-next b {
  color: var(--ink);
}
.mc-item.new .mc-art {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.mc-item.new .mc-art::after {
  content: 'NEW';
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 8.5px;
  font-weight: 900;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  padding: 1px 4px;
}
/* 장면마다 색조를 달리해 같은 캐릭터라도 서로 다른 순간으로 보이게 한다 ([M3] 장면 아이콘은 삭제 — 프로필 그림 위에는 아무것도 얹지 않음) */
.mc-art.scene-a,
.mc-art.scene-b,
.mc-art.scene-c,
.mc-art.scene-d {
  overflow: hidden;
}
.mc-art[class*='scene-']::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.mc-art.scene-a::before {
  background: linear-gradient(180deg, rgba(255, 199, 230, 0.05), rgba(123, 15, 201, 0.35));
}
.mc-art.scene-b::before {
  background: linear-gradient(180deg, rgba(60, 90, 180, 0.45), rgba(20, 18, 37, 0.55));
}
.mc-art.scene-c::before {
  background: linear-gradient(180deg, rgba(160, 90, 30, 0.35), rgba(20, 18, 37, 0.6));
}
.mc-art.scene-d::before {
  background: linear-gradient(180deg, rgba(248, 87, 180, 0.3), rgba(255, 206, 92, 0.15));
}
