/* ============================================================
   MENU.CSS — 메인 화면 (타이틀 + 디자인 모달) 전용 스타일
   tailwind 보완 + 디자인 효과(파티클, 글래스, 시머 등)
   ============================================================ */

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #070505;
    color: #f5f5f4;
}
.serif-title {
    font-family: 'Song Myung', serif;
}

/* Premium background image with smooth vignette overlay
   (비디오 배경 .title-scene 위 비네팅 레이어로 동작) */
.novel-bg {
    background-image: linear-gradient(to right, rgba(7, 5, 5, 0.85) 0%, rgba(7, 5, 5, 0.4) 40%, rgba(7, 5, 5, 0.1) 70%, rgba(7, 5, 5, 0.6) 100%);
    background-size: cover;
    background-position: center;
}

/* ============================================================
   TITLE SCENE — 비디오 배경 + 크로스페이드 루프
   demon.mp4(또는 다른 .mp4)를 단칸방여신 침략/ 폴더에 두면 동작
   ============================================================ */
.title-scene {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: #070505;
}
.title-scene video {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* mask-image는 GPU 합성 비용이 커서 ::after radial-gradient 비네팅으로 대체 */
}
.title-scene .v2 {
    animation: fadeLoop 10s infinite;
}
/* 가장자리 비네팅 — 비디오 위에 어둠 그라데이션으로 가장자리를 자연스럽게 페이드 */
.title-scene::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        ellipse 80% 90% at center,
        transparent 45%,
        rgba(7, 5, 5, 0.55) 75%,
        #070505 100%
    );
    z-index: 1;
}
@keyframes fadeLoop {
    0%, 45%  { opacity: 0; }
    50%, 95% { opacity: 1; }
    100%     { opacity: 0; }
}

/* Ambient dust particles */
@keyframes dust {
    0% { transform: translateY(0px) translateX(0px); opacity: 0; }
    50% { opacity: 0.3; }
    100% { transform: translateY(-120px) translateX(40px); opacity: 0; }
}
.particle {
    position: absolute;
    background: rgba(253, 186, 116, 0.25);
    border-radius: 50%;
    pointer-events: none;
    animation: dust infinite linear;
}

/* (구) .menu-btn — 더이상 마크업에서 사용 안 함, 보존만 */
.menu-btn {
    position: relative;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   TITLE MENU — 해상도 독립 (left 6vw + top 50% 절대 위치)
   ============================================================ */
.title-menu-anchor {
    position: absolute;
    left: 6vw;
    top: 50%;
    transform: translateY(-50%);
    min-width: 380px;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 48px;
    pointer-events: auto;
}

.title-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.title-eyebrow {
    font-size: 12px;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: #F59E0B;
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.title-name {
    font-family: 'Song Myung', 'Noto Serif KR', serif;
    font-size: clamp(48px, 5.5vw, 80px);
    font-weight: 300;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin: 6px 0 0;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.55);
}
.title-sub-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.title-sub-bar {
    width: 36px;
    height: 1px;
    background: rgba(232, 212, 168, 0.5);
}
.title-sub-text {
    font-size: 13px;
    color: #e7e5e4;
    letter-spacing: 0.04em;
    font-weight: 400;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* ----- 메뉴 버튼 (2배 크기 + 영문 라벨 가독성 강화) ----- */
.title-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.title-nav-btn {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 18px 28px 18px 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 28px;
    transition: padding-left 220ms cubic-bezier(0.16, 1, 0.3, 1), color 180ms ease;
    color: #f5f5f4;
    font-family: 'Pretendard Variable', Pretendard, 'Noto Sans KR', sans-serif;
    will-change: padding-left;
}
.title-nav-btn::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 0;
    background: linear-gradient(90deg, #F59E0B, transparent);
    transition: width 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.title-nav-btn:hover {
    padding-left: 28px;
    color: #FBBF24;
}
.title-nav-btn:hover::before { width: 100%; }

.title-nav-ko {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
.title-nav-en {
    font-size: 14px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-weight: 600;
    letter-spacing: 0.32em;
    color: rgba(255, 230, 175, 0.78);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
    transition: color 220ms ease;
}
.title-nav-btn:hover .title-nav-en {
    color: #FBBF24;
    text-shadow: 0 1px 6px rgba(251, 191, 36, 0.45), 0 1px 4px rgba(0, 0, 0, 0.85);
}

/* ============================================================
   MOBILE BLOCK — 모바일 접속 시 PC 권장 안내
   ============================================================ */
#mobile-block {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #070505;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: #f0e4cc;
    font-family: 'Pretendard Variable', Pretendard, 'Noto Sans KR', sans-serif;
}
#mobile-block.is-active { display: flex; }
.mobile-block-box {
    max-width: 380px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.mobile-block-icon {
    font-size: 52px;
    color: #F59E0B;
    margin-bottom: 6px;
}
#mobile-block h2 {
    font-family: 'Noto Serif KR', serif;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #f8eed4;
    letter-spacing: -0.01em;
}
#mobile-block p {
    font-size: 14px;
    line-height: 1.7;
    color: #a89a82;
    margin: 0;
}

/* ============================================================
   NAME MODAL — 처음부터 시작 시 플레이어 이름 입력
   ============================================================ */
#name-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(7, 5, 5, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Pretendard Variable', Pretendard, 'Noto Sans KR', sans-serif;
}
#name-modal.is-active { display: flex; }

.name-modal-box {
    width: 100%;
    max-width: 440px;
    background: rgba(19, 16, 15, 0.92);
    border: 1px solid rgba(232, 212, 168, 0.22);
    border-radius: 14px;
    padding: 32px 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}
.name-modal-eyebrow {
    font-size: 11px;
    letter-spacing: 0.32em;
    color: #f59e0b;
    font-weight: 600;
    text-transform: uppercase;
}
.name-modal-box h2 {
    font-family: 'Noto Serif KR', serif;
    font-size: 22px;
    color: #f8eed4;
    margin: 0;
    letter-spacing: -0.01em;
    font-weight: 700;
}
.name-modal-box p {
    font-size: 13px;
    color: #a89a82;
    margin: 0 0 4px;
    line-height: 1.5;
}
#name-input {
    width: 100%;
    background: rgba(232, 212, 168, 0.05);
    border: 1px solid rgba(232, 212, 168, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    color: #f8eed4;
    font-family: inherit;
    font-size: 15px;
    letter-spacing: -0.005em;
    outline: none;
    transition: border-color 200ms ease, background 200ms ease;
}
#name-input::placeholder { color: #6b5f4a; }
#name-input:focus {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(232, 212, 168, 0.08);
}

.name-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}
.name-modal-actions button {
    font-family: inherit;
    background: transparent;
    border: 1px solid rgba(232, 212, 168, 0.2);
    color: #c7b299;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 22px;
    cursor: pointer;
    border-radius: 10px;
    letter-spacing: 0.02em;
    transition: all 180ms ease;
}
.name-modal-actions button:hover {
    color: #f8eed4;
    border-color: rgba(232, 212, 168, 0.4);
}
.name-modal-actions button.is-primary {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #13100F;
}
.name-modal-actions button.is-primary:hover {
    background: #fbbf24;
    border-color: #fbbf24;
}

/* Ambient lens glow representing twilight */
.twilight-glow {
    background: radial-gradient(circle at 10% 30%, rgba(245, 158, 11, 0.04) 0%, transparent 50%);
}

/* Shimmer effect for active state */
@keyframes shimmer {
    100% { transform: translateX(100%); }
}
.shimmer::after {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.03) 20%,
        rgba(255, 255, 255, 0.08) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
    content: '';
}

/* Glassmorphism details */
.glass-panel {
    background: rgba(15, 12, 12, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Premium Volumetric Bars */
.volume-bar {
    width: 6px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}
.volume-bar.active {
    background-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

/* ============================================================
   디자인 모달 컨테이너 — display 토글
   .design-panel.hidden { display: none }
   .design-panel.flex   { display: flex }
   ============================================================ */
.design-panel.hidden { display: none; }
.design-panel.flex   { display: flex; }

/* 타이틀 화면이 활성화됐을 때만 메인 디자인 배경 보이도록 */
#screen-title:not(.visible) ~ .design-bg-layer { display: none; }


/* ============================================================
   VN SETTINGS — 새 설정창 (13 Sentinels 풍 좌측 사이드바 + 우측 패널)
   리서치 기반: line-only 구분, 카드 제거, 세그먼티드 + 가는 슬라이더,
                amber 액센트 #F59E0B, 한일영 병기 헤더
   ============================================================ */

/* ============================================================
   VN SETTINGS — 원신(Genshin Impact) 풍 설정창
   ------------------------------------------------------------
   특징: 베이지 알약 행, 다이아몬드 사이드바 마커,
         톱니바퀴 헤더 브레드크럼, 다이아몬드 슬라이더 thumb
   ------------------------------------------------------------
   컬러 토큰
   bg blur   rgba(40, 50, 65, 0.55)   글래스 다크
   pill mid  rgba(248, 242, 228, 0.85) 베이지 크림 (행 중앙)
   pill edge rgba(229, 220, 200, 0.18) 행 양 끝
   text dk   #3d3528                   행 라벨 (어두운 갈색)
   text lt   #f0e4cc                   사이드바/헤더 텍스트
   muted     #a89a82                   비활성 사이드바
   accent    #e8d4a8                   다이아몬드/액센트 (베이지 골드)
   ============================================================ */

#settings-panel.design-panel {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(8, 6, 5, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.vn-settings-panel {
  width: 100%;
  max-width: 1080px;
  height: min(700px, 90vh);
  background:
    linear-gradient(135deg, rgba(40, 50, 65, 0.62) 0%, rgba(30, 40, 55, 0.55) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(232, 212, 168, 0.22);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "header  header"
    "sidebar body";
  color: #f0e4cc;
  font-family: 'Pretendard Variable', Pretendard, 'Noto Sans KR', sans-serif;
  letter-spacing: -0.005em;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* ---- Header (톱니바퀴 + 브레드크럼) ---- */
.vn-settings-header {
  grid-area: header;
  padding: 20px 28px 16px;
  border-bottom: 1px solid rgba(232, 212, 168, 0.1);
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
}
.vn-settings-header .vn-gear {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(232, 212, 168, 0.12);
  color: #e8d4a8;
  font-size: 18px;
  flex-shrink: 0;
}
.vn-settings-header h2 {
  font-family: 'Noto Serif KR', serif;
  font-weight: 600;
  font-size: 22px;
  color: #f8eed4;
  letter-spacing: -0.01em;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.vn-settings-header h2 .vn-crumb-sep {
  color: rgba(240, 228, 204, 0.5);
  font-weight: 400;
  margin: 0 4px;
}
.vn-settings-header h2 .vn-crumb-current {
  color: #f0e4cc;
  font-weight: 600;
}
.vn-settings-header .vn-subtitle { display: none; }

.vn-settings-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: rgba(232, 212, 168, 0.08);
  border: 1px solid rgba(232, 212, 168, 0.22);
  color: #f0e4cc;
  font-size: 16px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.vn-settings-close:hover {
  background: rgba(232, 212, 168, 0.18);
  border-color: rgba(232, 212, 168, 0.5);
  transform: rotate(90deg);
}

/* ---- Sidebar (다이아몬드 ◆ 마커) ---- */
.vn-settings-sidebar {
  grid-area: sidebar;
  border-right: 1px solid rgba(232, 212, 168, 0.08);
  padding: 16px 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: transparent;
}
.vn-settings-sidebar-item {
  position: relative;
  background: transparent;
  border: none;
  color: #d4c8a8;
  text-align: left;
  padding: 10px 12px 10px 28px;
  font-family: 'Noto Serif KR', serif;
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.01em;
  cursor: pointer;
  border-radius: 6px;
  transition: color 180ms ease, font-size 180ms ease, padding-left 180ms ease;
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.vn-settings-sidebar-item::before {
  content: '◆';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(232, 212, 168, 0.4);
  font-size: 10px;
  transition: color 180ms ease, font-size 180ms ease;
}
.vn-settings-sidebar-item:hover { color: #f0e4cc; }
.vn-settings-sidebar-item.is-active {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  padding-left: 32px;
}
.vn-settings-sidebar-item.is-active::before {
  color: #ffffff;
  font-size: 13px;
}
.vn-settings-sidebar-item .vn-side-num { display: none; }

/* ---- Body (큰 페이지 타이틀 + 알약 행 목록) ---- */
.vn-settings-body {
  grid-area: body;
  padding: 14px 28px 20px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 212, 168, 0.25) transparent;
}
.vn-settings-body::-webkit-scrollbar { width: 6px; }
.vn-settings-body::-webkit-scrollbar-track { background: transparent; }
.vn-settings-body::-webkit-scrollbar-thumb {
  background: rgba(232, 212, 168, 0.25);
  border-radius: 3px;
}

.vn-settings-tab { display: none; }
.vn-settings-tab.is-active { display: block; }

.vn-settings-section-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 22px;
  font-weight: 600;
  color: #f8eed4;
  padding: 6px 24px 14px;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.vn-settings-section-title .sep { display: none; }

/* ---- Option Row (베이지 알약 그라데이션) ---- */
.vn-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 10px 24px;
  margin-bottom: 8px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    rgba(229, 220, 200, 0.22) 0%,
    rgba(248, 242, 228, 0.94) 22%,
    rgba(252, 247, 237, 0.98) 50%,
    rgba(248, 242, 228, 0.94) 78%,
    rgba(229, 220, 200, 0.22) 100%
  );
  min-height: 46px;
}
.vn-row:last-child { border-bottom: none; }
.vn-row-label { display: flex; flex-direction: column; gap: 2px; }
.vn-row-label .vn-label-ko {
  font-size: 15px;
  font-weight: 700;
  color: #2a2418;
  letter-spacing: -0.005em;
}
.vn-row-label .vn-label-desc {
  font-size: 11px;
  color: #4a3f2e;
  font-weight: 500;
}

/* ---- 사운드 탭 — 2열 그리드 ---- */
.vn-sound-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
}
.vn-sound-grid .vn-row {
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
  gap: 8px;
  padding: 14px 28px;
}
.vn-sound-grid .vn-slider-group {
  min-width: 0;
  width: 100%;
}
.vn-sound-grid .vn-slider {
  width: auto;
  flex: 1;
}

/* ---- Slider (가는 라인 + 다이아몬드 thumb) ---- */
.vn-slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}
.vn-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 200px;
  height: 2px;
  background: rgba(61, 53, 40, 0.25);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.vn-slider::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #6b5f4a 0 var(--fill, 50%),
    rgba(61, 53, 40, 0.25) var(--fill, 50%) 100%
  );
}
.vn-slider::-moz-range-track {
  height: 2px;
  border-radius: 999px;
  background: rgba(61, 53, 40, 0.25);
}
.vn-slider::-moz-range-progress {
  height: 2px;
  border-radius: 999px;
  background: #6b5f4a;
}
/* 다이아몬드 thumb (회전된 사각형) */
.vn-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #f8f2e4;
  border: 1px solid #8a7860;
  margin-top: -6px;
  transform: rotate(45deg);
  transition: transform 160ms ease, box-shadow 160ms ease;
  cursor: pointer;
  border-radius: 2px;
}
.vn-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #f8f2e4;
  border: 1px solid #8a7860;
  transform: rotate(45deg);
  transition: transform 160ms ease, box-shadow 160ms ease;
  cursor: pointer;
  border-radius: 2px;
}
.vn-slider:hover::-webkit-slider-thumb,
.vn-slider:focus::-webkit-slider-thumb {
  transform: rotate(45deg) scale(1.2);
  box-shadow: 0 0 12px rgba(232, 212, 168, 0.6);
}
.vn-slider:hover::-moz-range-thumb,
.vn-slider:focus::-moz-range-thumb {
  transform: rotate(45deg) scale(1.2);
  box-shadow: 0 0 12px rgba(232, 212, 168, 0.6);
}
.vn-slider-value {
  font-size: 14px;
  font-weight: 700;
  color: #2a2418;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- Segmented control (작은 별 아이콘 ✦ 양옆 + 베이지 톤) ---- */
.vn-segmented {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  position: relative;
}
.vn-segmented::before,
.vn-segmented::after {
  content: '✦';
  color: rgba(232, 212, 168, 0.7);
  font-size: 10px;
  margin: 0 8px;
}
.vn-segmented button {
  background: transparent;
  border: none;
  color: #4a3f2e;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
  padding: 4px 12px;
  cursor: pointer;
  transition: color 180ms ease;
  position: relative;
}
.vn-segmented button:not(:last-child) {
  margin-right: 4px;
  padding-right: 16px;
}
.vn-segmented button:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: rgba(61, 53, 40, 0.25);
}
.vn-segmented button:hover { color: #1f1a10; }
.vn-segmented button.is-active {
  color: #1f1a10;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* ---- Danger button (베이지 톤) ---- */
.vn-danger-btn {
  background: transparent;
  border: 1px solid rgba(61, 53, 40, 0.45);
  color: #2a2418;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  cursor: pointer;
  border-radius: 999px;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.vn-danger-btn:hover {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.5);
  background: rgba(185, 28, 28, 0.06);
}

/* ---- Footer 제거 (원신 스타일은 풋터 없음) ---- */
.vn-settings-footer { display: none; }
