/* ===== 공유 CSS 변수 (alcove 로비 톤 v4 — v1 Elegant 따뜻한 아이보리 + 우아한 핑크 + Cormorant italic, 2026-04-25 v3 → v4) =====
 * 적용 범위: index / home / account / billing / select / session / persona / creator (이야기 시작 이전 8개 = L1+L2+L3)
 * 게임 내부(app/chat/room-content/timeline-content)는 각자 :root 오버라이드로 record-skin 톤 유지 — 손대지 않음.
 *
 * 변수명은 호환성 유지를 위해 그대로 두고 값만 v1 Elegant 팔레트로 매핑.
 * 다크 모드 분기는 html[data-theme="dark"] 셀렉터 (글로벌 헤더 드롭다운 토글이 documentElement 에 부착).
 * 신규 토큰: --color-accent-{hover,light,glow,2,2-light}, --shadow-{soft,hover}, --genre-*-{bg,text,border}.
 */
:root {
  /* === 배경 (v1 Elegant 따뜻한 아이보리) === */
  --color-bg: #faf8f4;                /* 메인 배경 (warm ivory) */
  --color-bg-soft: #fffefb;           /* (호환) 카드 표면 톤 */
  --color-bg-grad: #faf8f4;           /* (폐기) 그라데이션 → 단색 폴백. 분위기는 .ambient-orb 로 */

  /* === 액센트 (우아한 핑크 + 보조 퍼플) === */
  --color-accent: #c94c72;            /* 우아한 핑크 메인 */
  --color-accent-strong: #c94c72;     /* (호환) 단계 분리 폐기, hover 만 분리 */
  --color-accent-hover: #b03d61;      /* hover 단계 */
  --color-accent-light: #faeef2;      /* 연한 배경 (활성 nav pill, 배지 bg) */
  --color-accent-glow: rgba(201,76,114,0.27);  /* 카드 hover shadow */
  --color-accent-soft: #1c1917;       /* (호환) 본문 강조 텍스트 → t1 으로 통일 */
  --color-accent-grad: linear-gradient(135deg, #c94c72, #7040b0);  /* 타이틀/아바타 강조 */
  --color-accent2: #7040b0;           /* 보조 퍼플 (creator 진입점) */
  --color-accent2-light: #f0eaff;     /* 제작 섹션 light bg */
  --color-warm: #c94c72;              /* (호환) 살구톤 폐기 → 액센트로 매핑 */
  --color-sky: #7040b0;               /* (호환) 라일락 폐기 → 보조 퍼플로 매핑 */
  --color-purple: #7040b0;            /* (호환) → 보조 퍼플 */

  /* === 텍스트 위계 (v1 Elegant 갈색 3단계) === */
  --color-text-title:  #1c1917;       /* t1 — 메인 타이틀 / 강조 */
  --color-text-strong: #1c1917;       /* (호환) → t1 */
  --color-text:        #1c1917;       /* (호환) body 본문 → t1 */
  --color-text-muted:  #6b6560;       /* t2 — 부제·설명 */
  --color-text-quote:  #6b6560;       /* (호환) → t2 */
  --color-text-meta:   #a8a09a;       /* t3 — 메타·힌트 */

  /* === 카드 / 사이드바 (불투명 표면) === */
  --color-card:         #fffefb;      /* sf — 카드 배경 */
  --color-card-2:       #f0ebe2;      /* sf2 — 사이드바·스트립 */
  --color-sidebar:      #fffefb;      /* (호환) → sf */
  --color-sidebar-item: #faeef2;      /* (호환) → ac-light */

  /* === 태그(필) === */
  --color-pill-bg:          #faeef2;
  --color-pill-border:      rgba(201,76,114,0.20);
  --color-pill-text:        #c94c72;
  --color-pill-strong-bg:   rgba(255,255,255,0.92);   /* 다크 배너 위 흰 박스 */
  --color-pill-strong-text: #c94c72;

  /* === 다크 배너 (호환 폴백 — Featured 는 인라인 char.bg 우선) === */
  --color-banner-grad: linear-gradient(155deg, #1a2535 0%, #4a6b5a 100%);

  /* === 보더 === */
  --color-border:         #e5dfd6;    /* (호환) bd — 입력/버튼 보더 */
  --color-border-card:    #ede8e1;    /* bdl — 카드 외곽선 */
  --color-border-divider: #e5dfd6;    /* bd — 사이드바·헤더·section divider */
  --color-border-input:   #e5dfd6;    /* bd — 입력 필드 */
  --color-shadow:         rgba(0,0,0,0.10);   /* (호환) → soft shadow 기준 */

  /* === 그림자 (v1 Elegant soft shadow) === */
  --shadow-soft:  0 4px 20px rgba(0,0,0,0.10);
  --shadow-hover: 0 8px 28px var(--color-accent-glow);

  /* === 장르 태그 4종 (v1 Elegant Design Guide §05) === */
  --genre-romance-bg:    #fff0f3;
  --genre-romance-text:  #b83060;
  --genre-romance-border:#f5c0ce;
  --genre-noir-bg:       #fff5ee;
  --genre-noir-text:     #a05018;
  --genre-noir-border:   #f0d0a8;
  --genre-historical-bg:    #f3effe;
  --genre-historical-text:  #6a38a8;
  --genre-historical-border:#d0b8f0;
  --genre-sf-bg:    #eef4ff;
  --genre-sf-text:  #1a58a8;
  --genre-sf-border:#b8d0f0;

  /* === 폰트 (v1 Elegant 2종 위계 — 모노 폐기) === */
  --font-display: 'Cormorant Garamond', 'Noto Serif KR', serif;    /* 메인 타이틀 + 로고 (italic 600 직접 셀렉터에 부착) */
  --font-body:    'Noto Sans KR', sans-serif;                      /* 나머지 전부 */
  --font-mono:    'Cormorant Garamond', 'Noto Serif KR', serif;    /* (호환 폐기 — display 로 매핑. 잔존 사용처는 italic 변형 직접 부착) */
}

/* ===== 다크 모드 (v1 Elegant Redesign App.useEffect 다크 분기 따라감) =====
 * 적용: html[data-theme="dark"] (글로벌 헤더 드롭다운 다크 토글이 documentElement 에 부착).
 * 미적용: L4 게임 내부 4페이지 (자체 :root 오버라이드가 후속 로드되어 우선).
 * FOUC 방지: 각 L1-L3 페이지 <head> 에 인라인 스크립트로 localStorage.alcoveTheme 읽어 즉시 부착.
 */
html[data-theme="dark"] {
  --color-bg: #141210;
  --color-bg-soft: #1e1b17;
  --color-bg-grad: #141210;
  --color-card: #1e1b17;
  --color-card-2: #252019;
  --color-sidebar: #1e1b17;
  --color-sidebar-item: #2a2520;
  --color-border: #332e26;
  --color-border-card: #2a2520;
  --color-border-divider: #332e26;
  --color-border-input: #332e26;
  --color-text-title:  #f0ede8;
  --color-text-strong: #f0ede8;
  --color-text:        #f0ede8;
  --color-text-muted:  #9a9188;
  --color-text-quote:  #9a9188;
  --color-text-meta:   #605850;
  --color-pill-bg: #2a1f24;
  --color-pill-border: rgba(201,76,114,0.30);
  --color-shadow: rgba(0,0,0,0.40);
  --shadow-soft:  0 4px 20px rgba(0,0,0,0.40);
}

/* ===== Ambient 배경 ===== */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.05); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 관계 변화 플로팅 알림 ===== */
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  70% { opacity: 1; transform: translateY(-25px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-40px) scale(0.95); }
}

.relation-float {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Noto Sans KR', sans-serif;
  padding: 6px 16px;
  border-radius: 20px;
  pointer-events: none;
  /* M16: 컷신 오버레이(9999) 와 동일 z-index 충돌 분리 — 호감도 변화 토스트가 컷신 위에 항상 보이도록 10500 으로 격상 */
  z-index: 10500;
  animation: floatUp 1.8s ease-out forwards;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.relation-float.positive {
  color: #ff8fab;
  background: rgba(255,107,157,0.15);
  border: 1px solid rgba(255,107,157,0.3);
}
.relation-float.negative {
  color: #aaa;
  background: rgba(150,150,150,0.15);
  border: 1px solid rgba(150,150,150,0.3);
}

/* ===== 마일스톤 달성 플래시 ===== */
@keyframes milestoneFlash {
  0% { opacity: 0; }
  15% { opacity: 0.12; }
  100% { opacity: 0; }
}
@keyframes milestoneEmoji {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}
.milestone-flash {
  position: fixed;
  inset: 0;
  background: white;
  pointer-events: none;
  z-index: 10000;
  animation: milestoneFlash 0.8s ease-out forwards;
}
.milestone-emoji {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  pointer-events: none;
  z-index: 10001;
  animation: milestoneEmoji 2s ease-out forwards;
}

/* ===== UI 반짝임 (배너 → 관련 버튼 하이라이트) ===== */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(196,161,255,0.3); }
  50% { box-shadow: 0 0 12px rgba(196,161,255,0.8), 0 0 24px rgba(196,161,255,0.3); }
}
.glow-pulse {
  animation: glowPulse 1.5s ease-in-out infinite;
}

/* ===== 페이드인 애니메이션 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 페이지 전환 트랜지션 ===== */
body {
  animation: pageIn 0.4s ease-out;
}

body.page-exit {
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== 헤더 스타일 (session/persona) ===== */
header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid var(--color-border-divider);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--color-accent);
  letter-spacing: 0;
  text-decoration: none;
}

.back-btn {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s;
}

.back-btn:hover {
  color: var(--color-accent);
}

/* ===== 사이드 패널 공통 스타일 (상태창) =====
   2026-04-26: Direction B Reference 적용 — 드로어 안에서 베이지 카드로 분리. */
.side-section {
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--color-bg-card, transparent);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.side-section:last-child {
  margin-bottom: 0;
}

.location-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent-soft);
  margin-bottom: 2px;
}

.location-detail {
  font-size: 10px;
  color: var(--color-text-muted);
}

.location-time {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 3px;
}

/* ===== 사이드 패널 - 영역 구분선 ===== */
.side-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,161,255,0.3), transparent);
  margin: 4px 14px;
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11px;
  color: var(--color-text);
  line-height: 1.5;
}

.row-icon {
  flex-shrink: 0;
  font-size: 12px;
  margin-top: 1px;
}

.row-text {
  color: var(--color-text);
}

/* ===== 사이드 패널 - NPC 정보 (공통, .side-panel 하위로 스코핑) =====
   2026-04-26: Direction B Reference 적용 — 직접 rgba 대신 BOM 토큰(베이지+캐릭터 강조) 사용. */
.side-panel { width: 200px; border-left: 1px solid var(--color-border); display: flex; flex-direction: column; background: var(--bom-card-2); flex-shrink: 0; overflow-y: auto; }

.side-panel .character-info { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.side-panel .character-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--bom-card-2), var(--bom-pink-soft)); border: 1px solid var(--bom-line); display: flex; align-items: center; justify-content: center; font-size: 16px; overflow: hidden; padding: 0; }
.side-panel .character-name { font-size: calc(13px * var(--font-scale)); font-weight: 500; color: var(--bom-ink); }
.side-panel .character-status { font-size: calc(10px * var(--font-scale)); color: var(--bom-pink); }

.side-panel .stats-container { display: flex; flex-direction: column; gap: 6px; font-size: calc(11px * var(--font-scale)); color: var(--bom-ink); }
.side-panel .stat-row { display: flex; align-items: center; gap: 6px; }
.side-panel .stat-label { color: var(--color-text-muted); width: 28px; }
.side-panel .stat-bar { flex: 1; height: 6px; background: var(--bom-card-2); border: 1px solid var(--bom-line); border-radius: 3px; overflow: hidden; }
.side-panel .stat-fill { height: 100%; border-radius: 3px; }
.side-panel .stat-fill.love { background: linear-gradient(90deg, var(--bom-pink), var(--bom-pink-soft)); }
.side-panel .stat-fill.intimacy { background: linear-gradient(90deg, var(--bom-pink), var(--bom-pink-soft)); }
.side-panel .stat-fill.trust { background: linear-gradient(90deg, var(--bom-pink), var(--bom-pink-soft)); }
.side-panel .stat-value { width: 20px; text-align: right; color: var(--bom-pink); }

.side-panel .relationship-badge { margin-top: 10px; padding: 5px 10px; background: var(--bom-pink-bg); border: 1px solid var(--bom-line); border-radius: 12px; text-align: center; font-size: calc(11px * var(--font-scale)); color: var(--bom-pink); }

/* ===== 사이드 패널 - 추억 (공통) ===== */
.side-panel .section-title { font-size: calc(10px * var(--font-scale)); color: var(--color-text-muted); margin-bottom: 8px; }
.side-panel .memories-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.side-panel .memory-item { aspect-ratio: 1; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: calc(14px * var(--font-scale)); cursor: pointer; transition: transform 0.2s; }
.side-panel .memory-item:hover { transform: scale(1.1); }
.side-panel .memory-item.collected { background: var(--bom-pink-bg); border: 1px solid var(--bom-line); }
.side-panel .memory-item.collected.purple { background: var(--bom-card-2); border: 1px solid var(--bom-line); }
.side-panel .memory-item.locked { background: transparent; border: 1px dashed var(--color-border); font-size: calc(10px * var(--font-scale)); color: var(--color-text-faint); }

/* ===== 사이드 패널 - 페르소나 (공통) ===== */
.side-panel .persona-info { display: flex; align-items: center; gap: 8px; }
.side-panel .persona-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--bom-card-2), var(--bom-pink-soft)); border: 1px solid var(--bom-line); display: flex; align-items: center; justify-content: center; font-size: 12px; overflow: hidden; padding: 0; }
.side-panel .persona-name { font-size: calc(12px * var(--font-scale)); color: var(--bom-ink); }
.side-panel .persona-role { font-size: calc(10px * var(--font-scale)); color: var(--color-text-muted); }

/* ===== 사이드 패널 - outing 전용 (NPC 카드) ===== */
.side-panel .section-header { font-size: 10px; color: var(--color-text-muted); padding: 10px 14px 4px; font-weight: 600; }
.side-panel .npc-card { padding: 8px 14px 12px; }
.side-panel .npc-card .npc-name { font-size: 12px; font-weight: 600; color: var(--bom-pink); margin-bottom: 4px; }
.side-panel .npc-card .npc-action { font-size: 11px; color: var(--bom-ink); line-height: 1.5; margin-bottom: 6px; }
.side-panel .inner-toggle { background: var(--bom-pink-bg); border: 1px solid var(--bom-line); border-radius: 6px; padding: 3px 8px; font-size: 9px; color: var(--bom-pink); cursor: pointer; font-family: 'Noto Sans KR', sans-serif; transition: all 0.2s; }
.side-panel .inner-toggle:hover { background: var(--bom-pink-soft); }
.side-panel .npc-inner { display: none; margin-top: 6px; font-size: 10px; color: var(--bom-pink); font-style: italic; line-height: 1.4; background: var(--bom-pink-bg); border: 1px solid var(--bom-line); border-radius: 6px; padding: 4px 8px; }
.side-panel .npc-inner.show { display: block; }
/* #40: 인물 속마음 한마디 토글 (메인 NPC 단일 .show / 함께 있는 사람 컨테이너 .show-inner) */
.side-panel .side-section > .inner-toggle { display: inline-block; margin: 6px 0 4px; }
.side-panel .actor-inner { display: none; margin-top: 4px; font-size: 10px; color: var(--bom-pink); font-style: italic; line-height: 1.4; background: var(--bom-pink-bg); border: 1px solid var(--bom-line); border-radius: 6px; padding: 4px 8px; }
.side-panel #mainNpcInner.actor-inner.show { display: block; }
.side-panel #surroundingNpcList.show-inner .actor-inner { display: block; }
.side-panel .history-btn { width: 100%; background: var(--bom-card-2); border: 1px solid var(--bom-line); border-radius: 8px; padding: 8px; color: var(--color-text-muted); font-size: 11px; cursor: pointer; font-family: 'Noto Sans KR', sans-serif; transition: all 0.2s; }
.side-panel .history-btn:hover { background: var(--bom-pink-bg); border-color: var(--bom-pink); color: var(--bom-pink); }

/* ===== 기능 관리 패널 (공통) ===== */
.mgmt-section-title {
  font-size: 10px;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  margin-bottom: 0;
}
.mgmt-section-title:hover { color: var(--color-accent); }
.mgmt-chevron { font-size: 8px; transition: transform 0.2s; }
.mgmt-chevron.open { transform: rotate(90deg); }
.mgmt-body { display: none; margin-top: 8px; }
.mgmt-body.open { display: block; }
.model-toggle-row { display: flex; gap: 4px; }
.model-btn {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 5px 4px;
  color: var(--color-text-muted);
  font-size: 9px;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: all 0.15s;
}
.model-btn.active {
  background: rgba(196,161,255,0.2);
  border-color: var(--color-accent);
  color: var(--color-accent-soft);
}
.model-btn:hover:not(.active) {
  border-color: rgba(196,161,255,0.4);
  color: var(--color-text);
}
.mgmt-scroll-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 7px 8px;
  font-size: 9px;
  color: var(--color-text-muted);
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
  word-break: break-all;
  white-space: pre-wrap;
}
.mgmt-memory-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: var(--color-text-muted);
  margin-bottom: 3px;
}
.mgmt-memory-item:last-child { margin-bottom: 0; }
.mgmt-rel-mini { display: flex; gap: 4px; margin-bottom: 6px; font-size: 9px; }
.mgmt-rel-chip {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--color-text-muted);
}

/* ===== BGM 컨트롤 — app.html 헤더 우측 슬롯 + 드롭다운 팝오버 =====
   2026-05-14 이전: 우측 사이드드로어 7번째 섹션 (햄버거 후 스크롤 필요 → 사실상 안 보임)
   현재: 헤더 우측에 항상 노출, 곡명·재생 버튼 상시 표시, 곡 변경은 팝오버에 격리. */

/* 헤더 미니 슬롯 (시간배지 좌측) */
.bgm-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bgm-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 3px 8px;
  color: var(--color-text-soft);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: calc(11px * var(--font-scale));
  cursor: pointer;
  max-width: 200px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.bgm-title-btn:hover { color: var(--color-accent); border-color: var(--color-accent); }
.bgm-icon { font-size: 11px; line-height: 1; flex-shrink: 0; }
.bgm-header-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.bgm-header-title.has-track { color: var(--color-accent-soft); }

/* 재생/정지 버튼 — 헤더 슬롯과 팝오버 양쪽에서 공통 */
.bgm-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-soft);
  font-size: 11px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.2s;
}
.bgm-btn:hover { background: rgba(196,161,255,0.12); color: var(--color-accent); border-color: var(--color-accent); }
.bgm-btn.playing { background: rgba(196,161,255,0.18); border-color: var(--color-accent); color: var(--color-accent); }

/* 좁은 화면 — 곡명 숨김, 아이콘+▶만 노출 */
@media (max-width: 720px) {
  .bgm-header-title { display: none; }
  .bgm-title-btn { padding: 3px 6px; }
}

/* 헤더 아래로 떨어지는 드롭다운 팝오버 */
.bgm-popover {
  position: absolute;
  top: 52px; /* 헤더 높이 직후 */
  right: 16px;
  width: 280px;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  padding: 12px;
  z-index: 250; /* 헤더 위, 사이드드로어(200) 위, 가이드(1000) 아래 */
  font-family: 'Noto Sans KR', sans-serif;
}
.bgm-popover[hidden] { display: none; }

.bgm-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.bgm-tab {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 5px;
  font-size: 11px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  text-align: center;
  transition: all 0.15s;
}
.bgm-tab.active {
  background: rgba(196,161,255,0.18);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.bgm-tab:hover:not(.active) {
  border-color: rgba(196,161,255,0.4);
  color: var(--color-text);
}
.bgm-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 11px;
  color: var(--color-text);
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.bgm-input:focus { border-color: var(--color-accent); }
.bgm-input::placeholder { color: var(--color-text-muted); }
.bgm-file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.bgm-file-btn {
  background: rgba(196,161,255,0.12);
  border: 1px solid rgba(196,161,255,0.3);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  color: var(--color-accent);
  white-space: nowrap;
  transition: all 0.2s;
}
.bgm-file-label:hover .bgm-file-btn { background: rgba(196,161,255,0.2); }
.bgm-file-name {
  font-size: 10px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

/* 볼륨 슬라이더 — 팝오버 전용 행 */
.bgm-volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.bgm-vol-label { font-size: 12px; line-height: 1; }
.bgm-volume-mini {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0,0,0,0.08);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.bgm-volume-mini::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
}
.bgm-volume-mini::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
}

.bgm-now-playing {
  margin-top: 8px;
  font-size: 10px;
  color: var(--color-accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* BGM 유도 토스트 — 진입 시 미재생이면 헤더 BGM 슬롯 아래에 핀처럼 노출 */
.bgm-intro-toast {
  position: fixed;
  top: 52px;
  right: 16px;
  z-index: 260; /* 헤더(default) 위, 가이드(1000) 아래 */
  background: rgba(30, 24, 40, 0.96);
  color: #ede5d6;
  border: 1px solid rgba(196, 161, 255, 0.45);
  border-radius: 12px;
  padding: 10px 12px 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 14px 38px rgba(0,0,0,0.5), 0 0 0 1px rgba(196,161,255,0.15);
  font-family: 'Noto Sans KR', sans-serif;
  max-width: calc(100vw - 32px);
  animation: bgmIntroIn 0.32s ease-out;
}
.bgm-intro-toast[hidden] { display: none; }
.bgm-intro-arrow {
  position: absolute;
  top: -7px;
  right: 140px; /* 헤더 BGM 슬롯 중앙(시간배지 좌측) 가리킴 */
  width: 12px;
  height: 12px;
  background: rgba(30, 24, 40, 0.96);
  border-left: 1px solid rgba(196, 161, 255, 0.45);
  border-top: 1px solid rgba(196, 161, 255, 0.45);
  transform: rotate(45deg);
}
.bgm-intro-icon { font-size: 14px; line-height: 1; }
.bgm-intro-text { font-size: calc(13px * var(--font-scale)); }
.bgm-intro-cta {
  background: rgba(196,161,255,0.22);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: calc(12px * var(--font-scale));
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s;
}
.bgm-intro-cta:hover { background: rgba(196,161,255,0.38); }
.bgm-intro-close {
  background: none;
  border: none;
  color: rgba(237, 229, 214, 0.55);
  font-size: 18px;
  line-height: 1;
  width: 24px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  transition: color 0.18s;
}
.bgm-intro-close:hover { color: rgba(237, 229, 214, 1); }

@keyframes bgmIntroIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 모바일 좁은 화면 — 핀 화살표 위치 보정, 카드 폭 자동 */
@media (max-width: 720px) {
  .bgm-intro-toast { right: 8px; padding: 9px 10px; gap: 8px; }
  .bgm-intro-arrow { right: 60px; }
  .bgm-intro-text { font-size: calc(12px * var(--font-scale)); }
}


/* (구 .dash-guide-* 첫 진입 가이드 셀렉터들은 부모 단일 시스템 #appGuide 로 통합 후 일괄 제거됨, 2026-05-10 #9 follow-up) */

/* ===== select.html — 공간형(World Tile) UI ===== */
/* 색상/폰트는 :root 변수만 사용. 인라인 스타일 금지. */

.world-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: var(--color-bg-grad);
  transition: grid-template-columns 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.world-shell.is-collapsed { grid-template-columns: 0 1fr; }

/* ----- 토글 버튼 (사이드바 펼침/접힘) ----- */
.world-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 50;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-accent-strong);
  border: 1px solid var(--color-accent-strong);
  color: #fff;
  font-size: 18px;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.world-toggle:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

/* ----- 사이드바 ----- */
.world-side {
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--color-border-divider);
  padding: 1.4rem 1.2rem 1.5rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  overflow: hidden;
  min-width: 0;
}
.world-shell.is-collapsed .world-side {
  padding-left: 0;
  padding-right: 0;
  border-right: none;
}
.world-side__logo {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  color: var(--color-accent);
  letter-spacing: 0;
  text-decoration: none;
  padding-left: 48px; /* 토글 버튼 자리 확보 */
  white-space: nowrap;
}
.world-side__search {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--color-border-input);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  opacity: 0.85;
  cursor: not-allowed;
}
.world-side__section { display: flex; flex-direction: column; gap: 0.55rem; }
.world-side__label {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
}
.world-side__items { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.world-side__items--tags { flex-direction: row; flex-wrap: wrap; gap: 5px 6px; font-size: 11px; }
.world-side__item {
  color: var(--color-text-muted);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  font-weight: 500;
}
.world-side__item:hover { color: var(--color-text-strong); background: rgba(255,255,255,0.4); }
.world-side__item--active {
  color: #ffffff;
  background: var(--color-accent-strong);
  font-weight: 600;
}
.world-side__item--active:hover { color: #ffffff; background: var(--color-accent-strong); }
.world-side__item--more { color: var(--color-text-meta); font-size: 11px; padding: 4px 12px; }
.world-side__item--link { text-decoration: none; }
.world-side__tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--color-pill-bg);
  border: 1px solid var(--color-pill-border);
  color: var(--color-pill-text);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.world-side__tag:hover {
  color: var(--color-accent);
  background: rgba(201,48,112,0.18);
  border-color: rgba(201,48,112,0.35);
}
.world-side__author {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 12px;
  color: var(--color-text-muted);
}
.world-side__author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent-strong);
  border: 1px solid var(--color-pill-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
}
.world-side__account {
  margin-top: auto;
  padding: 1rem 1.1rem;
  background: rgba(252, 228, 207, 0.7);
  border: 1px solid var(--color-border-card);
  border-radius: 10px;
  font-size: 12px;
  color: var(--color-text);
  line-height: 1.7;
}
.world-side__account-link { color: var(--color-accent); cursor: pointer; font-weight: 500; }

/* ----- 메인 영역 ----- */
.world-main {
  padding: 1.5rem 2rem 3rem;
  min-width: 0;
}
.world-main__inner {
  max-width: 980px;
  margin: 0 auto;
  padding-top: 32px; /* 토글 버튼과 겹치지 않게 */
}
.world-main__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.5vw, 44px);
  font-weight: 500;
  color: var(--color-text-title);
  letter-spacing: 0.01em;
  margin: 0 0 0.4rem;
}
.world-main__subtitle {
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 300;
  margin-bottom: 2rem;
}
.world-list { display: flex; flex-direction: column; gap: 14px; }
.world-empty {
  padding: 2rem;
  border: 0.5px dashed var(--color-border);
  border-radius: 12px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ----- Featured tile (공개된 캐릭터) — 다크 배너 위에 흰 텍스트 ----- */
.world-featured {
  position: relative;
  height: 280px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--color-border-card);
  background: var(--color-banner-grad);
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.world-featured:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  box-shadow: 0 16px 44px rgba(201, 48, 112, 0.18);
}
.world-featured__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.world-featured__bg--fallback {
  background: var(--color-banner-grad);
}
.world-featured__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(26,16,48,0.85) 0%, rgba(42,24,69,0.45) 50%, rgba(58,26,80,0.05) 100%);
}
.world-featured__meta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.6rem 1.8rem;
  gap: 10px;
}
.world-featured__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.world-featured__prose {
  font-family: var(--font-display);
  font-size: 18px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.55;
  font-style: italic;
  max-width: 80%;
}
.world-featured__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
}
.world-featured__name {
  font-family: var(--font-display);
  font-size: 26px;
  color: #ffffff;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.world-featured__author {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
.world-featured__author span { color: rgba(255, 255, 255, 0.85); }

/* ----- Compact row (upcoming 캐릭터) ----- */
.world-row {
  background: var(--color-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border-card);
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  min-height: 88px;
}
.world-row--upcoming {
  opacity: 0.55;
  pointer-events: none;
}
.world-row__main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.world-row__head {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.world-row__name {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--color-text-title);
  letter-spacing: 0.02em;
  font-weight: 500;
}
.world-row__tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.world-row__prose {
  font-size: 13px;
  color: var(--color-text-quote);
  font-family: var(--font-display);
  font-style: italic;
  line-height: 1.55;
}
.world-row__aside {
  text-align: right;
  line-height: 1.7;
}
.world-row__author { font-size: 11px; color: var(--color-text-muted); }
.world-row__release {
  font-size: 11px;
  color: var(--color-accent-soft);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ----- 카드 위 태그 칩 ----- */
/* featured(다크 배너 위): 진한 핫핑크 + 흰 글자 */
.world-tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 100px;
  background: var(--color-pill-strong-bg);
  border: 1px solid var(--color-pill-strong-bg);
  color: var(--color-pill-strong-text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* row(밝은 카드 안): 연한 핫핑크 + 보라 글자 */
.world-row .world-tag {
  background: var(--color-pill-bg);
  border-color: var(--color-pill-border);
  color: var(--color-pill-text);
  font-size: 10.5px;
  padding: 3px 9px;
  font-weight: 500;
}

/* ----- 반응형 (≤768px) ----- */
@media (max-width: 768px) {
  .world-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .world-shell:not(.is-collapsed) .world-side {
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem 1rem;
    border-right: none;
    border-bottom: 0.5px solid var(--color-border);
  }
  .world-shell.is-collapsed .world-side {
    display: none;
  }
  .world-side__logo { padding-left: 52px; }
  .world-side__items--tags { gap: 4px 5px; }

  .world-main { padding: 1rem 1rem 2rem; }
  .world-main__inner { padding-top: 36px; }
  .world-featured { height: 220px; }
  .world-featured__meta { padding: 1.2rem 1.3rem; }
  .world-featured__prose { font-size: 15px; max-width: 100%; }
  .world-featured__name { font-size: 19px; }
}

/* ===================== Cutscene Trigger (공용 FAB) ===================== */
/* 선톡 배너(#notifBanner) 와 겹치지 않도록 우하단 배치. */
.cutscene-trigger {
  position: fixed;
  right: 20px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(196,161,255,0.28), rgba(196,161,255,0.14));
  border: 1px solid rgba(196,161,255,0.5);
  border-radius: 999px;
  color: var(--color-accent-soft, #e3d4ff);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  z-index: 30;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(196,161,255,0.1) inset;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cutscene-trigger:hover,
.cutscene-trigger:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(196,161,255,0.38), rgba(196,161,255,0.2));
  box-shadow: 0 10px 26px rgba(0,0,0,0.5), 0 0 0 1px rgba(196,161,255,0.25) inset;
  outline: none;
}
.cutscene-trigger:focus-visible { box-shadow: 0 10px 26px rgba(0,0,0,0.5), 0 0 0 2px rgba(196,161,255,0.7); }
.cutscene-trigger-icon { font-size: 15px; }
.cutscene-trigger-label { white-space: nowrap; letter-spacing: 0.02em; }

/* ===================== Cutscene Input Modal ===================== */
.cutscene-input-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cutscene-input-modal.open { display: flex; opacity: 1; }
.cutscene-input-dim {
  position: absolute;
  inset: 0;
  background: rgba(8,4,18,0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.cutscene-input-box {
  position: relative;
  width: 90%;
  max-width: 460px;
  background: #1e1828;
  border: 1px solid rgba(196,161,255,0.3);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.cutscene-input-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-accent-soft, #e3d4ff);
}
.cutscene-input-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  line-height: 1.55;
}
.cutscene-input-text {
  width: 100%;
  min-height: 140px;
  max-height: 240px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(196,161,255,0.25);
  border-radius: 12px;
  color: rgba(255,255,255,0.92);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}
.cutscene-input-text:focus { border-color: rgba(196,161,255,0.55); }
.cutscene-input-actions { display: flex; gap: 10px; justify-content: flex-end; }
.cutscene-input-cancel,
.cutscene-input-submit {
  padding: 9px 18px;
  border-radius: 10px;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cutscene-input-cancel {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.78);
}
.cutscene-input-cancel:hover { background: rgba(255,255,255,0.14); }
.cutscene-input-submit {
  background: rgba(196,161,255,0.26);
  border: 1px solid rgba(196,161,255,0.45);
  color: var(--color-accent-soft, #e3d4ff);
}
.cutscene-input-submit:hover { background: rgba(196,161,255,0.38); }

/* ===================== Cutscene Overlay ===================== */
@keyframes cutsceneBodyUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cutsceneFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.cutscene-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  background: #000;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.cutscene-overlay.open { display: block; }
.cutscene-overlay.ready { opacity: 1; }
.cutscene-overlay.closing { opacity: 0; transition: opacity 0.45s ease; }

.cutscene-bg {
  position: absolute;
  inset: 0;
  /* 이미지를 잘리지 않도록 화면에 맞춤(letterbox). 빈 영역은 검은 배경(.cutscene-overlay) 유지. */
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #000;
  opacity: 0.3;
  filter: blur(2px) saturate(0.85);
  transition: opacity 1.2s ease;
}
.cutscene-overlay.ready .cutscene-bg { opacity: 0.3; }

/* 키워드 컷씬 배경 영상 (Veo). DOM 순서상 .cutscene-bg 위·.cutscene-vignette 아래에
   놓여 stacking = bg < video < vignette < .cutscene-inner(z-index:1). 명시 z-index 불필요.
   기본 display:none — JS(resetCutsceneVideo/applyCutsceneVideo)가 토글.
   .show 로 정적 이미지(0.3)보다 살짝 또렷한 0.5 까지 페이드 인 (텍스트 가독성 유지). */
.cutscene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}
.cutscene-video.show { opacity: 0.5; }

.cutscene-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 18%, rgba(0,0,0,0) 82%, rgba(0,0,0,0.9) 100%),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}

.cutscene-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  box-sizing: border-box;
}

.cutscene-timetag {
  font-family: 'Noto Serif KR', 'Noto Sans KR', serif;
  font-size: 18px;
  letter-spacing: 0.22em;
  color: rgba(255,240,220,0.82);
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  margin-bottom: 28px;
  opacity: 0;
  animation: cutsceneFadeIn 0.6s ease 0.3s forwards;
}

.cutscene-body {
  max-width: 720px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  font-family: 'Noto Serif KR', 'Noto Sans KR', serif;
  font-size: 15px;
  line-height: 2;
  color: rgba(255,248,238,0.92);
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  white-space: pre-wrap;
  opacity: 0;
  padding: 0 6px;
}
.cutscene-body.ready {
  animation: cutsceneBodyUp 0.8s ease forwards;
}
/* 스크롤바 은은하게 */
.cutscene-body::-webkit-scrollbar { width: 6px; }
.cutscene-body::-webkit-scrollbar-thumb { background: rgba(196,161,255,0.3); border-radius: 3px; }

/* 키워드 컷씬 = 만남 채팅과 동일 문체 (나레이션/대사 블록, 한 번에 표시) */
.cutscene-narr { margin: 0 0 0.9em; }
.cutscene-narr:last-child { margin-bottom: 0; }
.cutscene-line { margin: 0 0 0.9em; }
.cutscene-line:last-child { margin-bottom: 0; }
.cutscene-speaker {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(196,161,255,0.85);
  margin-bottom: 2px;
}
.cutscene-dlg { color: #fff; font-weight: 500; }
.cutscene-dlg::before { content: '\201C'; }
.cutscene-dlg::after { content: '\201D'; }

.cutscene-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  animation: cutsceneFadeIn 0.5s ease 0.2s forwards;
}
.cutscene-loading-text {
  font-size: 13px;
  color: rgba(255,240,220,0.75);
  letter-spacing: 0.08em;
}

.cutscene-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: cutsceneFadeIn 0.6s ease 0.5s forwards;
}

.cutscene-close,
.cutscene-save {
  padding: 10px 22px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  color: rgba(255,240,220,0.88);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cutscene-save {
  background: rgba(255,182,193,0.12);
  border-color: rgba(255,182,193,0.38);
  color: rgba(255,220,228,0.95);
}
.cutscene-close:hover,
.cutscene-save:hover { background: rgba(255,255,255,0.16); transform: translateY(-1px); }
.cutscene-save:hover { background: rgba(255,182,193,0.22); }
.cutscene-close:disabled,
.cutscene-save:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ============================================================
 * v1 Elegant 시그니처 컴포넌트 (2026-04-25 v4 도입)
 * 출처: docs/raw/Alcove v1 Export/Alcove Redesign.html
 * 적용 범위: L1+L2+L3 8 페이지 (이야기 시작 이전).
 * 캐릭터별 색은 인라인 --card-bg / --card-glow 로 주입.
 * ============================================================ */

/* C1. PortraitCard — 2:3 캐릭터 카드 (Redesign L167-230) */
.alcove-portrait-card {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 18px;
  overflow: hidden;
  background: var(--card-bg, #1a2535);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}
.alcove-portrait-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 24px 56px var(--card-glow-shadow, rgba(58,122,154,0.33));
}
.alcove-portrait-card__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 20%, var(--card-glow-soft, rgba(58,122,154,0.31)) 0%, transparent 65%);
}
.alcove-portrait-card__silhouette {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 75%; height: 70%; pointer-events: none;
  background: linear-gradient(to top, var(--card-glow-faint, rgba(58,122,154,0.09)), transparent);
  border-radius: 60% 60% 0 0;
}
.alcove-portrait-card__bottom {
  position: absolute; bottom: 0; left: 0; right: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0) 100%);
  padding: 52px 14px 14px;
}
.alcove-portrait-card__tags {
  display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 5px;
}
.alcove-portrait-card__tag {
  font-size: 10px; padding: 1px 7px; border-radius: 100px;
  background: var(--card-tag-bg, rgba(58,122,154,0.16));
  color: var(--card-glow, #3a7a9a);
  border: 1px solid var(--card-tag-border, rgba(58,122,154,0.31));
  white-space: nowrap;
}
.alcove-portrait-card__name {
  color: #fff; font-family: var(--font-display); font-size: 17px; font-weight: 500;
}
.alcove-portrait-card__meta {
  color: rgba(255,255,255,0.5); font-size: 11px;
}
.alcove-portrait-card__cta {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: var(--card-glow-cta, rgba(58,122,154,0.08));
  opacity: 0; transition: opacity 0.2s;
}
.alcove-portrait-card:hover .alcove-portrait-card__cta { opacity: 1; }
.alcove-portrait-card__cta-pill {
  background: rgba(255,255,255,0.92);
  color: var(--card-glow, #3a7a9a);
  font-family: var(--font-display);
  font-size: 12px; font-weight: 500;
  padding: 7px 18px; border-radius: 100px;
}

/* C2. Hero Ambient Background (Landing) */
.alcove-hero-ambient {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 72% 28%, rgba(201,76,114,0.13) 0%, transparent 65%),
    radial-gradient(ellipse 45% 40% at 18% 72%, rgba(112,64,176,0.10) 0%, transparent 60%);
}
.alcove-hero-dotgrid {
  position: absolute; inset: 0; opacity: 0.35; pointer-events: none;
  background-image: radial-gradient(circle, rgba(201,76,114,0.18) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* C3. Scroll Bob Hint */
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(5px); }
}
.alcove-scroll-bob {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--color-text-meta);
  font-size: 11px; letter-spacing: 0.08em;
  animation: bob 2s ease-in-out infinite;
  pointer-events: none;
}

/* C4. Featured Banner (Select) */
.alcove-featured {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 36px 44px;
  background: var(--feat-bg, var(--color-banner-grad));
  cursor: pointer;
  transition: transform 0.2s ease;
}
.alcove-featured:hover { transform: scale(1.005); }
.alcove-featured__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 80% 50%, var(--feat-glow-shadow, rgba(58,122,154,0.21)), transparent 60%);
}
.alcove-featured__quote {
  font-family: var(--font-display);
  font-size: 14px; font-style: italic; font-weight: 300;
  color: rgba(255,255,255,0.65); margin-bottom: 10px;
}
.alcove-featured__name {
  color: #fff; font-family: var(--font-display);
  font-size: 26px; font-weight: 500;
}
.alcove-featured__meta {
  color: rgba(255,255,255,0.50); font-size: 13px; margin-top: 4px;
}

/* C5. Quick Action Card (Home) */
.alcove-action-card {
  position: relative; overflow: hidden;
  background: var(--color-card);
  border: 1px solid var(--color-border-card);
  border-radius: 18px;
  padding: 28px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.alcove-action-card:hover {
  border-color: var(--ac, var(--color-accent));
  box-shadow: 0 8px 28px var(--ac-glow18, rgba(201,76,114,0.09));
}
.alcove-action-card__glow {
  position: absolute; top: 0; right: 0;
  width: 130px; height: 130px; pointer-events: none;
  background: radial-gradient(circle at top right, var(--ac-light, var(--color-accent-light)) 0%, transparent 65%);
}
.alcove-action-card__icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--ac-light, var(--color-accent-light));
  color: var(--ac, var(--color-accent));
  border: 1px solid var(--ac-border, rgba(201,76,114,0.16));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 16px;
}
.alcove-action-card__title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 400;
  color: var(--color-text-title);
  margin-bottom: 7px;
}
.alcove-action-card__desc {
  color: var(--color-text-muted);
  font-size: 13px; line-height: 1.7;
  margin-bottom: 22px;
}
.alcove-action-card__cta {
  color: var(--ac, var(--color-accent));
  font-size: 13px; font-weight: 600;
}

/* C6. Btn (Primary / Ghost) */
.alcove-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 26px; border-radius: 100px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  border: none;
}
.alcove-btn--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 6px 20px rgba(201,76,114,0.27);
}
.alcove-btn--primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}
.alcove-btn--ghost {
  background: var(--color-card);
  color: var(--color-text-title);
  border: 1px solid var(--color-border-divider);
}
.alcove-btn--ghost:hover { background: var(--color-card-2); }

/* C7. Genre Tag */
.alcove-genre-tag {
  display: inline-block;
  padding: 2px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.02em; white-space: nowrap;
  border: 1px solid;
  margin: 3px 3px 3px 0;
}
.alcove-genre-tag--small { padding: 1px 8px; font-size: 10px; }
.alcove-genre-tag--romance    { background: var(--genre-romance-bg);    color: var(--genre-romance-text);    border-color: var(--genre-romance-border); }
.alcove-genre-tag--noir       { background: var(--genre-noir-bg);       color: var(--genre-noir-text);       border-color: var(--genre-noir-border); }
.alcove-genre-tag--historical { background: var(--genre-historical-bg); color: var(--genre-historical-text); border-color: var(--genre-historical-border); }
.alcove-genre-tag--sf         { background: var(--genre-sf-bg);         color: var(--genre-sf-text);         border-color: var(--genre-sf-border); }

/* C8. Sidebar (Select) */
.alcove-side {
  width: 210px; flex-shrink: 0;
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-border-divider);
  padding: 28px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.alcove-side__label {
  font-size: 10px; font-weight: 700;
  color: var(--color-text-meta);
  letter-spacing: 0.1em;
  margin-bottom: 8px; padding-left: 10px;
}
.alcove-side__item {
  background: none; border: none; cursor: pointer;
  padding: 8px 12px; border-radius: 10px; text-align: left;
  font-family: var(--font-body);
  font-size: 13.5px; font-weight: 400;
  color: var(--color-text-muted);
}
.alcove-side__item:hover { background: var(--color-card-2); }
.alcove-side__item.is-active {
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-weight: 600;
}

/* C9. Profile Hero (Session) */
.alcove-profile-hero {
  position: relative; overflow: hidden;
  height: 220px;
  background: var(--feat-bg, var(--color-banner-grad));
}
.alcove-profile-hero__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 65% 70% at 65% 40%, var(--feat-glow-strong, rgba(58,122,154,0.33)), transparent 60%);
}
.alcove-profile-hero__fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 90px; pointer-events: none;
  background: linear-gradient(to top, var(--color-bg), transparent);
}
.alcove-profile-hero__quote {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -54%);
  text-align: center; padding: 0 60px; width: 100%;
  font-family: var(--font-display);
  font-size: 15px; font-style: italic; font-weight: 300;
  color: rgba(255,255,255,0.72); line-height: 1.9;
}
.alcove-profile-avatar {
  width: 80px; height: 80px; border-radius: 22px; flex-shrink: 0;
  background: var(--card-bg, var(--color-banner-grad));
  border: 4px solid var(--color-bg);
  position: relative; overflow: hidden;
  box-shadow: 0 10px 28px var(--card-glow-strong, rgba(58,122,154,0.27));
}
.alcove-profile-avatar__glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 30%, var(--card-glow, #3a7a9a) 0%, transparent 70%);
}

/* ============================================================
 * Status Panel — Record Skin v2 (2026-04-25)
 * 시맨틱 클래스 (.status-*) 는 스킨 무관 글로벌. 색·배경·테두리는 변수만 스킨별로 오버라이드.
 * 스킨 4벌:
 *   default — alcove 로비 정체성 톤 (통통튀는 파스텔, 봄툰 광고 풍)
 *   siwoo   — 밤의 작업실 (차콜 모노 + 종이 결)
 *   hajun   — 봄 햇살 (따뜻한 햇빛 + 둥근 카드)
 *   dohyun  — 식물 비밀 (세이지 그린 + 흙 톤)
 * 매핑 SSOT: docs/03_record-skin-system.md §9-1
 * ============================================================ */

/* ===== Direction B Reference (2026-04-26) — record-skin BOM 토큰 일괄 베이지 베이스 통일 =====
 * 모든 캐릭터에서 카드/잉크/보더/노랑/민트/스카이/퍼플 = 동일 베이지 시스템.
 * 캐릭터별 차이는 강조색(--bom-pink + --color-accent) 만 — nav dot / 버튼 / 강조 라벨 등에 적용.
 * 결과: status-* 카드들은 record-skin 무관 베이지 통일, 강조 포인트만 캐릭터 색.
 *
 * 베이지 베이스 (모든 캐릭터 공통):
 *   card/card-2/line/ink/yellow/mint/sky-soft/sky-bg/purple-bg/sky/purple = 베이지·갈색 텍스트
 * 캐릭터별 강조:
 *   default = 갈색 #8a6a4a / siwoo = 블루-그레이 #5a6a8a / hajun = 피치-로즈 #c08070 / dohyun = 세이지 #6a8a5a
 */

/* default — Direction B 베이지 베이스 + 갈색 강조 */
body[data-record-skin="default"] {
  --bom-card: #f0ebe2;
  --bom-card-2: #ede8df;
  --bom-line: #d8cfc0;
  --bom-ink: #3a3028;
  --bom-yellow: #ede8df;
  --bom-mint: #c8b89a;
  --bom-sky: #b0a890;
  --bom-sky-soft: #ede8df;
  --bom-sky-bg: #f0ebe2;
  --bom-purple: #b0a890;
  --bom-purple-bg: #ede8df;
  /* 캐릭터 강조 — 갈색
     --accent-source: 라이트/다크 모드 자동 파생을 위한 단일 진실. 신규 제작자 스킨도 이 변수만 정의하면 됨. */
  --accent-source: #8a6a4a;
  --bom-pink: var(--accent-source);
  --bom-pink-soft: #c8b89a;
  --bom-pink-bg: #ede8df;
  --color-accent: var(--accent-source);
  --color-accent-hover: #6a4a30;
}

/* siwoo — 베이지 베이스 + 차가운 블루-그레이 강조 (밤의 작업실) */
body[data-record-skin="siwoo"] {
  --bom-card: #f0ebe2;
  --bom-card-2: #ede8df;
  --bom-line: #d8cfc0;
  --bom-ink: #3a3028;
  --bom-yellow: #ede8df;
  --bom-mint: #c8b89a;
  --bom-sky: #b0a890;
  --bom-sky-soft: #ede8df;
  --bom-sky-bg: #f0ebe2;
  --bom-purple: #b0a890;
  --bom-purple-bg: #ede8df;
  /* 캐릭터 강조 — 블루-그레이 */
  --accent-source: #5a6a8a;
  --bom-pink: var(--accent-source);
  --bom-pink-soft: #a8b0c0;
  --bom-pink-bg: #e6e8ec;
  --color-accent: var(--accent-source);
  --color-accent-hover: #3a4a6a;
}

/* hajun — 베이지 베이스 + 따뜻한 피치-로즈 강조 (봄 햇살) */
body[data-record-skin="hajun"] {
  --bom-card: #f0ebe2;
  --bom-card-2: #ede8df;
  --bom-line: #d8cfc0;
  --bom-ink: #3a3028;
  --bom-yellow: #ede8df;
  --bom-mint: #c8b89a;
  --bom-sky: #b0a890;
  --bom-sky-soft: #ede8df;
  --bom-sky-bg: #f0ebe2;
  --bom-purple: #b0a890;
  --bom-purple-bg: #ede8df;
  /* 캐릭터 강조 — 피치-로즈 */
  --accent-source: #c08070;
  --bom-pink: var(--accent-source);
  --bom-pink-soft: #e0b8aa;
  --bom-pink-bg: #f5e6df;
  --color-accent: var(--accent-source);
  --color-accent-hover: #a06050;
}

/* dohyun — 베이지 베이스 + 세이지 그린 강조 (식물 비밀) */
body[data-record-skin="dohyun"] {
  --bom-card: #f0ebe2;
  --bom-card-2: #ede8df;
  --bom-line: #d8cfc0;
  --bom-ink: #3a3028;
  --bom-yellow: #ede8df;
  --bom-mint: #c8b89a;
  --bom-sky: #b0a890;
  --bom-sky-soft: #ede8df;
  --bom-sky-bg: #f0ebe2;
  --bom-purple: #b0a890;
  --bom-purple-bg: #ede8df;
  /* 캐릭터 강조 — 세이지 그린 */
  --accent-source: #6a8a5a;
  --bom-pink: var(--accent-source);
  --bom-pink-soft: #b0c4a0;
  --bom-pink-bg: #e6ebde;
  --color-accent: var(--accent-source);
  --color-accent-hover: #4a6a3a;
}

/* ===== L4 인게임 다크 모드 (2026-04-26) =====
 * 트리거: html[data-theme="dark"] (로비 글로벌 헤더 토글 + app.html 사이드 드로어 토글이 같은 localStorage.alcoveTheme 키 공유).
 * 적용: app.html / room-content.html / chat.html / timeline-content.html (각 인라인 :root 가 같은 셀렉터로 L4 다크 베이스 토큰 재정의해서 로비 다크 토큰을 덮어씀).
 * 캐릭터 강조색: --accent-source 기준 color-mix 자동 파생. 신규 제작자 스킨이 --accent-source 만 정의하면 라이트/다크 둘 다 자동 대응. */
html[data-theme="dark"] body[data-record-skin] {
  --color-accent: color-mix(in oklab, var(--accent-source) 60%, #fff 40%);
  --color-accent-hover: color-mix(in oklab, var(--accent-source) 45%, #fff 55%);
  --bom-pink: color-mix(in oklab, var(--accent-source) 60%, #fff 40%);
  --bom-pink-soft: color-mix(in oklab, var(--accent-source) 75%, #000 25%);
  --bom-pink-bg: color-mix(in oklab, var(--accent-source) 14%, var(--color-bg-card) 86%);
}

/* --bom-yellow-bg 폴백 — 4 스킨에 정의되지 않아 transparent 로 떨어지던 문제 (2026-05-10 #3) */
body[data-record-skin] { --bom-yellow-bg: var(--bom-yellow); }
html[data-theme="dark"] body[data-record-skin] { --bom-yellow-bg: var(--color-bg-card); }

/* RELATIONS 탭 + PC 주위 인물 추가 버튼 — 다크 모드 가독성 보강 (2026-05-10 #3)
   라이트 모드에서는 --bom-yellow-bg(폴백:--bom-yellow) 베이지 톤으로 유지,
   다크 모드에서는 다크 카드 + 밝은 텍스트로 대비 확보. */
html[data-theme="dark"] .status-rel-add-btn {
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: 2px 2px 0 var(--color-border);
}
html[data-theme="dark"] .status-rel-add-btn:hover { background: var(--color-bg-soft); }

/* ===== L4 인게임 폰트 프리셋 (2026-04-26) =====
 * 트리거: body[data-font-preset="..."] (record-skin 과 직교 — 색은 캐릭터, 폰트는 분위기)
 * 적용: app.html / room-content.html / timeline-content.html (각 인라인 :root 의 --font-* 를 덮어씀)
 * 추천: 캐릭터의 record.fontPreset 가 기본값. 유저는 사이드 드로어에서 덮어씀(localStorage.userFontPreset)
 * 폴백: data-font-preset 미지정 시 각 페이지 :root 의 delicate 정의가 그대로 쓰임 */
body[data-font-preset="delicate"] {
  --font-display: 'DM Serif Display', serif;
  --font-serif: 'Noto Serif KR', serif;
  --font-sans: 'Noto Sans KR', sans-serif;
}
body[data-font-preset="standard"] {
  --font-display: 'Noto Sans KR', sans-serif;
  --font-serif: 'Noto Sans KR', sans-serif;
  --font-sans: 'Noto Sans KR', sans-serif;
}
body[data-font-preset="round"] {
  --font-display: 'Gowun Dodum', sans-serif;
  --font-serif: 'Gowun Batang', serif;
  --font-sans: 'Gowun Dodum', sans-serif;
}
body[data-font-preset="kitsch"] {
  --font-display: 'Black Han Sans', sans-serif;
  --font-serif: 'Jua', sans-serif;
  --font-sans: 'Gaegu', sans-serif;
}

.status-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,138,168,0.15) 0%, transparent 35%),
    radial-gradient(circle at 88% 28%, rgba(109,178,255,0.16) 0%, transparent 38%),
    radial-gradient(circle at 50% 92%, rgba(181,148,255,0.14) 0%, transparent 40%),
    linear-gradient(135deg, var(--bom-pink-bg) 0%, var(--bom-sky-bg) 50%, var(--bom-purple-bg) 100%);
  color: var(--bom-ink);
  font-family: 'Noto Sans KR', sans-serif;
  overflow: hidden;
}
/* 픽셀 데코: 별/하트/게임패드 — 배경에 흩뿌림 */
.status-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    /* 별 */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path fill='%23ffe066' stroke='%231a1426' stroke-width='1' d='M7 1l1.6 4h4.4l-3.5 2.6 1.3 4.4L7 9.5 3.2 12l1.3-4.4L1 5h4.4z'/></svg>"),
    /* 하트 */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path fill='%23ff8aa8' stroke='%231a1426' stroke-width='1' d='M7 12 L2 6.5 Q1 4 3 3 Q5 2 7 4.5 Q9 2 11 3 Q13 4 12 6.5 Z'/></svg>"),
    /* 게임패드 작은 점 */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><circle cx='6' cy='6' r='3' fill='%236db2ff' stroke='%231a1426' stroke-width='1'/></svg>");
  background-position: 8% 14%, 92% 22%, 16% 78%, 84% 68%, 70% 12%, 30% 86%;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  pointer-events: none;
  opacity: 0.85;
  z-index: 0;
}

/* 상단 탭 바 — 픽셀 윈도우 풍 */
.status-tab-bar {
  display: flex;
  gap: 8px;
  padding: 14px 20px 0;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.status-tab {
  background: var(--bom-card);
  border: 2px solid var(--bom-line);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 10px 18px 8px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--bom-ink);
  cursor: pointer;
  position: relative;
  transition: transform 0.12s, background 0.12s;
  box-shadow: 2px 0 0 var(--bom-line);
}
.status-tab:hover {
  background: var(--bom-pink-soft);
  transform: translateY(-2px);
}
.status-tab.active {
  background: var(--bom-pink);
  color: #fff;
  transform: translateY(-2px);
}
.status-tab.active::after { display: none; }

/* 탭 컨텐츠 페인 — 윈도우 카드 풍 */
.status-pane {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 22px;
  position: relative;
  z-index: 1;
  background: var(--bom-card);
  border: 2px solid var(--bom-line);
  border-radius: 0 14px 14px 14px;
  margin: 0 18px 18px;
  box-shadow: 4px 4px 0 var(--bom-line);
}
.status-pane.active { display: block; }

/* 공통 카드 */
.status-card {
  background: var(--bom-card-2);
  border: 1.5px solid var(--bom-line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 2px 2px 0 var(--bom-line);
}
.status-card-lbl {
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bom-pink);
}
.status-empty {
  font-size: 12px;
  color: rgba(42,31,61,0.45);
  text-align: center;
  padding: 8px 0;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 500;
}
.status-emotion-dot {
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--bom-line);
  border-radius: 50%;
  display: inline-block;
}
.status-rel-lbl {
  color: var(--bom-pink);
  padding-left: 10px;
  border-left: 2px solid var(--bom-pink);
  font-size: 11px;
  font-weight: 700;
}

/* === RELATIONS 탭 — 모든 NPC 통합 카드 (메인 + 보조 동일 형식) === */
.status-rel-cards {
  display: grid;
  /* §1-0 #43 — 고정 300px min 이 INFO 가용폭보다 크면 트랙이 컨테이너를 넘어
     RELATIONS 탭만 비대칭 좌측 여백 발생. min(100%,300px) 로 좁으면 1열 100%, 넓으면 멀티열. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  align-items: start;
}
.status-rel-npc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bom-card);
  border: 1px solid var(--bom-line);
  border-radius: 10px;
  padding: 12px;
}
.status-rel-npc-card.is-main {
  border-color: var(--bom-pink);
  box-shadow: 0 0 0 1px var(--bom-pink);  /* 비대칭 3px 그림자 → 부드러운 1px ring */
}
.status-rel-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-rel-card-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1.5px solid var(--bom-line);
  background: linear-gradient(135deg, var(--bom-pink-bg), var(--bom-sky-bg));
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.status-rel-card-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.status-rel-card-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--bom-ink);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-rel-main-flag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: var(--bom-pink);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}
.status-rel-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.status-rel-section-lbl {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--bom-pink);
}
.status-rel-section-list {
  list-style: disc;
  padding-left: 18px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.status-rel-section-list li {
  font-size: 12px;
  color: var(--bom-ink);
  line-height: 1.5;
}
/* §1-0 #35 후속 — 보조 NPC '캐릭터 정보' 본문 + 썸네일 없는 head */
.status-rel-info {
  font-size: 12px;
  color: var(--bom-ink);
  line-height: 1.5;
}
.status-rel-card-head--noimg { min-height: 28px; }
.status-npc-name {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--bom-ink);
}
.status-npc-rel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--bom-ink);
  font-weight: 500;
}

/* === RELATIONS 탭 — PC 칩 + 관계 추가 헤더 === */
.status-rel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
/* .status-rel-pc-chip / .status-rel-pc-avatar / .status-rel-pc-name / .status-rel-pc-tagline 셀렉터:
   페르소나 칩이 상태 패널로 이관되며 제거됨 (2026-05-10) */
.status-rel-add-btn {
  background: var(--bom-yellow-bg);
  border: 1.5px solid var(--bom-line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 800;
  color: var(--bom-ink);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.04em;
  box-shadow: 2px 2px 0 var(--bom-line);
  flex-shrink: 0;
}
.status-rel-add-btn:hover { background: var(--bom-pink-soft); }
/* .status-rel-pc-detail / .status-rel-pc-detail-row: 상태 패널로 이관됨 (2026-05-10) */
.status-rel-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  background: var(--bom-card);
  border: 1.5px solid var(--bom-line);
  border-radius: 8px;
  padding: 10px;
}
.status-rel-add-form input {
  flex: 1 1 140px;
  min-width: 120px;
  border: 1.5px solid var(--bom-line);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  background: var(--bom-card-2);
  color: var(--bom-ink);
}
.status-rel-add-form button {
  border: 1.5px solid var(--bom-line);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  background: var(--bom-pink-soft);
  color: var(--bom-ink);
}

/* 호감/친밀/신뢰 3축 바 — 비트맵 게이지 풍 */
.status-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.status-stat-row {
  display: grid;
  grid-template-columns: 40px 1fr 28px;
  align-items: center;
  gap: 10px;
}
.status-stat-key {
  font-size: 10px;
  font-weight: 800;
  color: var(--bom-pink);
  letter-spacing: 0.1em;
}
.status-stat-bar {
  height: 10px;
  background: var(--bom-card-2);
  border: 1.5px solid var(--bom-line);
  border-radius: 4px;
  overflow: hidden;
}
.status-stat-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--bom-pink) 0%, var(--bom-purple) 50%, var(--bom-sky) 100%);
  transition: width 0.4s ease;
}
.status-stat-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--bom-ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* === RELATIONS 탭 === */
.status-rel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.status-card-wide { grid-column: 1 / -1; }

.status-promise-counts {
  display: flex;
  gap: 18px;
}
.status-promise-cnt {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.status-cnt-num {
  font-size: 28px;
  font-weight: 900;
  color: var(--bom-pink);
  font-variant-numeric: tabular-nums;
}
.status-cnt-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--bom-ink);
  letter-spacing: 0.18em;
}
.status-promise-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.status-promise-row {
  font-size: 12px;
  color: var(--bom-ink);
  padding-left: 14px;
  position: relative;
  font-weight: 500;
}
.status-promise-row::before {
  content: '♥';
  position: absolute;
  left: 0;
  color: var(--bom-pink);
  font-size: 10px;
}

.status-milestone-progress {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.status-milestone-of {
  font-size: 11px;
  font-weight: 700;
  color: var(--bom-purple);
  letter-spacing: 0.1em;
}
.status-milestone-next {
  font-size: 12px;
  font-weight: 600;
  color: var(--bom-ink);
}

/* MEMORIES 폴라 (RELATIONS 탭) */
.status-memories {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.status-memory-pola {
  aspect-ratio: 3/4;
  background: var(--bom-card);
  border: 1.5px solid var(--bom-line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: none;
}

/* === CHARACTER 탭 (구 ARCHIVE — 풀 펼침, 잠금 폐기) === */
.status-archive {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.status-archive-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-archive-portrait {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1.5px solid var(--bom-line);
  background: var(--bom-card-2);
  object-fit: cover;
  box-shadow: none;
  flex-shrink: 0;
}
.status-archive-name {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--bom-ink);
}
.status-archive-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.status-arch-card {
  background: var(--bom-card);
  border: 1.5px solid var(--bom-line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 2px 2px 0 var(--bom-line);
}
.status-arch-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.status-arch-line {
  font-size: 12px;
  color: var(--bom-ink);
  line-height: 1.55;
}
.status-arch-line b {
  font-weight: 800;
  color: var(--bom-pink);
}
.status-arch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.status-arch-tag {
  background: var(--bom-pink-soft);
  border: 1.5px solid var(--bom-line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bom-ink);
}
.status-arch-cutscene-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.status-arch-cutscene-card {
  background: var(--bom-yellow-bg);
  border: 1.5px solid var(--bom-line);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bom-ink);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 2px 2px 0 var(--bom-line);
}
.status-arch-cutscene-card:hover { background: var(--bom-pink-soft); }

/* === WORLD 탭 — 6슬롯 그리드 (콘텐츠 3축 (3) 세계 활성) ===
   시맨틱 클래스 — 외피(skin) 분기는 body[data-record-skin] 셀렉터로 추후 확장.
   슬롯: ① map  ② time  ③ events  ④ feed  ⑤ places  ⑥ lore  + people 보조 */
.status-world-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-areas:
    "map time   time"
    "map places events"
    "feed feed  feed";
  gap: 12px;
  align-items: stretch;
}
.status-world-map        { grid-area: map; }
.status-world-time       { grid-area: time; }
.status-world-places-v2  { grid-area: places; }
.status-world-events     { grid-area: events; }
.status-world-feed       { grid-area: feed; }

/* ① WORLD MAP — 좌측 (우측 3 row 합 높이로 spanning) */
.status-world-map {
  display: flex;
  flex-direction: column;
}
.status-world-map-figure {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 280px;
  background: var(--bom-card);
  border: 1.5px solid var(--bom-line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 2px 2px 0 var(--bom-line);
}
.status-world-map-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.status-world-map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(42,31,61,0.45);
  font-size: 12px;
  font-weight: 600;
}
.status-world-map-cap {
  font-size: 11px;
  color: var(--bom-ink);
  font-weight: 500;
  line-height: 1.5;
  opacity: 0.78;
}

/* ② TIME / WEATHER */
.status-world-time-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-world-time-icon {
  font-size: 28px;
  line-height: 1;
}
.status-world-time-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.status-world-time-row {
  font-size: 12px;
  font-weight: 700;
  color: var(--bom-ink);
}
.status-world-time-row + .status-world-time-row {
  font-weight: 500;
  opacity: 0.78;
}
.status-world-time-note {
  font-size: 11px;
  color: var(--bom-ink);
  opacity: 0.7;
  line-height: 1.5;
  border-top: 1px dashed var(--bom-line);
  padding-top: 8px;
}

/* ③ EVENTS — 달력 형식. 우측 row stretching 으로 좌측 MAP 높이 맞춤 */
.status-world-events {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.status-world-events .status-world-event-list {
  flex-shrink: 0;
}
.status-world-event-cal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.status-world-event-cal-month {
  font-size: 11px;
  font-weight: 800;
  color: var(--bom-pink);
  letter-spacing: 0.12em;
  text-align: center;
}
.status-world-event-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 44px));
  gap: 2px;
  justify-content: center;
}
.status-world-event-cal-head {
  font-size: 9px;
  font-weight: 800;
  color: var(--bom-pink);
  text-align: center;
  padding: 2px 0;
  letter-spacing: 0.04em;
}
.status-world-event-cal-cell {
  aspect-ratio: 1 / 1;
  background: var(--bom-card-2);
  border: 1px solid var(--bom-line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--bom-ink);
  position: relative;
  cursor: default;
}
.status-world-event-cal-cell.empty {
  background: transparent;
  border-color: transparent;
}
.status-world-event-cal-cell.has-event {
  background: var(--bom-pink-soft);
  border-color: var(--bom-pink);
  color: var(--bom-ink);
  font-weight: 800;
  cursor: help;
}
.status-world-event-cal-cell.today {
  outline: 1.5px solid var(--bom-pink);
  outline-offset: -1.5px;
  font-weight: 800;
}
.status-world-event-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.status-world-event-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 8px;
  background: var(--bom-card);
  border: 1px solid var(--bom-line);
  border-radius: 5px;
}
.status-world-event-date {
  font-weight: 800;
  color: var(--bom-pink);
  min-width: 38px;
}
.status-world-event-title {
  flex: 1;
  color: var(--bom-ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-world-event-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--bom-ink);
  background: var(--bom-yellow);
  border: 1px solid var(--bom-line);
  border-radius: 999px;
  padding: 2px 6px;
}

/* ④ WORLD FEED — source별 그룹 (NEWS · COMMUNITY · NOTICE 카드 안에 2~3줄) */
.status-world-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}
.status-world-feed-group {
  background: var(--bom-card);
  border: 1.5px solid var(--bom-line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: none;
}
.status-world-feed-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--bom-line);
}
.status-world-feed-icon { font-size: 13px; }
.status-world-feed-source {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--bom-pink);
}
.status-world-feed-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--bom-ink);
  line-height: 1.55;
  font-weight: 500;
}
.status-world-feed-tag {
  font-size: 9px;
  font-weight: 700;
  color: var(--bom-ink);
  background: var(--bom-sky-soft);
  border: 1px solid var(--bom-line);
  border-radius: 999px;
  padding: 1px 6px;
  flex-shrink: 0;
  margin-top: 2px;
}
.status-world-feed-text {
  flex: 1;
  min-width: 0;
}

/* ⑤ PLACES (정사각 썸네일 타일) — 우측 row stretching 으로 좌측 MAP 높이 맞춤 */
.status-world-places-v2 {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.status-world-places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 150px));
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  justify-content: start;
}
.status-world-place-card {
  aspect-ratio: 1 / 1;
  background: var(--bom-card);
  border: 1.5px solid var(--bom-line);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: none;
  overflow: hidden;
}
.status-world-place-card[data-src="visit"] {
  border-style: dashed;
  background: var(--bom-pink-bg);
}
.status-world-place-thumb {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 6px;
  border: 1.5px solid var(--bom-line);
  background: var(--bom-card-2);
  overflow: hidden;
}
.status-world-place-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.status-world-place-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex-shrink: 0;
}
.status-world-place-type {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--bom-pink);
  text-transform: uppercase;
}
.status-world-place-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--bom-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-world-place-desc { display: none; }

/* SURROUNDING PEOPLE (CHARACTER 탭 안에서 사용) */
.status-world-people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.status-world-person {
  background: var(--bom-card);
  border: 1.5px solid var(--bom-line);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.status-world-person-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--bom-ink);
}
.status-world-person-role {
  font-size: 10px;
  font-weight: 500;
  color: var(--bom-pink);
}
.status-world-person-desc {
  font-size: 10px;
  color: var(--bom-ink);
  opacity: 0.72;
  line-height: 1.45;
}

/* ===== 랜딩/about 공용 키프레임 (이전엔 index.html / about.html 양쪽 인라인 중복) ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== 공용 알림 UI (AlcoveUI) — js/core.js 의 toast/confirm/prompt 전용 =====
 * 적용 범위: 전 페이지(common.css 는 account 포함 모든 HTML 이 로드).
 * 색은 토큰(--color-*) 사용 → 로비 :root / 게임 record-skin :root / 다크모드 자동 적응.
 * 단, .alc-toast 는 임의 배경 위에 떠도 가독성이 보장돼야 하므로 다크 필 고정(구 #appToast 동일 — 회귀 아님).
 * z-index 계층 (역전 금지):
 *   토스트 9500  <  다이얼로그 백드롭 9800  <  에러 리치 모달(openModelFailureModal 등) 99999(유지)
 * 애니메이션 규약: docs/01_animations.md 참조 (alc* 키프레임 신규 등록).
 */
.alc-toast {
  position: fixed;
  top: 56px;
  left: 50%;
  z-index: 9500;
  max-width: calc(100vw - 32px);
  background: rgba(30, 24, 40, 0.95);
  color: #f4eefb;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  pointer-events: none;
  text-align: center;
  display: none;
  transform: translate(-50%, -6px);
  opacity: 0;
}
.alc-toast.show { display: block; animation: alcToastIn 0.25s ease-out forwards; }
.alc-toast.hide { display: block; animation: alcToastOut 0.3s ease-in forwards; }
@keyframes alcToastIn {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes alcToastOut {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, -6px); }
}

.alc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 14, 28, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
}
.alc-backdrop.show { animation: alcBackdropIn 0.18s ease-out forwards; }
.alc-backdrop.hide { animation: alcBackdropOut 0.2s ease-in forwards; }
@keyframes alcBackdropIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes alcBackdropOut { from { opacity: 1; } to { opacity: 0; } }

.alc-dialog {
  width: 100%;
  max-width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  box-sizing: border-box;
  background: var(--color-card);
  color: var(--color-text-title);
  border: 1px solid var(--color-border-card);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-soft);
}
.alc-backdrop.show .alc-dialog { animation: alcDialogIn 0.22s cubic-bezier(0.2, 0.8, 0.3, 1) forwards; }
@keyframes alcDialogIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.alc-dialog-title {
  font-size: calc(16px * var(--font-scale, 1));
  font-weight: 700;
  color: var(--color-text-title);
  margin-bottom: 8px;
}
.alc-dialog-msg {
  font-size: calc(14px * var(--font-scale, 1));
  color: var(--color-text-muted);
  line-height: 1.55;
  white-space: pre-line;
}
.alc-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
  padding: 10px 12px;
  font-size: calc(14px * var(--font-scale, 1));
  color: var(--color-text-title);
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border-input);
  border-radius: 8px;
  outline: none;
}
.alc-input:focus { border-color: var(--color-accent); }
.alc-dialog-err {
  margin-top: 8px;
  font-size: calc(12px * var(--font-scale, 1));
  color: #d64545;
}
.alc-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}
.alc-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
}
.alc-btn-primary { background: var(--color-accent); color: #fff; }
.alc-btn-primary:hover { background: var(--color-accent-hover); }
.alc-btn-danger { background: #d64545; color: #fff; }
.alc-btn-danger:hover { filter: brightness(0.92); }
.alc-btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.alc-btn-ghost:hover { background: var(--color-accent-light); }

/* ===== 게임 내부 팝업 — Direction B 베이지·세리프 스코프 오버라이드 =====
 * 적용: body[data-app-scope="ingame"] (app/room-content/timeline-content/chat 4 게임 페이지 한정).
 * 로비는 이 속성 미부착 → 위 기본 .alc-* 규칙(2644-2776) 그대로 (불변 — 하드 게이트).
 * 호스트 :root 비의존: chat.html 처럼 게임 토큰이 불완전/퍼플 오염된 페이지에서도 동일 렌더 위해
 *   var() 대신 Direction B 명시 리터럴 (라이트 + html[data-theme="dark"] 다크 2벌)을 쓴다.
 * 값 출처: timeline-content.html :root (라이트 14-39 / 다크 42-54).
 *   다크 accent #bfa78c = docs §2-4-1 color-mix(#8a6a4a 60%, #fff 40%) 목표 hex.
 * z-index/애니메이션/font-scale/레이아웃은 기본 규칙 상속 — 무변경.
 */

/* --- AlcoveUI 토스트/다이얼로그 (라이트) --- */
body[data-app-scope="ingame"] .alc-toast {
  background: #f0ebe2;
  color: #3a3028;
  border: 1px solid #d8cfc0;
  font-family: 'Noto Serif KR', serif;
  box-shadow: 0 8px 24px rgba(58,48,40,0.18);
}
body[data-app-scope="ingame"] .alc-backdrop { background: rgba(58,48,40,0.45); }
body[data-app-scope="ingame"] .alc-dialog {
  background: #f0ebe2;
  color: #3a3028;
  border: 1px solid #d8cfc0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(58,48,40,0.16);
}
body[data-app-scope="ingame"] .alc-dialog-title {
  color: #3a3028;
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
}
body[data-app-scope="ingame"] .alc-dialog-msg {
  color: #5a4838;
  font-family: 'Noto Serif KR', serif;
}
body[data-app-scope="ingame"] .alc-input {
  background: #f5f0e8;
  color: #3a3028;
  border: 1px solid #d8cfc0;
  border-radius: 10px;
  font-family: 'Noto Serif KR', serif;
}
body[data-app-scope="ingame"] .alc-input:focus { border-color: #8a6a4a; }
body[data-app-scope="ingame"] .alc-btn {
  border-radius: 10px;
  font-family: 'Noto Serif KR', serif;
}
body[data-app-scope="ingame"] .alc-btn-primary { background: #8a6a4a; color: #f5f0e8; }
body[data-app-scope="ingame"] .alc-btn-primary:hover { background: #6a4a30; }
body[data-app-scope="ingame"] .alc-btn-ghost { color: #8a7a6a; border-color: #d8cfc0; }
body[data-app-scope="ingame"] .alc-btn-ghost:hover { background: #ede8df; }
/* .alc-dialog-err / .alc-btn-danger 는 의도적 무변경 (#d64545 시스템 위험색) */

/* --- AlcoveUI (다크) --- */
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-toast,
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-dialog {
  background: #2a231c;
  color: #ede5d6;
  border: 1px solid #3a3328;
}
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-backdrop { background: rgba(0,0,0,0.55); }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-dialog-title { color: #ede5d6; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-dialog-msg { color: #c8bca8; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-input {
  background: #1a1612;
  color: #ede5d6;
  border: 1px solid #3a3328;
}
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-input:focus { border-color: #bfa78c; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-btn-primary { background: #bfa78c; color: #1a1612; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-btn-primary:hover { background: #a88f72; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-btn-ghost { color: #8a8070; border-color: #3a3328; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-btn-ghost:hover { background: #221d18; }

/* ===== ⚙️ 설정 모달 (.alc-settings) — Direction B 베이지·세리프 =====
 * story.js injectSettingsModal 이 색·폰트 인라인을 제거하고 이 클래스들에 위임.
 * 인라인은 레이아웃(display/flex/gap/width/max-*/overflow/position)만 잔존.
 */

/* --- 설정 모달 (라이트) --- */
body[data-app-scope="ingame"] #settingsModal {
  background: rgba(58,48,40,0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
body[data-app-scope="ingame"] .alc-settings {
  background: #f0ebe2;
  border: 1px solid #d8cfc0;
  border-radius: 10px;
  padding: 24px;
  width: 92%;
  max-width: 540px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
body[data-app-scope="ingame"] .alc-settings .alc-set-title {
  font-size: calc(14px * var(--font-scale, 1));
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  color: #3a3028;
}
body[data-app-scope="ingame"] .alc-settings .alc-set-label,
body[data-app-scope="ingame"] .alc-settings .alc-set-sub {
  font-size: calc(11px * var(--font-scale, 1));
  color: #8a7a6a;
  font-family: 'Noto Serif KR', serif;
}
body[data-app-scope="ingame"] .alc-settings .alc-set-divider { height: 1px; background: #d8cfc0; }
body[data-app-scope="ingame"] .alc-settings .alc-set-box {
  background: #f5f0e8;
  border: 1px solid #d8cfc0;
  border-radius: 10px;
  padding: 10px;
  font-size: calc(11px * var(--font-scale, 1));
  color: #3a3028;
  font-family: 'Noto Serif KR', serif;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.6;
  white-space: pre-wrap;
}
body[data-app-scope="ingame"] .alc-settings .alc-set-switch {
  border-radius: 999px;
  border: 1px solid #d8cfc0;
  background: #ede8df;
  transition: background 0.2s, border-color 0.2s;
}
body[data-app-scope="ingame"] .alc-settings .alc-set-switch.is-on { background: #8a6a4a; border-color: #8a6a4a; }
body[data-app-scope="ingame"] .alc-settings .alc-set-thumb { border-radius: 50%; background: #f0ebe2; }
body[data-app-scope="ingame"] .alc-settings .alc-set-select {
  font-family: 'Noto Serif KR', serif;
  font-size: calc(11px * var(--font-scale, 1));
  color: #3a3028;
  background: #f5f0e8;
  border: 1px solid #d8cfc0;
  border-radius: 10px;
  padding: 5px 8px;
}
body[data-app-scope="ingame"] .alc-settings .alc-set-btn,
body[data-app-scope="ingame"] .alc-settings .model-btn {
  background: #ede8df;
  border: 1px solid #d8cfc0;
  border-radius: 10px;
  color: #8a7a6a;
  font-size: calc(11px * var(--font-scale, 1));
  font-family: 'Noto Serif KR', serif;
  cursor: pointer;
  transition: all 0.2s;
}
body[data-app-scope="ingame"] .alc-settings .alc-set-btn:hover,
body[data-app-scope="ingame"] .alc-settings .model-btn:hover { background: #e3ddd0; }
body[data-app-scope="ingame"] .alc-settings .scale-btn.active,
body[data-app-scope="ingame"] .alc-settings .model-btn.active {
  background: #e8dcc9;
  border-color: #8a6a4a;
  color: #8a6a4a;
}
body[data-app-scope="ingame"] .alc-settings .alc-set-btn-primary {
  background: #8a6a4a;
  border-color: transparent;
  color: #f5f0e8;
}
body[data-app-scope="ingame"] .alc-settings .alc-set-btn-primary:hover { background: #6a4a30; }
body[data-app-scope="ingame"] .alc-settings .alc-set-range { accent-color: #8a6a4a; }
body[data-app-scope="ingame"] .alc-settings .alc-set-val { color: #8a6a4a; }

/* --- 설정 모달 (다크) --- */
html[data-theme="dark"] body[data-app-scope="ingame"] #settingsModal { background: rgba(0,0,0,0.55); }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings { background: #2a231c; border-color: #3a3328; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-title { color: #ede5d6; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-label,
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-sub { color: #8a8070; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-divider { background: #3a3328; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-box {
  background: #1a1612;
  border-color: #3a3328;
  color: #ede5d6;
}
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-switch { background: #221d18; border-color: #3a3328; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-switch.is-on { background: #bfa78c; border-color: #bfa78c; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-thumb { background: #2a231c; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-select {
  background: #1a1612;
  border-color: #3a3328;
  color: #ede5d6;
}
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-btn,
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .model-btn {
  background: #221d18;
  border-color: #3a3328;
  color: #8a8070;
}
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-btn:hover,
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .model-btn:hover { background: #2a231c; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .scale-btn.active,
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .model-btn.active {
  background: #3a3328;
  border-color: #bfa78c;
  color: #bfa78c;
}
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-btn-primary {
  background: #bfa78c;
  border-color: transparent;
  color: #1a1612;
}
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-btn-primary:hover { background: #a88f72; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-range { accent-color: #bfa78c; }
html[data-theme="dark"] body[data-app-scope="ingame"] .alc-settings .alc-set-val { color: #bfa78c; }

/* ===== BGM 유도 토스트 (.bgm-intro-*) — Direction B 베이지·세리프 =====
 * 기본 규칙(647-715)은 무수정. .bgm-intro-* 마크업은 app.html(게임)에만 존재 → 로비 영향 0.
 * .alc-* 와 동일 패턴: body[data-app-scope="ingame"] 스코프 + 라이트/다크 명시 리터럴.
 */
body[data-app-scope="ingame"] .bgm-intro-toast {
  background: #f0ebe2;
  color: #3a3028;
  border: 1px solid #d8cfc0;
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(58,48,40,0.20);
  font-family: 'Noto Serif KR', serif;
}
body[data-app-scope="ingame"] .bgm-intro-arrow {
  background: #f0ebe2;
  border-left: 1px solid #d8cfc0;
  border-top: 1px solid #d8cfc0;
}
body[data-app-scope="ingame"] .bgm-intro-cta {
  background: #8a6a4a;
  border: 1px solid transparent;
  color: #f5f0e8;
  border-radius: 10px;
  font-family: 'Noto Serif KR', serif;
}
body[data-app-scope="ingame"] .bgm-intro-cta:hover { background: #6a4a30; }
body[data-app-scope="ingame"] .bgm-intro-close { color: #8a7a6a; }
body[data-app-scope="ingame"] .bgm-intro-close:hover { color: #3a3028; }

html[data-theme="dark"] body[data-app-scope="ingame"] .bgm-intro-toast {
  background: #2a231c;
  color: #ede5d6;
  border: 1px solid #3a3328;
}
html[data-theme="dark"] body[data-app-scope="ingame"] .bgm-intro-arrow {
  background: #2a231c;
  border-left: 1px solid #3a3328;
  border-top: 1px solid #3a3328;
}
html[data-theme="dark"] body[data-app-scope="ingame"] .bgm-intro-cta { background: #bfa78c; color: #1a1612; }
html[data-theme="dark"] body[data-app-scope="ingame"] .bgm-intro-cta:hover { background: #a88f72; }
html[data-theme="dark"] body[data-app-scope="ingame"] .bgm-intro-close { color: #8a8070; }
html[data-theme="dark"] body[data-app-scope="ingame"] .bgm-intro-close:hover { color: #ede5d6; }

