@font-face {
  font-family: "HeirofLight";
  src: url("HeirofLightBold.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0020-007E, U+00A0-024F,
    U+1100-11FF, U+3130-318F,
    U+A960-A97F, U+AC00-D7A3, U+D7B0-D7FF;
}

@font-face {
  font-family: "HeirofLight";
  src: url("HeirofLightBold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0020-007E, U+00A0-024F,
    U+1100-11FF, U+3130-318F,
    U+A960-A97F, U+AC00-D7A3, U+D7B0-D7FF;
}

@font-face {
  font-family: "HeirofLightRegular";
  src: url("HeirofLightRegular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0020-007E, U+00A0-024F,
    U+1100-11FF, U+3130-318F,
    U+A960-A97F, U+AC00-D7A3, U+D7B0-D7FF;
}

@font-face {
  font-family: "EsamanruLight";
  src: url("esamanru Light.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after{
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* 🌟 PC(마우스) 환경 전용: 커스텀 이미지 커서 상시 적용 (손 모양 차단 및 클릭 상태) */
@media (pointer: fine) {
  /* 1. 기본 상태 마우스 커서 (손 모양 완전 차단) */
  body, html, * {
    cursor: url('image/cursor.png') 0 0, auto !important;
  }
  
  /* 2. 클릭하는 동안 (마우스를 꾹 누르고 있을 때) 변경되는 커서 */
  html:active, html:active * {
    cursor: url('image/cursor_click.png') 0 0, auto !important;
  }
  
  /* 3. 텍스트 입력창은 글자 입력 커서(I빔) 유지 */
  input[type="text"], input[type="number"], .stat-name-input,
  html:active input[type="text"], html:active input[type="number"], html:active .stat-name-input {
    cursor: text !important;
  }
}

:root{
  --bg: #141414;
  --fg: #d2d2d2;

  --panel: rgba(55,55,55,0.35);
  --panel-border: rgba(255,255,255,0.06);

  --btn-bg: rgba(0,0,0,0.62);
  --btn-bg-hover: rgba(12,12,14,0.66);
  --btn-bg-selected: rgba(255,255,255,0.12);

  --btn-fg: rgba(255,255,255,0.65);
  --btn-fg-hover: rgba(255,255,255,0.85);
  --btn-fg-selected: rgba(255,255,255,0.96);

  --btn-border: rgba(255,255,255,0.12);
  --btn-border-hover: rgba(255,255,255,0.20);
  --btn-border-selected: rgba(255,255,255,0.32);

  --press-y: 2px;
  --floor-y: 5px;

  --shadow-floor:
    0 var(--floor-y) 0 rgba(0,0,0,0.55),
    0 10px 20px rgba(0,0,0,0.40),
    inset 0 0 0 1px rgba(0,0,0,0.45);

  --shadow-press:
    0 2px 0 rgba(0,0,0,0.55),
    0 6px 14px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.06),
    inset 0 6px 14px rgba(0,0,0,0.55);

  --shadow-selected:
    0 2px 0 rgba(0,0,0,0.55),
    0 8px 18px rgba(0,0,0,0.35),
    0 0 18px rgba(255,255,255,0.12),
    inset 0 0 0 1px rgba(255,255,255,0.12),
    inset 0 4px 12px rgba(0,0,0,0.45);

  --radius: 14px;
  --font-kr: "HeirofLight", "Noto Serif KR","AppleMyungjo","Batang","바탕",serif;
}

/* 🌟 폰트 되돌림: 로딩/시작 전 알림/메인 알림/오프닝 내러티브(scene2~5)/이브 대화/세계관 설명 구간은 기존 폰트(Noto Serif KR) 유지 — 캐릭터 커스터마이징 선택지는 HeirofLight(기본값) 사용 */
/* button.choice.bodyChoice 등 var(--font-kr)를 직접 지정하는 공용 클래스보다 우선해야 하므로 후손 전체에 !important로 적용 */
#loadingScreen, #loadingScreen *,
#langSelectScreen, #langSelectScreen *,
#copyrightNoticeOverlay, #copyrightNoticeOverlay *,
#startWarningOverlay, #startWarningOverlay *,
#nameModalOverlay, #nameModalOverlay *,
#customAlertOverlay, #customAlertOverlay *,
#crimsonAlertOverlay, #crimsonAlertOverlay *,
#scene2, #scene2 *,
#scene3, #scene3 *,
#scene3a, #scene3a *,
#scene3b, #scene3b *,
#scene4, #scene4 *,
#scene5, #scene5 *,
#eveContainer, #eveContainer *,
#eveChoices, #eveChoices *,
#loreSection, #loreSection * {
  font-family: "Noto Serif KR","AppleMyungjo","Batang","바탕",serif !important;
}

/* 그릇 선택 ~ 성흔까지: loreSection의 Noto Serif를 HeirofLight로 되돌림 */
#vesselSection, #vesselSection *,
#essenceSection, #essenceSection * {
  font-family: "HeirofLight", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif !important;
}

/* 종족 섹션 제목 및 개별 종족 이름 */
#raceSection .row p, #raceSection .row strong,
#bloodLine p, #bloodLine strong,
#beastLine p, #beastLine strong,
#holyLine p, #holyLine strong,
#raceSection .choiceTitle,
#bloodChoices .choiceTitle,
#beastChoices .choiceTitle,
#holyChoices .choiceTitle,
#hiddenRaceChoices .choiceTitle {
  font-family: "HeirofLight", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif !important;
}

/* 장점/단점 세부 선택지 제목 */
#physicalMeritChoices .choiceTitle,
#mentalMeritChoices .choiceTitle,
#sexualMeritChoices .choiceTitle,
#physicalFlawChoices .choiceTitle,
#mentalFlawChoices .choiceTitle,
#sexualFlawChoices .choiceTitle {
  font-family: "HeirofLight", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif !important;
}

/* 그릇 선택지 이브 대사: 나레이터 폰트 */
#vesselChoices .choice .vessel-quote {
  font-family: "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif !important;
  display: block;
  margin-top: 4px;
}

/* postStatChoices(종족/기타 부위 버튼) 제목 glow 제거 */
#postStatChoices .choice .choiceTitle {
  text-shadow: none;
}

/* 기타 부위 세부 선택지 제목: HeirofLight */
#partsChoices .choiceTitle {
  font-family: "HeirofLight", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif !important;
}

/* 능력/장비 탭 전체 선택지 제목: HeirofLight */
#abilityTab .choiceTitle,
#equipmentTab .choiceTitle,
#battlePrepSection .choiceTitle {
  font-family: "HeirofLight", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif !important;
}

/* 능력/장비 탭 일반 h3·h4 제목: HeirofLight */
#abilityTab h3, #abilityTab h4,
#equipmentTab h3, #equipmentTab h4 {
  font-family: "HeirofLight", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif !important;
}

/* 히든 종족 / 히든 장점 제목: HeirofLight */
#hiddenExtraMeritChoices .choiceTitle,
#hiddenRaceTraitPanel .choiceTitle {
  font-family: "HeirofLight", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif !important;
}

/* 영혼 섹션 카테고리 버튼(능력/장비) 제목 glow 제거 */
#abilityChoices .choiceTitle,
#equipmentTab .choiceTitle {
  text-shadow: none;
}

/* 요람 이름(도시 카드): HeirofLight — 한글/영어만, 특수 폰트 문자 제외 */
.city-inline-title-box,
.city-inline-title-box h4,
.city-inline-title-box p,
#displayCityTitle {
  font-family: "HeirofLight", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif !important;
}

html, body{
  height: 100%;

  scrollbar-width: none;
  -ms-overflow-style: none; 
}

::-webkit-scrollbar {
  width: 0px;
  height: 0px;
  display: none;
}

html{ font-size: 17.5px; }

body{
  margin: 0;
  background: #242424;
  color: var(--fg);
  font-family: var(--font-kr);
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  
  overflow: hidden; 
}

body.lockScroll{ overflow:hidden; }

h1{ font-size:3em; margin:0 0 10px; }
h2{ font-size:1.5em; margin:0 0 30px; font-style:italic; opacity:0.9; }

.hidden,
.inlineHidden{ display:none !important; }

#game{
  min-height:100vh;
  min-height:100dvh; /* 🌟 모바일 주소창 등으로 인한 100vh 오차 보정(dvh 지원 브라우저용) */
  display:flex;
  justify-content:center;
  align-items:center;
  overflow:hidden;
}

#storyWrapper{
  width: 100%;
  max-width: 1500px;
  height: 100vh;
  height: 100dvh; /* 🌟 모바일에서 주소창 때문에 100vh가 실제 화면보다 커서 하단 선택지가 잘리는 문제 보정 */
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  padding: 80px 12px 140px; /* 🌟 스크롤 보정을 JS가 하므로 본래 수치로 복구 */
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  margin: 0 auto;          
}

#storyWrapper::-webkit-scrollbar{ width:0; height:0; }
#storyWrapper{ scrollbar-width:none; -ms-overflow-style:none; }

#story{ padding-bottom: 20px; }

.scene{ margin:0; padding:0; }
.scene .choice,
.scene .choiceLine{ margin-top:14px; }

.row{
  display: flow-root;
  margin:30px auto;

  padding:14px 18px;
  font-size:1.05em;
  line-height: calc(1em + 10px);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;

  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;

  pointer-events:none;
  text-align:center;
  max-width:1100px;
  box-sizing:border-box;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 10px 24px rgba(0,0,0,0.28);

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  height:auto;
  max-height:none;
  overflow:visible;
}

.row p{ margin: 0 0 12px; line-height: 1.78; }
.row p:last-child{ margin-bottom:0; }

.row strong{
  line-height: 1.85;
  display: inline-block;
  padding-top: 0.06em;
}

.row br{ display:block; margin: 0.65em 0; }

#scrollIndicator{
  position:fixed;
  right:18px;
  top:50%;
  transform:translateY(-50%);
  width:10px;
  height:220px;
  background:rgba(111, 145, 142, 0.25);
  border-radius:999px;
  pointer-events:none;
}

#scrollThumb{
  position:absolute;
  left:0;
  width:100%;
  height:40px;
  background:rgba(0, 0, 0, 0.7);
  border-radius:999px;
  pointer-events:auto;
  cursor:grab;
  transition: background 150ms ease;
}
#scrollThumb:hover{ background:rgba(0,0,0,0.9); }
#scrollThumb:active{ cursor:grabbing; }

.sceneImage{
  display:block;
  width:92%;
  max-width:720px;
  margin:14px auto;
  border-radius:10px;
  opacity:0.92;
  box-shadow: 0 12px 28px rgba(0,0,0,0.55);
}

.choiceLine.choiceGrid3{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
  align-items:stretch;
}

.choiceLine.choiceGrid4{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
  align-items:stretch;
}
.choiceLine.choiceGrid5{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap:12px;
  align-items:stretch;
}

.eve-container {
  display: flex;
  flex-direction: row;
  align-items: stretch; 
  justify-content: center;
  gap: clamp(20px, 2vw, 34px); 
  
  width: 100%;
  max-width: 1880px;
  min-height: 0;
  
  margin: clamp(56px, 10vh, 120px) auto 0 auto; /* 🌟 원상 복구: 상단 잘림 해결 */
  box-sizing: border-box; 
}

.eve-image-box {
  flex: 0 0 clamp(300px, 31vw, 520px);
  min-height: min(420px, 55vh);
  background-image: url('image/eve.png');
  background-size: cover; 
  background-position: center 18%; 
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 
    0 0 15px rgba(255, 255, 255, 0.3), 
    inset 0 0 10px rgba(255, 255, 255, 0.1), 
    0 10px 25px rgba(0, 0, 0, 0.7);
}

#eveLine {
  flex: 1; 
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  text-align: center; 
  
  
  margin: 0;
  padding: clamp(34px, 4vw, 58px); 
  min-height: 100%; 
  transition: opacity 160ms ease;
  box-sizing: border-box;
}

#eveLine p {
  font-size: 1.15em; 
  font-weight: 400;
  line-height: 1.8;
  margin: 0 0 10px 0;
}

.eve-quote {
  font-weight: 400;
  color: #ffffff;
}

@media (max-width: 1100px) {
  .eve-container {
    width: 100%;
    min-height: auto;
    flex-direction: column;
  }

  .eve-image-box {
    flex: 0 0 auto;
    width: 100%;
    min-height: min(48vh, 560px);
  }

  #eveLine {
    width: 100%;
  }
}

#eveChoices { overflow: visible; }
#eveChoices .choice { max-width: 100%; }

#vesselChoices .choice,
#nextSteps .choice{
  width:100%;
  min-width:0;
  max-width:none;
  box-sizing:border-box;
  text-align:left;
  line-height:1.45;
  white-space:normal;
  overflow-wrap:anywhere;
}

button.bodyChoice{
  width: 100%;
  max-width: none; 
  flex: 1 1 calc(50% - 12px); 
  text-align: left;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.bodyBlock{ 
  margin-top: 48px; 
}

.choiceLine.traitLikeGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); 
  gap:14px;
  width:100%;
  max-width:none;
  margin: 10px 0;
  align-items:stretch;
}
.choiceLine.traitLikeGrid > button.choice{
  width:100%;
  max-width:none;
  min-width:0;
  height:auto;
  min-height: 120px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  align-items:flex-start;
  padding:18px 18px 16px;
  text-align:left;
  overflow:hidden;
}

#traitChoices{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)); 
  gap:14px;
  width:100%;
  max-width:none;
  margin: 10px 0;
  align-items:stretch;
}
#traitChoices > button.choice{
  grid-column: span 2; 
  width:100%;
  max-width:none;
  min-width:0;
  aspect-ratio: auto;
  height:auto;
  min-height: 120px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  align-items:flex-start;
  padding:18px 18px 16px;
  text-align:left;
  overflow:hidden;
}

button.choice,
#vesselChoices .choice,
#nextSteps .choice,
button.choice.bodyChoice{
  position:relative;
  appearance:none;
  cursor:pointer;
  font-family: var(--font-kr);
  font-size:1.05em;

  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: 16px;

  padding: 18px 18px 16px;
  line-height: 1.95;

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  height:auto;
  white-space:normal;
  overflow:visible;

  box-shadow: var(--shadow-floor), 0 0 0 1px rgba(255,255,255,0.18), 0 0 14px rgba(255,255,255,0.12);
  filter: saturate(0.85) contrast(0.98);

  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease,
    filter 160ms ease;
  will-change: transform;
}

/* 커스터마이징 선택지: 각진 플랫 디자인 */
button.choice.bodyChoice,
#vesselChoices .choice,
#nextSteps .choice {
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.18), 0 0 14px rgba(255,255,255,0.12);
  filter: none;
}

button.choice strong,
#vesselChoices .choice strong,
#nextSteps .choice strong,
button.choice.bodyChoice strong{
  line-height: 2.0;
}

button.choice:hover,
#vesselChoices .choice:hover,
#nextSteps .choice:hover,
button.choice.bodyChoice:hover{
  background: var(--btn-bg-hover);
  color: var(--btn-fg-hover);
  border-color: var(--btn-border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-floor);
}

button.choice.bodyChoice:hover,
#vesselChoices .choice:hover,
#nextSteps .choice:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.28);
}

button.choice:active,
#vesselChoices .choice:active,
#nextSteps .choice:active,
button.choice.bodyChoice:active{
  transform: translateY(var(--press-y));
  box-shadow: var(--shadow-press);
}

button.choice.bodyChoice:active,
#vesselChoices .choice:active,
#nextSteps .choice:active {
  transform: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
  background: var(--btn-bg-hover);
}

button.choice:focus,
button.choice:focus-visible,
#vesselChoices .choice:focus,
#vesselChoices .choice:focus-visible,
#nextSteps .choice:focus,
#nextSteps .choice:focus-visible,
button.choice.bodyChoice:focus,
button.choice.bodyChoice:focus-visible{
  outline:none;
  border-color: rgba(255,255,255,0.30);
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.08),
    0 0 0 6px rgba(255,255,255,0.04),
    var(--shadow-floor);
}

button.choice.selected,
#vesselChoices .choice.selected,
#nextSteps .choice.selected,
button.choice.bodyChoice.selected{
  background: var(--btn-bg-selected);
  color: var(--btn-fg-selected);
  border-color: var(--btn-border-selected);
  transform: translateY(var(--press-y));
  box-shadow: var(--shadow-press);
  text-shadow: none;
  filter: saturate(1.02) contrast(1.05);
}

button.choice.bodyChoice.selected,
#vesselChoices .choice.selected,
#nextSteps .choice.selected {
  transform: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.22), 0 2px 10px rgba(0,0,0,0.30);
  filter: none;
}

button.choice.selected:hover,
#vesselChoices .choice.selected:hover,
#nextSteps .choice.selected:hover,
button.choice.bodyChoice.selected:hover{
  background: rgba(255,255,255,0.12);
}

#traitChoices > button.choice,
#traitChoices > button.choice:hover,
#traitChoices > button.choice:active,
#traitChoices > button.choice:focus,
#traitChoices > button.choice.selected {
  box-shadow: none !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important; 
  transform: none !important; 
}

#traitChoices > button.choice.selected {
  border: 2px solid #ffffff !important; 
  background: rgba(255, 255, 255, 0.12) !important;
}

button.choice:disabled,
#vesselChoices .choice:disabled,
#nextSteps .choice:disabled,
button.choice.bodyChoice:disabled{
  opacity:0.45;
  cursor:not-allowed;
  transform:none;
  box-shadow:
    0 5px 0 rgba(0,0,0,0.35),
    0 10px 20px rgba(0,0,0,0.25),
    inset 0 0 0 1px rgba(0,0,0,0.35);
}

button.choice.choice-unavailable:disabled,
#vesselChoices .choice.choice-unavailable:disabled,
#nextSteps .choice.choice-unavailable:disabled,
button.choice.bodyChoice.choice-unavailable:disabled{
  opacity:1;
  cursor:not-allowed;
  transform:none;
  background: rgba(8,8,8,0.72);
  border-color: rgba(255,255,255,0.08);
  box-shadow:
    0 5px 0 rgba(0,0,0,0.42),
    0 12px 24px rgba(0,0,0,0.32),
    inset 0 0 0 1px rgba(0,0,0,0.5);
}

button.choice.choice-unavailable:disabled .choiceImage,
button.choice.choice-unavailable:disabled .choiceTitle,
button.choice.choice-unavailable:disabled .choiceComment,
button.choice.choice-unavailable:disabled .choicePP,
button.choice.choice-unavailable:disabled .choiceHint{
  opacity: 0.42;
  filter: saturate(0.7);
}

button.choice.choice-unavailable:disabled .reqBadge,
button.choice.choice-unavailable:disabled .reqBadge span,
button.choice.choice-unavailable:disabled .reqCond,
button.choice.choice-unavailable:disabled .reqStat,
button.choice.choice-unavailable:disabled .reqBonus{
  opacity: 1;
  filter: none;
}

button.choice.race-auto-granted.choice-unavailable:disabled .choicePP{
  opacity: 1;
  filter: none;
}

button.choice.race-auto-granted[data-action="pickDetailMerit"].choice-unavailable:disabled{
  border-color: rgba(118, 184, 255, 0.42);
  box-shadow:
    0 5px 0 rgba(0,0,0,0.42),
    0 12px 24px rgba(0,0,0,0.32),
    0 0 24px rgba(74, 146, 224, 0.16),
    inset 0 0 0 1px rgba(76, 150, 232, 0.22),
    inset 0 0 18px rgba(74, 146, 224, 0.08);
}

button.choice.race-auto-granted[data-action="pickDetailFlaw"].choice-unavailable:disabled{
  border-color: rgba(255, 116, 116, 0.42);
  box-shadow:
    0 5px 0 rgba(0,0,0,0.42),
    0 12px 24px rgba(0,0,0,0.32),
    0 0 24px rgba(210, 72, 72, 0.16),
    inset 0 0 0 1px rgba(224, 86, 86, 0.22),
    inset 0 0 18px rgba(214, 74, 74, 0.08);
}

/* 🌟 종족 특성으로 인한 선택 불가 경고창 스타일 */
button.choice.race-blocked-choice::after {
  content: "[ 선택 불가 ]\A종족 특성 제한";
  white-space: pre-wrap;
  position: absolute;
  inset: 0;
  background: rgba(130, 0, 0, 0.85);
  color: #ffcccc;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1.25em;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-shadow: 0 0 15px rgba(0, 0, 0, 1);
  border-radius: inherit;
  border: 2px solid #ff4d4d;
  z-index: 20;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
body.lang-en-active button.choice.race-blocked-choice::after {
  content: "[ Cannot Select ]\ARace Trait Restriction";
}

.choiceTitle{
  font-family: "HeirofLight", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif !important;
  font-weight:700;
  font-size:1.12em;
  margin-bottom:6px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow:
    0 0 6px rgba(210,210,210,0.95),
    0 0 14px rgba(200,200,200,0.60),
    0 0 28px rgba(190,190,190,0.25),
    0 2px 5px rgba(0,0,0,0.9);
}
.choiceTitle small{
  font-weight:400;
  opacity:0.8;
  margin-left:6px;
  font-size:0.85em;
}
.choiceComment {
  font-family: "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif;
  order: 5;
  color: #b8b8b8;
  opacity: 0.9;
  font-style: italic;
  font-size: 0.98em;
  line-height: 1.45;
  width: 100%;
  text-align: center;     
  margin: 0;              
}
.choiceHint{
  margin-top:6px;
  font-size:0.88em;
  opacity:0.70;
  font-style:normal;
}

button.choice .choiceTitle{
  order: 3;               
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
}

@keyframes fadeInUp{
  from{ opacity:0; transform:translateY(10px); }
  to{ opacity:1; transform:translateY(0); }
}
.scene.reveal{ animation: fadeInUp 350ms ease both; }

.pointHUD{
  position:fixed;
  left:50%;
  bottom:14px;
  transform:translateX(-50%) translateY(8px);
  display:flex;
  gap:14px;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(0,0,0,0.55);
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:0 8px 24px rgba(0,0,0,0.45);
  z-index:9999;
  pointer-events:none;
  backdrop-filter: blur(6px);
  opacity:0;
  transition: opacity 500ms ease, transform 500ms ease;
}
.pointHUD.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
.pointHUD .pointItem{ font-size:0.98em; white-space:nowrap; }
.pointHUD .pointItem span{ font-weight:700; }

#eveChoices .choice{
  transition: transform 220ms ease, opacity 220ms ease, filter 220ms ease;
  will-change: transform, opacity;
}
#eveChoices .choice.slideOut{
  opacity:0;
  transform: translateX(-18px);
  pointer-events:none;
}
#eveChoices .choice.slideIn{
  opacity:0;
  transform: translateX(18px);
}
#eveChoices .choice.slideIn.slideInActive{
  opacity:1;
  transform: translateX(0);
}

#loreAfterChoices{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}
#loreAfterChoices #essenceBtn{
  width: min(520px, 92%);
  margin-top: 4px;
  font-size: 1.12em;
  padding: 18px 22px;
  text-align: center;
}
#loreLine2{ margin-top: 14px; }
#bgBtn{ margin-top: 12px; }

.blackout{
  position:fixed;
  inset:0;
  z-index:999998;
  background:#000;
  opacity:0;
  pointer-events:none;
  transition: opacity 700ms ease;
}
.blackout.show{ opacity:1; }
.blackout.breaking{
  opacity:0;
  transition: opacity 260ms ease-out;
}

.shatterOverlay{
  position:fixed;
  inset:0;
  z-index:999999;
  pointer-events:none;
  overflow:hidden;
}

.shard{
  position:absolute;
  transform: translate(-50%, -50%);
  background:#000;
  border:1px solid rgba(255,255,255,0.10);
  box-shadow:0 18px 38px rgba(0,0,0,0.75);
  opacity:0;
  will-change: transform, opacity, filter;
}

.shard.blackShard{
  background:#000;
  border:0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.95);
  filter:none;
}

.shatterOverlay.play .shard{
  animation: shardDrop var(--dur, 980ms) both;
  animation-delay: var(--delay, 0ms);
}

@keyframes shardDrop{
  0%{
    opacity:1;
    transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(1);
    filter: brightness(100%);
  }
  22%{
    opacity:1;
    transform: translate(-50%, -50%) translate(calc(var(--drift) * 0.15), 0px) rotate(calc(var(--rot) * 0.25)) scale(var(--sc, 1));
    filter: brightness(110%);
  }
  55%{
    opacity:1;
    transform: translate(-50%, -50%) translate(calc(var(--drift) * 0.55), calc(var(--fall) * 0.45)) rotate(calc(var(--rot) * 0.70)) scale(var(--sc, 1));
    filter: brightness(120%);
  }
  100%{
    opacity:0;
    transform: translate(-50%, -50%) translate(var(--drift), var(--fall)) rotate(var(--rot)) scale(var(--sc, 1));
    filter: brightness(140%);
  }
}

.portrait-frame-container {
  position: relative;
  width: 768px;
  height: 850px;
  max-width: 100%;
  margin: 20px auto 40px auto; 
  border-radius: 12px;
  overflow: hidden;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.portrait-frame-container:hover {
  border-color: #6a6a8c;
  background: rgba(20, 20, 20, 0.5);
}

.portrait-frame-container.has-image {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.portrait-frame {
  display: flex; 
  justify-content: center; 
  align-items: center;
  width: 100%; 
  min-height: 600px; 
  cursor: pointer; 
  position: relative;
}
.portrait-frame input { display: none; }

.portrait-action-group {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 10px;
  z-index: 10;
}
.portrait-action-group.hidden {
  display: none !important;
}

.portrait-action-btn {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.portrait-action-btn:hover {
  transform: translateY(-2px);
}
.portrait-action-btn:active {
  transform: translateY(1px);
}
.portrait-action-btn.crop:hover {
  background: rgba(100, 200, 255, 0.8);
  border-color: #66ccff;
}
.portrait-action-btn.remove:hover {
  background: rgba(255, 50, 50, 0.8);
  border-color: #ff4d4d;
}

.portrait-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
  color: rgba(255, 255, 255, 0.3); transition: opacity 0.3s ease;
}
.plus-icon { font-size: 5em; font-weight: 300; margin-bottom: 10px; }
.placeholder-text { font-size: 1.1em; text-align: center; line-height: 1.6; }

#portraitPreview {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.cropper-modal-overlay {
  position: fixed; inset: 0; z-index: 9999999;
  background: rgba(0, 0, 0, 0.85); 
  display: flex; justify-content: center; align-items: center;
  padding: 20px;
}

.cropper-modal-content {
  width: 100%; 
  max-width: 768px; 
  background: rgba(10, 10, 10, 0.6); 
  backdrop-filter: blur(15px); 
  -webkit-backdrop-filter: blur(15px);
  border: 2px dashed rgba(255, 255, 255, 0.2); 
  border-radius: 12px;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 60px rgba(0,0,0,0.9);
  padding: 30px;
  gap: 20px;
  pointer-events: auto; 
}

.cropper-header {
  text-align: center;
}
.cropper-title {
  color: #fff; font-size: 1.4em; font-weight: bold; letter-spacing: 0.1em; margin-bottom: 8px;
}
.cropper-subtitle {
  color: rgba(255, 255, 255, 0.4); font-size: 0.95em; font-weight: 300;
}

.cropper-workspace-frame {
  width: 100%; 
  height: 55vh; 
  min-height: 400px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
.cropper-workspace-frame img { 
  display: block; max-width: 100%; 
}

.cropper-resize-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 5px 0;
}
.cropper-resize-row label {
  color: #d2d2d2;
  font-size: 1.05em;
  letter-spacing: 0.05em;
  font-weight: bold;
}
.cropper-resize-row span {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
.cropper-resize-row input[type=range] {
  width: 80%;
  max-width: 400px;
}
.resize-hint {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.4);
}

.cropper-action-row {
  display: flex; gap: 15px; justify-content: center;
}
.cropper-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05); 
  color: rgba(255, 255, 255, 0.7); 
  border: 1px solid rgba(255, 255, 255, 0.15); 
  padding: 16px; 
  font-family: inherit;
  font-weight: 400;
  font-size: 1.05em; 
  letter-spacing: 0.1em;
  border-radius: 8px; 
  cursor: pointer; 
  transition: all 0.2s ease;
}
.cropper-btn:hover { 
  background: rgba(255, 255, 255, 0.15); 
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px); 
}
.cropper-btn:active {
  transform: translateY(1px);
}
.cropper-btn.confirm {
  background: rgba(255, 255, 255, 0.1); 
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.cropper-btn.confirm:hover {
  box-shadow: 0 0 15px rgba(255,255,255,0.15); 
}

.portrait-frame-container {
  width: 768px;
  min-height: 600px; 
  height: auto;      
  max-width: 100%;
  margin: 20px auto 40px auto; 
  border-radius: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.portrait-frame-container.has-image {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  min-height: auto; 
}

#portraitPreview {
  display: block;
  width: 100%;
  height: auto !important; 
  object-fit: contain !important; 
  border-radius: 12px;           
}

#scene2{ text-align:center; }

#scene2.centerOnce{
  min-height: calc(100vh - 120px);
  min-height: calc(100dvh - 120px);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
}
#scene2 .row{ max-width: 640px; }
#scene2 .choice{ margin-top: 24px; }

#vesselChoices .choice{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  align-items:center;  
  min-height: 340px;
  padding-top: 18px;
  text-align:center;   
}
#vesselChoices .choice strong{
  display:block;
  width: 100%;
  text-align: center;  
  margin:0 0 10px 0;
}

#traitChoices strong{
  font-size:1.05em;
  margin-bottom:6px;
}
#traitChoices small{
  opacity:0.8;
  line-height:1.45;
}
#traitChoices .choiceComment{
  display:block;
  margin-top:2px;
  line-height: 1.45;
  max-height:none;
  overflow:visible;
}

#traitChoices button[data-trait="일곱 나팔"] { 
  grid-column: span 2 !important; 
}

#statSection{
  position: relative;

  width: 92%;
  max-width: 900px;

  margin: 18px auto 0;
  text-align: left;
  overflow-x: hidden;

  padding: 68px 18px 56px; 
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);

  background: #0f0f0f !important;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 18px rgba(255,255,255,0.08),
    0 0 42px rgba(255,255,255,0.05),
    0 18px 40px rgba(0,0,0,0.9);
}

#statRemainRow {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  
  
  margin-top: 50px !important; 
  margin-bottom: 0 !important;
  
  padding: 0 !important;
  font-size: 1.05em !important; 
  opacity: 0.7; 
  text-align: center;
  letter-spacing: 0.05em;
}

#statSection #statPanel,
#statSection .statGrid,
#statSection .statCol,
#statSection .statRow{
  max-width: 100%;
  min-width: 0;
}

.statGrid{
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  align-items: start;
}

.statCol{
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  text-align: left;

  background: transparent;
  border: none;
  border-radius: 0;
  padding: 10px 6px;
  box-shadow: none;
}

#statColElement{
  padding-bottom: 12px;
}

#statColMain{ margin-top: 38px; }

#statSection .statGrid > .statCol:first-child{
  transform: translateX(10px);
}

#statColMain .statRow{
  grid-template-columns: minmax(0, 154px) auto;
  justify-content: start;
}

.statRow{
  position: relative;
  z-index: 1;
  min-width: 0;
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;

  
  padding: 7px 10px !important; 
}

.statLabel{
  min-width: 0;
  text-align: left;
  opacity: 0.92;
  line-height: 1.3;
  padding-left: 6px;
  overflow-wrap: normal;
  letter-spacing: 0.03em;
  color: rgba(230,230,230,0.92);
}

.statLabel{
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 10px;
}

.statIcon{
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
  align-self: start;
  font-family: "Segoe UI Symbol", "Apple Symbols", sans-serif;
  filter: grayscale(100%);
}

.statNameText{
  min-width: 0;
  display: block;
  overflow-wrap: normal;
  word-break: keep-all;
}

.statName{ min-width:0; }

.statExplainRow {
  margin-top: 14px;
  margin-bottom: 120px; 
  width: 100%;                  
  max-width: 900px;             
  margin-left: auto;            
  margin-right: auto;
}

.statExplainGrid {
  display: flex;                
  flex-direction: column;       
  gap: 14px;
  width: 100%;                  
  text-align: left;
}

.statExplainGroup{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 14px 12px;
}

.statExplainTitle{
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  opacity: 0.95;
}

.statExplainItem{
  display:grid;
  grid-template-columns: 22px 76px minmax(0, 1fr);
  gap: 10px;
  align-items:start;
  padding: 6px 0;
}

.statExplainIcon{
  width:22px;
  opacity:0.92;
  transform: translateY(1px);
}

.statExplainKey{
  opacity:0.92;
  white-space:nowrap;
}

.statExplainText{
  opacity:0.84;
  line-height:1.5;
}

.statExplainMini{
  display:flex;
  gap:10px;
  align-items:baseline;
  padding: 6px 0;
  opacity:0.86;
}

.statCtrl{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.statBtn{
  width: 34px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  
  
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  pointer-events: auto;
}

.statBtn:active{ transform: translateY(1px); }
.statBtn:hover{
  border-color: rgba(255,255,255,0.26);
  box-shadow:
    0 0 14px rgba(255,255,255,0.06),
    0 6px 14px rgba(0,0,0,0.35);
}
.statBtn:disabled{
  opacity: 0.35;
  cursor: not-allowed;
}

.statInput{
  width: 62px;
  height: 32px;
  border-radius: 10px;
  background: rgba(0,0,0,0.52);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);

  text-align: center;
  font-family: var(--font-kr);
  font-size: 1.0em;
  line-height: 1.6;
  padding-top: 2px;
  box-sizing: border-box;

  font-variant-numeric: tabular-nums;
  appearance: textfield;

  text-shadow: 0 0 10px rgba(255,255,255,0.10);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 0 0 rgba(255,255,255,0);
  transition: box-shadow 180ms ease, border-color 180ms ease, transform 120ms ease;
}
.statInput::-webkit-outer-spin-button,
.statInput::-webkit-inner-spin-button{
  appearance: none;
  margin: 0;
}
.statInput:focus{
  outline: none;
  border-color: rgba(255,255,255,0.26);
  box-shadow:
    0 0 18px rgba(255,255,255,0.12),
    0 0 32px rgba(255,255,255,0.06),
    inset 0 0 0 1px rgba(255,255,255,0.10);
}

.statCategory{
  position: relative;
  z-index: 2;

  font-size: 1.08em;
  font-weight: 700;
  letter-spacing: 0.08em;

  opacity: 0.92;
  
  margin: 15px 0 15px; 
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);

  color: rgba(235,235,235,0.95);
  text-transform: none;
}

.statCategory.sub{ margin-top: 26px; }

#statColSub .statRow{
  grid-template-columns: minmax(0, 224px) auto;
  justify-content: start;
  padding-top: 10px;
  padding-bottom: 10px;
}
#statColSub .statNameText{
  white-space: nowrap;
}
#statColElement .statRow{
  grid-template-columns: minmax(0, 124px) auto;
  justify-content: start;
  padding-top: 8px;
  padding-bottom: 8px;
}

.race-sp-mode {
  color: rgba(200, 130, 255, 0.95) !important;
  border-color: rgba(160, 90, 255, 0.55) !important;
  background: rgba(110, 50, 220, 0.2) !important;
}
.race-sp-mode:hover:not(:disabled) {
  color: #fff !important;
  background: rgba(140, 70, 255, 0.35) !important;
}

#statIntroRow{
  margin-top: -10px;
  position: relative;
  padding-bottom: 34px;
}

#statIntroRow #selectedRaceBadge{
  position: absolute;
  left: 12px;
  bottom: 10px;

  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.88);
  font-size: 0.92em;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 22px rgba(0,0,0,0.45);
  pointer-events: none;
}
#statIntroRow #selectedRaceBadge.hidden{ display:none !important; }

.statBonusTag{
  display:inline-block;
  margin-left:0;
  padding:2px 8px;
  border-radius:999px;
  font-size:0.82em;
  line-height:1.4;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(235,235,235,0.85);
  vertical-align: middle;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: start;
}
.statBonusTag.hidden{ display:none !important; }

.statExceedTag{
  display:inline-block;
  margin-left:4px;
  padding:2px 7px;
  border-radius:999px;
  font-size:0.82em;
  line-height:1.4;
  font-weight:700;
  background: rgba(30, 80, 180, 0.35);
  border: 1px solid rgba(100, 200, 255, 0.5);
  color: #64c8ff;
  text-shadow: 0 0 8px rgba(100, 200, 255, 0.8);
  vertical-align: middle;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: start;
}
.statExceedTag.hidden{ display:none !important; }

#beastLine{ margin-top: 14px; }
#beastLine .row{ opacity: 0.92; }

#beastChoices,
#holyChoices,
#abyssChoices,
#natureChoices,
#curseChoices,
#machineChoices,
#insectChoices{
  margin-top: 10px;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;

  width: 100%;
  max-width: min(1200px, 75vw) !important; 
  margin-left: auto !important;
  margin-right: auto !important;

  box-sizing: border-box;
}

#beastChoices > button.choice,
#holyChoices > button.choice,
#abyssChoices > button.choice,
#natureChoices > button.choice,
#curseChoices > button.choice,
#machineChoices > button.choice,
#insectChoices > button.choice{
  width: 100%;
  max-width: none;
  min-width: 0;
  overflow: hidden;
}

#raceSection button.choice.bodyChoice,
#bloodChoices > button.choice.bodyChoice{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 220px;
}
#raceSection .choiceTitle,
#bloodChoices .choiceTitle{
  margin-bottom: 10px;
}
#raceSection .choiceComment,
#bloodChoices .choiceComment{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;  
  width: 100%;
  text-align: center;       
}

#raceSection button.choice.bodyChoice,
#bloodChoices > button.choice.bodyChoice,
#beastChoices > button.choice.bodyChoice,
#holyChoices > button.choice.bodyChoice,
#abyssChoices > button.choice.bodyChoice,
#natureChoices > button.choice.bodyChoice,
#curseChoices > button.choice.bodyChoice,
#machineChoices > button.choice.bodyChoice,
#insectChoices > button.choice.bodyChoice,
#hiddenRaceChoices > button.choice.bodyChoice {
  position: relative;
  padding-top: 50px !important; 
  padding-right: 20px !important;
  padding-left: 20px !important;
}

#raceSection .choiceComment[data-bonus]::after,
#bloodChoices .choiceComment[data-bonus]::after,
#beastChoices .choiceComment[data-bonus]::after,
#holyChoices .choiceComment[data-bonus]::after,
#abyssChoices .choiceComment[data-bonus]::after,
#natureChoices .choiceComment[data-bonus]::after,
#curseChoices .choiceComment[data-bonus]::after,
#machineChoices .choiceComment[data-bonus]::after,
#insectChoices .choiceComment[data-bonus]::after,
#hiddenRaceChoices .choiceComment[data-bonus]::after {
  content: attr(data-bonus);
  
  
  position: absolute;
  top: 12px;
  right: 15px;

  
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  white-space: nowrap;

  
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: bold; 

  background: rgba(0, 0, 0, 0.7); 
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.95);

  pointer-events: none;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  z-index: 10; 
}

#raceSection .choice.selected .choiceComment[data-bonus]::after,
#bloodChoices .choice.selected .choiceComment[data-bonus]::after,
#beastChoices .choice.selected .choiceComment[data-bonus]::after,
#holyChoices .choice.selected .choiceComment[data-bonus]::after,
#abyssChoices .choice.selected .choiceComment[data-bonus]::after,
#natureChoices .choice.selected .choiceComment[data-bonus]::after,
#curseChoices .choice.selected .choiceComment[data-bonus]::after,
#machineChoices .choice.selected .choiceComment[data-bonus]::after,
#insectChoices .choice.selected .choiceComment[data-bonus]::after,
#hiddenRaceChoices .choice.selected .choiceComment[data-bonus]::after {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(20, 20, 20, 0.9);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.disabled-by-exclusion{
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.2);
}

button[data-trait="진혈"].selected{
  border-color: #ff4d4d !important;
  box-shadow: 0 0 15px rgba(255, 77, 77, 0.2), var(--shadow-selected) !important;
}

#hiddenRaceChoices button.choice[data-race="아키타입"]:not(.hidden) { border-color: rgba(255, 255, 255, 0.5); box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); }
#hiddenRaceChoices button.choice[data-race="펜리르"]:not(.hidden) { border-color: rgba(255, 26, 26, 0.5); box-shadow: 0 0 15px rgba(255, 26, 26, 0.1); }
#hiddenRaceChoices button.choice[data-race="세라핌"]:not(.hidden) { border-color: rgba(102, 179, 255, 0.5); box-shadow: 0 0 15px rgba(102, 179, 255, 0.1); }
#hiddenRaceChoices button.choice[data-race="진조: 레플리카"]:not(.hidden) { border-color: rgba(163, 0, 0, 0.5); box-shadow: 0 0 15px rgba(163, 0, 0, 0.1); }
#hiddenRaceChoices button.choice[data-race="데우스 엑스 마키나"]:not(.hidden) { border-color: rgba(201, 138, 75, 0.5); box-shadow: 0 0 15px rgba(201, 138, 75, 0.1); }
#hiddenRaceChoices button.choice[data-race="아바돈"]:not(.hidden) { border-color: rgba(138, 138, 138, 0.5); box-shadow: 0 0 15px rgba(138, 138, 138, 0.1); }
#hiddenRaceChoices button.choice[data-race="게티아"]:not(.hidden) { border-color: rgba(231, 0, 0, 0.5); box-shadow: 0 0 15px rgba(231, 0, 0, 0.1); }
#hiddenRaceChoices button.choice[data-race="구미호"]:not(.hidden) { border-color: rgba(255, 70, 190, 0.5); box-shadow: 0 0 15px rgba(255, 70, 190, 0.1); }
#hiddenRaceChoices button.choice[data-race="미디르"]:not(.hidden) { border-color: rgba(146, 146, 146, 0.5); box-shadow: 0 0 15px rgba(146, 146, 146, 0.1); }
#hiddenRaceChoices button.choice[data-race="장산범"]:not(.hidden) { border-color: rgba(230, 240, 255, 0.5); box-shadow: 0 0 15px rgba(230, 240, 255, 0.1); }

#hiddenRaceChoices {
  display: grid !important;
  grid-template-columns: 1fr !important; 
  width: 100% !important;
  max-width: 33.33vw !important;         
  margin: 20px auto 140px auto !important; 
}

#hiddenRaceChoices button.choice {
  width: 100% !important;
  max-width: none !important;
  min-height: 280px; 
  justify-content: flex-start !important;
  align-items: center !important;
}

#hiddenRaceChoices .choiceComment {
  text-align: center !important;
  word-break: keep-all !important;
  margin-top: 15px !important;
}

#partsLine1{
  position: relative;
  z-index: 3;
}
#partsChoices{
  position: relative;
  z-index: 1;
}

#partsChoices{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;

  width: 100%;
  max-width: none;

  margin: 10px 0 80px;  

  padding: 0;
  box-sizing: border-box;

  position: static;
  left: auto;
}

#partsChoices > button.choice{
  width: 100%;
  max-width: none;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

#partsChoices .choiceImage{
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: 4 / 5 !important;
  object-fit: cover !important;
  object-position: center center;
  border-radius: 14px !important;
  margin: 0 auto 18px auto !important;
}

#partsChoices button.choice:hover{
  box-shadow: var(--shadow-floor) !important;
}

.choicePP{
  order: 4;               
  display:block;
  width:100%;
  text-align:center;
  margin: -4px 0 10px;
  font-size:0.9em;
  font-weight:500;
  line-height:1.35;
  letter-spacing:0.02em;
  padding:0;
  background: transparent; 
  border: none;            
  pointer-events:none;
}

.choicePP.ppGain{ color: rgba(170, 255, 210, 0.95); } 
.choicePP.ppCost{ color: rgba(255, 170, 170, 0.95); } 
.choicePP.ppAuto{ color: rgba(126, 196, 255, 0.98); } 

/* 🌟 종족 특성으로 자동 해금된 버튼을 덮는 투명한 대형 오버레이 */
.race-auto-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  box-sizing: border-box;
  padding: 5px 8px;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none; 
}

/* 🌟 장점(Merit)의 경우: 투명한 푸른빛 테마 */
.race-auto-lock-overlay.merit {
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 100, 200, 0.1), transparent 58%),
    linear-gradient(145deg, rgba(0, 20, 50, 0.25), rgba(0, 5, 20, 0.1));
  border: 1px solid rgba(76, 150, 232, 0.55);
  box-shadow:
    inset 0 0 28px rgba(0, 100, 255, 0.15),
    0 0 22px rgba(74, 146, 224, 0.16);
}

.race-auto-lock-overlay.merit .ability-lock-warning-line {
  color: rgba(126, 196, 255, 0.96);
  background: rgba(0, 40, 90, 0.5); /* 띠 투명도 증가 */
  border-block: 1px solid rgba(126, 196, 255, 0.32);
  text-shadow: 0 0 8px rgba(76, 150, 232, 0.9);
}

.race-auto-lock-overlay.merit .ability-lock-core {
  color: #4c96e8;
}

.race-auto-lock-overlay.merit .ability-lock-mark {
  text-shadow: 0 0 10px rgba(126, 196, 255, 0.95);
}

.race-auto-lock-overlay.merit .ability-lock-sub {
  color: rgba(180, 220, 255, 0.86);
}

/* 🌟 단점(Flaw)의 경우: 투명한 붉은빛 테마 */
.race-auto-lock-overlay.flaw {
  background:
    radial-gradient(circle at 50% 50%, rgba(170, 0, 0, 0.15), transparent 58%),
    linear-gradient(145deg, rgba(50, 0, 0, 0.25), rgba(20, 0, 0, 0.1));
  border: 1px solid rgba(255, 46, 46, 0.55);
  box-shadow:
    inset 0 0 28px rgba(255, 0, 0, 0.15),
    0 0 22px rgba(255, 28, 28, 0.16);
}

.race-auto-lock-overlay.flaw .ability-lock-warning-line {
  color: rgba(255, 64, 64, 0.96);
  background: rgba(90, 0, 0, 0.5); /* 띠 투명도 증가 */
  border-block: 1px solid rgba(255, 88, 88, 0.32);
  text-shadow: 0 0 8px rgba(255, 48, 48, 0.9);
}

.race-auto-lock-overlay.flaw .ability-lock-core {
  color: #ff3e3e;
}

.race-auto-lock-overlay.flaw .ability-lock-mark {
  text-shadow: 0 0 10px rgba(255, 42, 42, 0.95);
}

.race-auto-lock-overlay.flaw .ability-lock-sub {
  color: rgba(255, 174, 174, 0.86);
}

/* 자동 부여된 종족 특성 버튼 뒷면은 살짝만 어둡게 하고 원본 유지 */
button.choice.race-auto-granted .choiceImage,
button.choice.race-auto-granted .choiceTitle,
button.choice.race-auto-granted .choiceComment {
  opacity: 0.45 !important; /* 이미지와 글씨가 충분히 잘 보이도록 불투명도 대폭 상향 */
  filter: saturate(0.6) !important; /* 블러 완전 제거, 색감만 약간 낮춤 */
}

/* 마법 탭에서 사용 중인 애니메이션/라인 스타일을 그대로 상속받아 호환됨 */

button.choice{
  display: inline-flex;  
  flex-direction: column;
  justify-content: center;
  align-items: center;   
  text-align: center;    
  position: relative; 
  
}

button.choice .choiceHint {
  display: block;
  position: relative; 
  right: auto;
  bottom: auto;
  
  width: 100%;
  order: 6; 
  
  margin-top: 12px; 
  
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: center; 

  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);

  pointer-events: none; 
}

.choiceLine,
.choiceLine.traitLikeGrid,
#traitChoices,
#vesselChoices,
#nextSteps,
#bloodChoices,
#beastChoices,
#holyChoices,
#abyssChoices,
#natureChoices,
#curseChoices,
#machineChoices,
#insectChoices,
#partsChoices{
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

#traitChoices,
#bloodChoices,
#beastChoices,
#holyChoices,
#abyssChoices,
#natureChoices,
#curseChoices,
#machineChoices,
#insectChoices,
#partsChoices{
  width: 100% !important;
  max-width: none !important;
  justify-content: center;
  justify-items: stretch;
  align-content: start;
  margin: 10px 0 !important;
}

#partsChoices{
  margin-bottom: 140px !important;
}

#raceSection .choiceLine,
#bloodChoices,
#beastChoices,
#holyChoices,
#abyssChoices,
#natureChoices,
#curseChoices,
#machineChoices,
#insectChoices{
  margin-bottom: 140px !important;
}

#partsChoices{
  margin-bottom: 140px !important;  
}

#storyWrapper{
  width: 100vw;
  max-width: none !important;  
  padding: 80px 24px 140px; /* 🌟 스크롤 보정을 JS가 하므로 본래 수치로 복구 */
  margin: 0 auto;
  box-sizing: border-box;
}

#genderChoices {
  display: grid !important;
  gap: 14px;
  width: 100%;
  max-width: 1200px !important; 
  margin: 10px auto !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

#hairChoices {
  display: grid !important;
  gap: 14px;
  width: 100%;
  max-width: 1560px !important; 
  margin: 10px auto !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#hairColorChoices,
#eyeColorChoices,
#pupilChoices,
#heightChoices {
  display: grid !important;
  gap: 14px;
  width: 100%;
  max-width: 100% !important; 
  margin: 10px auto !important;
}

#pupilChoices {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

#hairColorChoices,
#eyeColorChoices,
#heightChoices {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.choiceLine.choiceGrid3,
.choiceLine.choiceGrid5 {
  display: grid !important;
  gap: 14px;
  width: 100%;
  margin: 10px auto !important;
}

.choiceLine.choiceGrid5 {
  max-width: 100% !important; 
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.choiceLine.choiceGrid3 {
  max-width: 100% !important; 
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#secBodyShape .choiceLine.choiceGrid3 {
  max-width: 75% !important; 
  margin-bottom: 40px !important; 
}

#vesselChoices {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)); 
  gap: 14px;
  width: 100%;
  max-width: 85vw !important; 
  margin: 10px auto !important;
}

button.bodyChoice,
#vesselChoices .choice {
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
}

.bodyBlock { 
  margin-top: 56px !important; 
}

#portraitChoices {
  width: 100%;
  max-width: 1200px !important;
  margin: 10px auto !important;
}

#postStatChoices{
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;

  width: 100%;
  max-width: min(1200px, 75vw) !important; 
  margin: 10px auto !important;
}

#postStatChoices button.choice {
  width: 100% !important;
  max-width: none !important;
  height: 100%;
}

#raceSection,
#partsSection {
  margin-top: 56px !important; 
}

#loreSection {
  margin-top: 80px !important; 
}

#raceSection button.choice.bodyChoice,
#bloodChoices > button.choice.bodyChoice,
#beastChoices > button.choice.bodyChoice,
#holyChoices > button.choice.bodyChoice,
#abyssChoices > button.choice.bodyChoice,
#natureChoices > button.choice.bodyChoice,
#curseChoices > button.choice.bodyChoice,
#machineChoices > button.choice.bodyChoice,
#insectChoices > button.choice.bodyChoice {
  align-items: center !important; 
  padding-right: 18px !important; 
  padding-left: 18px !important;  
}

#eveChoices {
  max-width: 900px !important; 
  justify-content: center !important;
}

#raceBaseChoices button.choice {
  width: 50% !important; 
  max-width: 600px !important; 
  margin: 0 auto !important; 
}

.statExplainToggle{
  overflow: hidden;
}

.statExplainSummary{
  list-style: none; 
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;

  padding: 10px 12px;
  border-radius: 10px;

  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.08);
}

.statExplainSummary::-webkit-details-marker{ display:none; }

.statExplainSummaryTitle{
  font-weight: 700;
  opacity: 0.95;
  letter-spacing: 0.02em;
}

.statExplainSummaryHint{
  margin-left:auto;
  font-size: 0.92em;
  opacity: 0.55;
}

.statExplainChevron{
  opacity: 0.75;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.statExplainToggle[open] > .statExplainSummary .statExplainChevron{
  transform: rotate(90deg);
}

.statExplainBody{
  padding: 12px 14px 12px;
}

.statExplainRow{ pointer-events:auto; } 

.statExplainGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  text-align:left;
}

.statExplainGroup{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow:hidden;
}

.statExplainSummary{
  list-style:none;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  padding: 10px 12px;
}
.statExplainSummary::-webkit-details-marker{ display:none; }

.statExplainChevron{
  opacity:0.75;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}
.statExplainToggle[open] > .statExplainSummary .statExplainChevron{
  transform: rotate(90deg);
}

.statExplainSummaryTitle{
  font-weight:700;
  opacity:0.95;
}

.statExplainBody{
  padding: 10px 12px 12px;
}

.statExplainText{
  opacity:0.82;
  line-height:1.5;
  margin-bottom: 10px;
}

.statExplainItem{
  display:grid;
  grid-template-columns: 22px 78px 1fr;
  gap:10px;
  align-items:start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.statExplainItem:last-child {
  border-bottom: none;
}
.statExplainIcon{
  width:22px;
  text-align:center;
  opacity:0.92;
  font-family: "Segoe UI Symbol", "Apple Symbols", sans-serif;
  filter: grayscale(100%);
}
.statExplainKey{
  white-space:nowrap;
  opacity:0.92;
}
.statExplainDesc{
  opacity:0.80;
  line-height:1.45;
  overflow-wrap:anywhere;
}

#partsSection .row{
  margin-top: 120px !important;
}

#meritFlawChoices{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 1200px;
  margin: 10px auto;
}
#meritFlawChoices .choice{ width:100%; }
#meritFlawChoices .choice .choiceTitle { text-shadow: none; }

/* 능력/장비 탭 버튼 + [선택을 마친다] — 각진 플랫 디자인 */
#battlePrepSection .choiceLine button.choice,
#finishAbilityRow button.choice {
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.18), 0 0 14px rgba(255,255,255,0.12);
  filter: none;
}
#battlePrepSection .choiceLine button.choice:hover,
#finishAbilityRow button.choice:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.22), 0 0 18px rgba(255,255,255,0.15);
}
#battlePrepSection .choiceLine button.choice:active,
#finishAbilityRow button.choice:active,
#battlePrepSection .choiceLine button.choice.selected,
#finishAbilityRow button.choice.selected {
  transform: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.22), 0 2px 10px rgba(0,0,0,0.30);
}

#beastChoices,
#holyChoices,
#abyssChoices,
#natureChoices,
#curseChoices,
#machineChoices,
#insectChoices{
  max-width: min(1200px, 75vw) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

#bloodChoices {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important; 
  gap: 14px !important;
  
  
  width: 100% !important;
  max-width: 100% !important; 
  
  margin: 10px auto 140px auto !important;
  box-sizing: border-box !important;
}

#beastChoices,
#holyChoices,
#abyssChoices,
#natureChoices,
#curseChoices,
#machineChoices,
#insectChoices {
  width: 100% !important;
  max-width: min(1400px, 85vw) !important; 
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 140px !important;
}

#beastChoices,
#holyChoices,
#abyssChoices,
#natureChoices,
#curseChoices,
#insectChoices {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important; 
  width: 100% !important;
  max-width: 100% !important; 
  margin-left: auto !important;
  margin-right: auto !important;
  gap: 14px !important;
}

#machineChoices {
  display: grid !important;
  grid-template-columns: 1fr !important; 
  width: 100% !important;
  max-width: 33.33vw !important;         
  margin: 20px auto 140px auto !important; 
}

#machineChoices button.choice {
  width: 100% !important;
  max-width: none !important;
  min-height: 280px; 
  justify-content: flex-start !important;
  align-items: center !important;
}

#machineChoices .choiceComment {
  text-align: center !important;
  word-break: keep-all !important;
  margin-top: 15px !important;
}

#beastChoices button.choice,
#holyChoices button.choice,
#abyssChoices button.choice,
#natureChoices button.choice,
#curseChoices button.choice,
#insectChoices button.choice {
  min-height: 380px !important; 
}

#bloodChoices button.choice,
#beastChoices button.choice,
#holyChoices button.choice,
#abyssChoices button.choice,
#natureChoices button.choice,
#curseChoices button.choice,
#machineChoices button.choice,
#insectChoices button.choice {
  justify-content: flex-start !important; 
  align-items: center !important; 
}

#bloodChoices .choiceTitle,
#beastChoices .choiceTitle,
#holyChoices .choiceTitle,
#abyssChoices .choiceTitle,
#natureChoices .choiceTitle,
#curseChoices .choiceTitle,
#machineChoices .choiceTitle,
#insectChoices .choiceTitle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5em !important; 
  margin-bottom: 5px !important;
  width: 100%;
}

#bloodChoices .choiceComment,
#beastChoices .choiceComment,
#holyChoices .choiceComment,
#abyssChoices .choiceComment,
#natureChoices .choiceComment,
#curseChoices .choiceComment,
#machineChoices .choiceComment,
#insectChoices .choiceComment {
  display: block !important; 
  width: 100% !important;
  text-align: center !important; 
  margin-top: 10px !important;
  line-height: 1.6 !important; 
  word-break: keep-all !important; 
}

.reqBadge {
  order: 2;               
  position: relative !important;
  top: auto !important;
  right: auto !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: row !important; 
  flex-wrap: wrap !important;     
  justify-content: center !important; 
  gap: 6px !important;
  margin-top: 0 !important;
  margin-bottom: 12px !important; 
  pointer-events: none;
  z-index: 2;
}

.reqBadge span {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75); 
  border: 1px solid;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.reqBadge .reqStat {
  color: #ffcc66;
  border-color: rgba(255, 204, 102, 0.4);
}

.reqBadge .reqCond {
  color: #b3d9ff;
  border-color: rgba(179, 217, 255, 0.4);
}

.reqBadge .reqBonus {
  color: #ff8888;
  border-color: rgba(255, 136, 136, 0.4);
}

button.choice.selected .reqBadge span {
  background: rgba(20, 20, 20, 0.85);
  border-color: currentColor;
}

#physicalMeritChoices button.choice {
  padding-top: 18px !important;
}

#physicalMeritChoices .choiceTitle {
  margin-top: 16px !important; 
  padding-right: 0 !important;
}

.heavenly-title.melt {
  font-weight: 900 !important;
  font-size: 1.4em !important;
  letter-spacing: 0.15em;
  position: relative;
  display: inline-block;
  
  
  -webkit-text-stroke: 0 !important;
  
  
  animation: text-black-glitch 4s infinite linear;
}

.heavenly-title.melt::before,
.heavenly-title.melt::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  color: transparent; 
  pointer-events: none;
  z-index: -1; 
  -webkit-text-stroke: 0 !important;
}

.heavenly-title.melt::before {
  animation: dark-burst 4s infinite ease-out;
}

.heavenly-title.melt::after {
  animation: dark-burst 4s infinite ease-out 0.15s; 
}

@keyframes text-black-glitch {
  0%, 30% {
    
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    transform: none;
  }
  
  
  
  
  31% { color: #000000; transform: translateX(-12px) skewX(20deg); text-shadow: 15px 0 0 rgba(255, 255, 255, 0.8); }
  32% { color: #ffffff; transform: translateX(0); text-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
  
  
  34% { color: #000000; transform: translateX(15px) skewX(-25deg); text-shadow: -20px 0 0 rgba(150, 150, 150, 0.8); }
  35% { color: #ffffff; transform: translateX(0); text-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
  
  
  37% { color: transparent; transform: translateX(-5px); text-shadow: -15px 0 0 #000000, 15px 0 0 #555555; }
  38% { color: #ffffff; transform: translateX(0); text-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
  
  
  40% { color: #000000; transform: translateX(10px) skewX(10deg); text-shadow: -12px 0 0 rgba(0, 0, 0, 0.5); }
  
  
  42%, 70% {
    color: #000000;
    transform: none;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
  }
  
  
  75%, 100% {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    transform: none;
  }
}

@keyframes dark-burst {
  0%, 41% {
    
    text-shadow:
      0 0 0 rgba(0, 0, 0, 0),
      0 0 0 rgba(0, 0, 0, 0),
      0 0 0 rgba(0, 0, 0, 0),
      0 0 0 rgba(0, 0, 0, 0),
      0 0 0 rgba(0, 0, 0, 0),
      0 0 0 rgba(0, 0, 0, 0),
      0 0 0 rgba(0, 0, 0, 0),
      0 0 0 rgba(0, 0, 0, 0);
    transform: scale(1);
  }
  42% {
    
    text-shadow:
      0 0 0 rgba(0, 0, 0, 0.9),
      0 0 0 rgba(0, 0, 0, 0.9),
      0 0 0 rgba(0, 0, 0, 0.9),
      0 0 0 rgba(0, 0, 0, 0.9),
      0 0 0 rgba(0, 0, 0, 0.9),
      0 0 0 rgba(0, 0, 0, 0.9),
      0 0 0 rgba(0, 0, 0, 0.9),
      0 0 0 rgba(0, 0, 0, 0.9);
    transform: scale(1);
  }
  70%, 100% {
    
    text-shadow:
      0 -45px 10px rgba(0, 0, 0, 0),     
      0  45px 10px rgba(0, 0, 0, 0),     
     -45px  0 10px rgba(0, 0, 0, 0),     
      45px  0 10px rgba(0, 0, 0, 0),     
     -35px -35px 10px rgba(0, 0, 0, 0),  
      35px -35px 10px rgba(0, 0, 0, 0),  
     -35px  35px 10px rgba(0, 0, 0, 0),  
      35px  35px 10px rgba(0, 0, 0, 0);  
    transform: scale(1.3);
  }
}

#copyrightNoticeOverlay {
  position: fixed; inset: 0; z-index: 1000006; 
  background: rgba(0, 0, 0, 0.5); 
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; justify-content: center; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
  cursor: pointer; 
}
#copyrightNoticeOverlay.show {
  opacity: 1; pointer-events: auto;
}

#copyrightNoticeBox {
  
  background: rgba(117, 117, 117, 0.116); 
  
  
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  border: 2px dashed rgba(255, 255, 255, 0.4); 
  box-shadow: 0 20px 50px rgba(22, 22, 22, 0.6), inset 0 0 10px rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 40px 35px;
  max-width: 550px;
  width: 85%;
  text-align: center;
  transform: translateY(-20px);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: #e8e8e8;
  font-size: 1.1em;
  line-height: 1.8;
  word-break: keep-all;
}
#copyrightNoticeOverlay.show #copyrightNoticeBox {
  transform: translateY(0);
}

#customAlertOverlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

#customAlertOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

#customAlertBox {
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 30px 25px;
  max-width: 420px;
  width: 85%;
  text-align: center;
  transform: translateY(-20px);
  transition: transform 250ms ease;
}

#customAlertOverlay.show #customAlertBox {
  transform: translateY(0);
}

#customAlertText {
  color: #e8e8e8;
  font-size: 1.05em;
  line-height: 1.6;
  margin-bottom: 25px;
  white-space: pre-wrap;
  word-break: keep-all;
}

#alertCloseBtn {
  background: rgba(0,0,0,0.62);
  color: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 12px 30px;
  font-size: 1.05em;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: all 160ms ease;
  box-shadow: 0 4px 0 rgba(0,0,0,0.55);
}

#alertCloseBtn:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

#alertCloseBtn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.55);
}

#crimsonAlertOverlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: rgba(10, 0, 2, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

#crimsonAlertOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

.crimson-alert-box {
  position: relative;
  width: min(520px, 88vw);
  background: rgba(20, 4, 6, 0.92);
  border: 1px solid rgba(255, 60, 60, 0.35);
  box-shadow: 0 0 50px rgba(180, 0, 20, 0.45), inset 0 0 30px rgba(120, 0, 10, 0.25);
  padding: 26px 0;
  text-align: center;
  transform: translateY(-16px);
  transition: transform 250ms ease;
  overflow: hidden;
  cursor: pointer;
}

#crimsonAlertOverlay.show .crimson-alert-box {
  transform: translateY(0);
}

.crimson-alert-warning-line {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  height: 24px;
  background: rgba(255, 30, 30, 0.14);
  border-block: 1px solid rgba(255, 60, 60, 0.4);
  color: #ff5050;
  font-family: "Courier New", monospace;
  font-size: 0.68em;
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 24px;
  text-shadow: 0 0 8px rgba(255, 40, 40, 0.9);
  cursor: pointer;
}

.crimson-alert-warning-line-top {
  top: 48px;
}

.crimson-alert-warning-line-bottom {
  bottom: 48px;
}

.crimson-alert-track {
  display: flex;
  align-items: center;
  width: max-content;
  min-width: max-content;
  flex-wrap: nowrap;
  white-space: nowrap;
  will-change: transform;
}

.crimson-alert-warning-line-top .crimson-alert-track {
  animation: warning-marquee-left 7s linear infinite;
}

.crimson-alert-warning-line-bottom .crimson-alert-track {
  animation: warning-marquee-right 7s linear infinite;
}

.crimson-alert-core {
  padding: 0 28px;
}

.crimson-alert-text {
  color: #fff;
  font-size: 1.08em;
  font-weight: bold;
  line-height: 1.65;
  letter-spacing: 0.04em;
  white-space: pre-wrap;
  word-break: keep-all;
  text-shadow: 0 0 14px rgba(255, 40, 40, 0.95), 0 0 32px rgba(255, 20, 20, 0.5);
}

.crimson-alert-hint {
  margin-top: 20px;
  font-size: 0.66em;
  color: rgba(255, 170, 170, 0.5);
  letter-spacing: 0.16em;
}

.reqBadge {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: row !important; 
  flex-wrap: wrap !important;     
  justify-content: center !important; 
  gap: 6px !important;
  margin-top: 0 !important;
  margin-bottom: 14px !important; 
  pointer-events: none;
  z-index: 2;
}

.reqBadge span {
  font-size: 0.75rem !important;
  padding: 5px 10px !important;
  line-height: 1.3 !important;
  
  
  white-space: normal !important; 
  word-break: keep-all !important;
  text-align: center;
}

#physicalMeritChoices button.choice {
  justify-content: flex-start !important;
  padding-top: 22px !important;
}

#physicalMeritChoices .choiceTitle {
  margin-top: 0 !important;
}

.hermes-title.dash {
  font-weight: 900 !important;
  font-size: 1.35em !important;
  letter-spacing: 0.15em;
  position: relative;
  display: inline-block;
  
  
  color: transparent !important;
  -webkit-text-stroke: 0 transparent !important;
  text-shadow: none !important;
}

.hermes-title.dash::before {
  
  content: "AbWu9kCr";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  
  
  color: #e0ffff; 
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8), 0 0 20px rgba(0, 255, 255, 0.4);
  white-space: nowrap;
  
  
  animation: hermes-decode 3.5s infinite;
}

@keyframes hermes-decode {
  
  0%  { content: "A7bK9zXq"; opacity: 0; filter: blur(4px); transform: translateX(-10px); }
  2%  { content: "W$3vR!pL"; opacity: 1; filter: blur(0); transform: translateX(0); }
  
  
  4%  { content: "헤8Xq#mC"; }
  6%  { content: "헤L2@vT!"; }
  
  8%  { content: "헤르9$Zx"; }
  10% { content: "헤르B&4n"; }
  
  12% { content: "헤르메#V"; }
  14% { content: "헤르메7L"; }
  
  16% { content: "헤르메스!"; }
  18% { content: "헤르메스K@"; }
  
  20% { content: "헤르메스의_"; }
  22% { content: "헤르메스의8"; }
  
  24% { content: "헤르메스의 Z"; }
  26% { content: "헤르메스의 #"; }
  
  28% { content: "헤르메스의 전Q"; }
  30% { content: "헤르메스의 전$"; }
  
  
  32% { content: "헤르메스의 전령"; filter: brightness(1.5) drop-shadow(0 0 8px #00ffff); transform: scale(1.02); opacity: 1; }
  35% { content: "헤르메스의 전령"; filter: brightness(1); transform: scale(1); opacity: 1; }
  
  85% { content: "헤르메스의 전령"; filter: brightness(1); transform: scale(1); opacity: 1; text-shadow: 0 0 10px rgba(0, 255, 255, 0.8), 0 0 20px rgba(0, 255, 255, 0.4); }
  
  
  92% { content: "헤르메스의 전령"; opacity: 0.8; transform: scale(1.02); filter: blur(2px) drop-shadow(0 0 15px #00ffff); }
  100%{ content: "헤르메스의 전령"; opacity: 0; transform: scale(1.08) translateX(15px); filter: blur(6px); }
}

/* 🌐 영어 모드 전용 디코드 애니메이션 (동일한 노이즈 프레임, 최종 문구만 영어로) */
body.lang-en-active .hermes-title.dash::before {
  animation-name: hermes-decode-en;
}
@keyframes hermes-decode-en {

  0%  { content: "A7bK9zXq"; opacity: 0; filter: blur(4px); transform: translateX(-10px); }
  2%  { content: "W$3vR!pL"; opacity: 1; filter: blur(0); transform: translateX(0); }


  4%  { content: "H8Xq#mC"; }
  6%  { content: "HL2@vT!"; }

  8%  { content: "He9$Zx"; }
  10% { content: "HeB&4n"; }

  12% { content: "Herm#V"; }
  14% { content: "Herm7L"; }

  16% { content: "Hermes!"; }
  18% { content: "HermesK@"; }

  20% { content: "Hermes'_"; }
  22% { content: "Hermes'8"; }

  24% { content: "Hermes' Z"; }
  26% { content: "Hermes' #"; }

  28% { content: "Hermes' HerQ"; }
  30% { content: "Hermes' Her$"; }


  32% { content: "Hermes' Herald"; filter: brightness(1.5) drop-shadow(0 0 8px #00ffff); transform: scale(1.02); opacity: 1; }
  35% { content: "Hermes' Herald"; filter: brightness(1); transform: scale(1); opacity: 1; }

  85% { content: "Hermes' Herald"; filter: brightness(1); transform: scale(1); opacity: 1; text-shadow: 0 0 10px rgba(0, 255, 255, 0.8), 0 0 20px rgba(0, 255, 255, 0.4); }


  92% { content: "Hermes' Herald"; opacity: 0.8; transform: scale(1.02); filter: blur(2px) drop-shadow(0 0 15px #00ffff); }
  100%{ content: "Hermes' Herald"; opacity: 0; transform: scale(1.08) translateX(15px); filter: blur(6px); }
}

.intro-zoom {
  animation: zoom-in-fade 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes zoom-in-fade {
  0% { 
    transform: scale(1); 
    filter: blur(0); 
    opacity: 1; 
  }
  100% { 
    transform: scale(2.5); 
    filter: blur(25px);    
    opacity: 0;            
  }
}

.upside-down-enter {
  animation: wake-up-look-back 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes wake-up-look-back {
  0% { transform: perspective(1200px) rotateX(90deg) translateY(-80vh) scale(1.2); opacity: 0; filter: blur(15px); }
  100% { transform: perspective(1200px) rotateX(0deg) translateY(0) scale(1); opacity: 1; filter: blur(0); }
}

.blackout {
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.blackout.show {
  opacity: 1;
}

.shatterOverlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  overflow: hidden;
}

.shard {
  position: absolute;
  transform: translate(-50%, -50%);
  opacity: 0;
  will-change: transform, opacity, filter;
}
.shatterOverlay.play .shard {
  animation: shardDrop var(--dur, 980ms) both;
  animation-delay: var(--delay, 0ms);
}
@keyframes shardDrop {
  0% { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--drift), var(--fall)) rotate(var(--rot)) scale(var(--sc)); }
}

.shard.mono-glass { background: #aaa; border: 1px solid #444; border-radius: 2px; }
.shard.mono-glass:nth-child(even) { background: #e0e0e0; border-color: #222; }
.shard.mono-glass:nth-child(3n) { background: #333; }

.black-shred {
  position: absolute;
  top: -15vh;
  height: 130vh;
  background: #000;
  transform-origin: center;
  will-change: transform, opacity;
}
.shatterOverlay.play .black-shred {
  animation: screen-shred 1s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes screen-shred {
  0% { transform: translate(0, 0) rotate(0deg) skewX(0deg) scale(1.05); opacity: 1; }
  100% { transform: translate(var(--xDir), var(--yDir)) rotate(var(--rot)) skewX(var(--skew)) scale(0.8); opacity: 0; }
}

.god-eye-title.gaze {
  font-weight: 900 !important;
  font-size: 1.35em !important;
  letter-spacing: 0.15em;
  position: relative;
  display: inline-block;
  
  
  color: #00ffff !important;
  
  
  filter: drop-shadow(0 0 2px rgba(0, 255, 255, 0.8));
  animation: eye-focus 2s infinite ease-in-out;
}

.god-eye-title.gaze::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px rgba(0, 255, 255, 0.5);
  animation: future-ghost 2s infinite steps(4); 
}

.god-eye-title.gaze::after {
  content: "";
  position: absolute;
  left: -10%;
  top: 50%;
  width: 120%;
  height: 2px;
  background: rgba(0, 255, 255, 0.8);
  box-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
  pointer-events: none;
  z-index: 2;
  animation: eye-scanner 3s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes eye-focus {
  0%, 100% { transform: scale(1); filter: brightness(1.2) contrast(1.2); }
  5%, 10% { transform: scale(1.02) translateX(1px); filter: brightness(1.5); }
  15% { transform: scale(1) translateX(-1px); }
}

@keyframes future-ghost {
  0%, 100% { transform: translate(0, 0); opacity: 0; }
  20% { transform: translate(4px, -2px); opacity: 0.6; }
  40% { transform: translate(-3px, 2px); opacity: 0.4; }
  60% { transform: translate(2px, 1px); opacity: 0.6; }
  80% { transform: translate(-2px, -1px); opacity: 0.3; }
}

@keyframes eye-scanner {
  0% { top: 10%; opacity: 0; }
  10% { opacity: 1; }
  50% { top: 90%; opacity: 1; }
  90% { opacity: 1; }
  100% { top: 10%; opacity: 0; }
}

.wake-up-ready {
  opacity: 0;
  filter: blur(25px);
  transform: translateY(-100px);
}

.wake-up-active {
  animation: wake-up-smooth 2.2s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

@keyframes wake-up-smooth {
  0% {
    opacity: 0;
    filter: blur(25px);
    transform: translateY(-100px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

body.interaction-locked,
body.interaction-locked * {
  pointer-events: none !important;
}

.settings-btn {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10000;
  
  
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  
  
  transition: opacity 2s ease, transform 2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.settings-btn.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255,255,255,0.1);
}

.settings-btn svg {
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.settings-btn:hover svg {
  transform: rotate(90deg);
}

#scene2.centerOnce {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80vh; 
  margin: 0 auto;
}

.intro-blackout {
  position: fixed;
  inset: 0;
  
  background: #2a2a2c; 
  z-index: 999995; 
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease-in-out;
}
.intro-blackout.show {
  opacity: 1;
  pointer-events: auto;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 100005; 
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.settings-modal.show {
  opacity: 1;
  pointer-events: auto;
}

/* 🌟 모든 설정창 배경을 완전한 검은색 & 직각으로 통일 */
.settings-content {
  background: #000000 !important; 
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 0 !important; 
  padding: 40px 30px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  text-align: center;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

/* 🌟 음악 모달창 무조건 보이고 좌측 하단에 고정되도록 강제 */
#musicModal {
  background: transparent !important; /* 모달 전체 뒷배경 투명 */
  justify-content: flex-start !important;
  align-items: flex-end !important;
  padding: 20px 0 90px 20px !important; /* 하단 여백을 90px로 늘려 위로 올림 */
  pointer-events: none !important; /* 빈 공간 클릭 통과 */
}
#musicModal.show {
  opacity: 1 !important;
}
#musicModal .music-modal-content {
  pointer-events: auto !important; /* 창 자체는 클릭되게 */
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  width: 90vw !important;
  max-width: 600px !important; /* 가로 길이를 600px로 확장 */
}
#musicModal .close-btn {
  top: 15px !important;
  right: 15px !important;
  z-index: 1000 !important;
}

.settings-modal.show .settings-content {
  transform: translateY(0);
}

.settings-content h3 {
  margin: 0 0 30px 0;
  font-size: 1.6em;
  color: #e8e8e8;
  letter-spacing: 0.05em;
}

.settings-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 40px;
}

.settings-row label {
  font-size: 1.1em;
  color: #ccc;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none; 
  width: 100%;
  background: transparent;
}
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none; 
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  margin-top: -7px;
  box-shadow: 0 0 12px rgba(255,255,255,0.5);
  transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

#volumeValue {
  font-size: 0.95em;
  color: #aaa;
  font-weight: bold;
}

.pick-count {
  font-size: 0.8em;
  color: #ff8888;
  font-weight: 700;
  margin-left: 6px;
  background: rgba(255, 0, 0, 0.15);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 136, 136, 0.3);
  display: inline-block;
  vertical-align: middle;
}

.hidden-title {
  position: relative;
  display: inline-block;
  font-size: 1.15em !important;
  font-weight: 900 !important;
  letter-spacing: 0.05em;
  z-index: 1;
}

.effect-archetype { 
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

.effect-archetype::before,
.effect-archetype::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  color: transparent !important; 
  pointer-events: none;
  z-index: 2; 
  opacity: 0; 
}

button#pickArchetypeBtn.selected {
  background: #e5e5e5 !important; 
  color: #000000 !important;      
  border-color: #ffffff !important;
  z-index: 10 !important;
  animation: archetype-invert-flash 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
}

button#pickArchetypeBtn.selected .choiceTitle,
button#pickArchetypeBtn.selected .choiceComment,
button#pickArchetypeBtn.selected .choiceComment span,
button#pickArchetypeBtn.selected .hidden-flavor-text,
button#pickArchetypeBtn.selected .choicePP {
  color: #111111 !important;
  text-shadow: none !important;
}

button#pickArchetypeBtn.selected .effect-archetype {
  color: #000000 !important;
  font-weight: 900 !important;
  letter-spacing: 0.05em;
  animation: archetype-body-heartbeat 4s infinite ease-in-out;
}

button#pickArchetypeBtn.selected .effect-archetype::before {
  animation: archetype-smooth-implode 4s infinite ease-in;
}

@keyframes archetype-invert-flash {
  0% { filter: invert(1) grayscale(1) brightness(2); transform: scale(0.9) translateY(2px); box-shadow: 0 0 50px rgba(255, 255, 255, 1); }
  50% { filter: invert(0.2) grayscale(1) brightness(1.5); transform: scale(1.02) translateY(2px); }
  100% { filter: invert(0) grayscale(0) brightness(1); transform: scale(1) translateY(2px); box-shadow: 0 0 30px rgba(255, 255, 255, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.2); }
}

@keyframes archetype-body-heartbeat {
  0%, 55% { transform: scale(1); text-shadow: none; }
  
  
  59%, 60% { transform: scale(0.96); text-shadow: none; }
  
  
  62% { transform: scale(1.08); text-shadow: 0 0 15px rgba(0, 0, 0, 0.9); }
  
  
  80%, 100% { transform: scale(1); text-shadow: none; }
}

@keyframes archetype-smooth-implode {
  0%, 15% {
    opacity: 0;
    transform: scale(1.6);
    text-shadow: 
      -40px -40px 30px rgba(0,0,0,0),
       40px  40px 30px rgba(0,0,0,0),
      -40px  40px 30px rgba(0,0,0,0),
       40px -40px 30px rgba(0,0,0,0);
    filter: blur(10px);
  }
  25% {
    opacity: 0.6;
    transform: scale(1.4);
    text-shadow: 
      -30px -30px 20px rgba(0,0,0,0.3),
       30px  30px 20px rgba(0,0,0,0.3),
      -30px  30px 20px rgba(0,0,0,0.3),
       30px -30px 20px rgba(0,0,0,0.3);
    filter: blur(6px);
  }
  55% {
    opacity: 1;
    transform: scale(1.08); 
    text-shadow: 
      -10px -10px 10px rgba(0,0,0,0.9),
       10px  10px 10px rgba(0,0,0,0.9),
      -10px  10px 10px rgba(0,0,0,0.9),
       10px -10px 10px rgba(0,0,0,0.9);
    filter: blur(1.5px);
  }
  60% {
    
    opacity: 1;
    transform: scale(0.96);
    text-shadow: 0 0 0 rgba(0,0,0,1);
    filter: blur(0px);
  }
  61%, 100% {
    
    opacity: 0;
    transform: scale(0.96);
    text-shadow: 0 0 0 rgba(0,0,0,0);
  }
}

.effect-fenrir {
  position: relative;
  display: inline-block;
  color: #a30000;
  text-shadow: 1px 1px 2px #000;
  animation: fenrir-shake 2.5s infinite; 
}

.effect-fenrir::before {
  content: "";
  position: absolute;
  top: -80%; left: -30%;
  width: 160%; height: 260%; 
  z-index: 2;
  pointer-events: none;
  
  
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M30,5 L31,50 L30,95 L29,50 Z M50,0 L51,50 L50,100 L49,50 Z M70,5 L71,50 L70,95 L69,50 Z' fill='%23ff1a1a'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  
  opacity: 0;
  
  animation: fenrir-claw 2.5s infinite ease-out; 
}

.effect-fenrir::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  z-index: -1;
  color: #ff1a1a;
  pointer-events: none;
  opacity: 0;
  animation: fenrir-slash 2.5s infinite ease-out; 
}

@keyframes fenrir-shake {
  0%, 74% { transform: translate(0, 0); }
  75% { transform: translate(-3px, 3px); filter: brightness(1.2); }
  77% { transform: translate(2px, -2px); }
  79% { transform: translate(0, 0); filter: brightness(1); }
  85% { transform: translate(4px, 3px); filter: brightness(1.5); text-shadow: 0 0 10px #ff0000; }
  87% { transform: translate(-3px, -2px); }
  90%, 100% { transform: translate(0, 0); }
}

@keyframes fenrir-claw {
  0%, 73% { opacity: 0; transform: scale(1.2) rotate(35deg); clip-path: inset(0 0 100% 0); }
  
  
  74% { opacity: 1; transform: scale(1) rotate(35deg); filter: drop-shadow(0 0 5px #ff0000); clip-path: inset(0 0 100% 0); }
  76% { clip-path: inset(0 0 0 0); } 
  79% { opacity: 0; transform: scale(1.05) rotate(35deg) translate(-2%, 2%); }
  
  
  80%, 83% { opacity: 0; transform: scale(1.2) rotate(-35deg); clip-path: inset(0 0 100% 0); }
  
  
  84% { opacity: 1; transform: scale(1) rotate(-35deg); filter: drop-shadow(0 0 8px #ff0000) brightness(1.5); clip-path: inset(0 0 100% 0); }
  86% { clip-path: inset(0 0 0 0); } 
  89% { opacity: 0; transform: scale(1.05) rotate(-35deg) translate(2%, 2%); }
  
  100% { opacity: 0; transform: scale(1.2) rotate(-35deg); clip-path: inset(0 0 100% 0); }
}

@keyframes fenrir-slash {
  0%, 74% { opacity: 0; transform: translate(0, 0); clip-path: polygon(0 0, 100% 0, 100% 20%, 0 80%); }
  
  76% { opacity: 0.8; transform: translate(-4px, -4px) skewX(-5deg); text-shadow: 0 0 10px red; clip-path: polygon(0 0, 100% 0, 100% 20%, 0 80%); }
  80% { opacity: 0; transform: translate(-8px, -8px); clip-path: polygon(0 0, 100% 0, 100% 20%, 0 80%); }
  
  84% { opacity: 0; transform: translate(0, 0); clip-path: polygon(0 0, 100% 0, 100% 80%, 0 20%); }
  
  86% { opacity: 1; transform: translate(4px, -4px) skewX(5deg); text-shadow: 0 0 15px red; clip-path: polygon(0 0, 100% 0, 100% 80%, 0 20%); }
  90% { opacity: 0; transform: translate(8px, -8px); clip-path: polygon(0 0, 100% 0, 100% 80%, 0 20%); }
  100% { opacity: 0; }
}

.hidden-flavor-text {
  order: 3;
  width: 100%;
  text-align: center;
  font-size: 1.05em;
  font-weight: bold;
  color: #d2d2d2;
  margin-top: 2px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

#hiddenRaceChoices button.choice[data-race="세라핌"] .choiceTitle {
  margin-top: 55px !important; 
}

#hiddenRaceChoices button.choice[data-race="세라핌"] .hidden-flavor-text {
  margin-top: 80px !important;
}

.effect-seraphim {
  position: relative;
  display: inline-block;
  isolation: isolate;
  color: #ffffff;
  
  
  text-shadow: 
    -1px -1px 0px rgba(0, 50, 100, 0.8),
     1px -1px 0px rgba(0, 50, 100, 0.8),
    -1px  1px 0px rgba(0, 50, 100, 0.8),
     1px  1px 0px rgba(0, 50, 100, 0.8),
     0 0 10px #66b3ff,
     0 0 20px #0066cc;
     
  animation: seraphim-breathe 2.5s infinite alternate ease-in-out;
}

.effect-seraphim::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  
  width: 320%;
  height: 320%;
  z-index: -1;
  pointer-events: none;

  
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23d9d9d9'/%3E%3Cstop offset='50%25' stop-color='%238c8c8c'/%3E%3Cstop offset='100%25' stop-color='%23404040'/%3E%3C/linearGradient%3E%3Cfilter id='sdw'%3E%3CfeDropShadow dx='0' dy='8' stdDeviation='6' flood-color='%23000' flood-opacity='0.8'/%3E%3C/filter%3E%3Cg id='eye'%3E%3Cpath d='M-27,0 C-12,-21 12,-21 27,0 C12,21 -12,21 -27,0 Z' fill='%23b3b3b3' stroke='%238a2e2e' stroke-width='3'/%3E%3Cpath d='M-23,0 C-10,-15 10,-15 23,0 C10,15 -10,15 -23,0 Z' fill='%23f2f2f2'/%3E%3Ccircle cx='0' cy='0' r='8.5' fill='%231a75ff'/%3E%3Ccircle cx='0' cy='0' r='4' fill='%23000'/%3E%3Ccircle cx='-2' cy='-2' r='2' fill='%23fff'/%3E%3C/g%3E%3Cg id='ring'%3E%3Ccircle cx='250' cy='250' r='180' fill='none' stroke='url(%23bg)' stroke-width='45' filter='url(%23sdw)'/%3E%3Ccircle cx='250' cy='250' r='200' fill='none' stroke='%23fff' stroke-width='2' opacity='0.4'/%3E%3Ccircle cx='250' cy='250' r='160' fill='none' stroke='%23000' stroke-width='3' opacity='0.5'/%3E%3Cg id='eyes'%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(0 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(22.5 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(45 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(67.5 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(90 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(112.5 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(135 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(157.5 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(180 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(202.5 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(225 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(247.5 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(270 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(292.5 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(315 250 250)'/%3E%3Cuse href='%23eye' x='250' y='70' transform='rotate(337.5 250 250)'/%3E%3Cuse href='%23eye' x='250' y='52' transform='rotate(12 250 250) scale(0.6)'/%3E%3Cuse href='%23eye' x='250' y='88' transform='rotate(34 250 250) scale(0.7)'/%3E%3Cuse href='%23eye' x='250' y='52' transform='rotate(56 250 250) scale(0.8)'/%3E%3Cuse href='%23eye' x='250' y='88' transform='rotate(78 250 250) scale(0.5)'/%3E%3Cuse href='%23eye' x='250' y='52' transform='rotate(100 250 250) scale(0.7)'/%3E%3Cuse href='%23eye' x='250' y='88' transform='rotate(122 250 250) scale(0.8)'/%3E%3Cuse href='%23eye' x='250' y='52' transform='rotate(144 250 250) scale(0.6)'/%3E%3Cuse href='%23eye' x='250' y='88' transform='rotate(166 250 250) scale(0.7)'/%3E%3Cuse href='%23eye' x='250' y='52' transform='rotate(188 250 250) scale(0.8)'/%3E%3Cuse href='%23eye' x='250' y='88' transform='rotate(210 250 250) scale(0.5)'/%3E%3Cuse href='%23eye' x='250' y='52' transform='rotate(232 250 250) scale(0.7)'/%3E%3Cuse href='%23eye' x='250' y='88' transform='rotate(254 250 250) scale(0.8)'/%3E%3Cuse href='%23eye' x='250' y='52' transform='rotate(276 250 250) scale(0.6)'/%3E%3Cuse href='%23eye' x='250' y='88' transform='rotate(298 250 250) scale(0.7)'/%3E%3Cuse href='%23eye' x='250' y='52' transform='rotate(320 250 250) scale(0.8)'/%3E%3Cuse href='%23eye' x='250' y='88' transform='rotate(342 250 250) scale(0.5)'/%3E%3C/g%3E%3C/g%3E%3C/defs%3E%3Cg transform='translate(250, 250)'%3E%3Cg transform='rotate(15) scale(1, 0.25)'%3E%3Cg%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 0 0' to='-360 0 0' dur='14s' repeatCount='indefinite'/%3E%3Cuse href='%23ring' x='-250' y='-250'/%3E%3C/g%3E%3C/g%3E%3Cg transform='rotate(-40) scale(0.95, 0.3)'%3E%3Cg%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 0 0' to='360 0 0' dur='11s' repeatCount='indefinite'/%3E%3Cuse href='%23ring' x='-250' y='-250'/%3E%3C/g%3E%3C/g%3E%3Cg transform='rotate(60) scale(0.85, 0.28)'%3E%3Cg%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 0 0' to='-360 0 0' dur='8s' repeatCount='indefinite'/%3E%3Cuse href='%23ring' x='-250' y='-250'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;

  
  animation: seraphim-wheel-glitch 3.2s infinite;
}

.effect-seraphim::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: #050505;
  z-index: 2;
  text-shadow: -3px 0 6px rgba(200, 0, 0, 0.9), 3px 0 6px rgba(80, 0, 150, 0.9);
  pointer-events: none;
  opacity: 0;
  
  
  animation: seraphim-text-glitch 3.2s infinite;
}

@keyframes seraphim-breathe {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.3) drop-shadow(0 0 6px rgba(100, 180, 255, 0.6)); }
}

@keyframes seraphim-wheel-glitch {
  0%, 35% { filter: brightness(1); clip-path: inset(0 0 0 0); }
  
  
  36% { filter: brightness(0.5) sepia(1) hue-rotate(180deg) saturate(5); clip-path: inset(20% 0 60% 0); transform: translate(-50%, -50%) skewX(-15deg); }
  37%, 38% { filter: invert(1) drop-shadow(0 0 10px #f00); clip-path: inset(50% 0 20% 0); transform: translate(-50%, -50%) skewX(10deg); }
  39%, 68% { filter: brightness(1); clip-path: inset(0 0 0 0); transform: translate(-50%, -50%) skewX(0); }
  
  
  69% { filter: sepia(1) hue-rotate(-50deg) saturate(10) brightness(0.7); clip-path: polygon(0 10%, 100% 30%, 100% 40%, 0 20%); transform: translate(-50%, -50%) scaleY(1.1); }
  70%, 71% { filter: brightness(0); clip-path: polygon(0 70%, 100% 60%, 100% 90%, 0 80%); transform: translate(-50%, -50%) skewY(10deg); }
  72%, 92% { filter: brightness(1); clip-path: inset(0 0 0 0); transform: translate(-50%, -50%); }
  
  
  93%, 94% { filter: invert(0.8) sepia(1) saturate(5) hue-rotate(-50deg); clip-path: inset(45% 0 40% 0); transform: translate(-50%, -50%) skew(-20deg); }
  95%, 100% { filter: brightness(1); clip-path: inset(0 0 0 0); transform: translate(-50%, -50%); }
}

@keyframes seraphim-text-glitch {
  0%, 35% { opacity: 0; transform: translate(0, 0) skew(0deg); clip-path: inset(0 0 0 0); }
  36% { opacity: 1; transform: translate(-5px, 2px) skewX(-20deg); clip-path: inset(20% 0 60% 0); }
  37%, 38% { opacity: 0.9; transform: translate(6px, -3px) skewX(10deg); clip-path: inset(50% 0 20% 0); text-shadow: -4px 0 10px #ff0000; }
  39%, 68% { opacity: 0; transform: translate(0, 0); clip-path: inset(0 0 0 0); }
  69% { opacity: 1; transform: translate(4px, 0) scaleY(1.4); clip-path: inset(10% 0 70% 0); text-shadow: 0 0 15px #aa0000; }
  70%, 71% { opacity: 1; transform: translate(-4px, 2px) scaleX(1.2) skewY(10deg); clip-path: inset(80% 0 5% 0); }
  72%, 92% { opacity: 0; transform: translate(0, 0); }
  93%, 94% { opacity: 1; transform: translate(-3px, 4px) skew(-30deg); clip-path: inset(45% 0 40% 0); filter: brightness(0.5); }
  95%, 100% { opacity: 0; transform: translate(0, 0); }
}

.effect-vampire {
  position: relative;
  display: inline-block;
  isolation: isolate;
  color: #7a0000; 
  text-shadow: 0 0 5px rgba(255, 0, 0, 0.4), 0 0 15px rgba(200, 0, 0, 0.2);
  animation: true-blood-pulse 1.5s infinite;
}

.effect-vampire::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0; z-index: -1;
  color: transparent; pointer-events: none;
  animation: true-blood-mist 1.5s infinite ease-out;
}

.effect-vampire::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0; z-index: 1;
  color: #ff1a1a; pointer-events: none;
  clip-path: polygon(0 45%, 100% 35%, 100% 55%, 0 45%); 
  animation: true-blood-slash 1.5s infinite;
}

@keyframes true-blood-pulse {
  0%, 70%, 100% { transform: scale(1); color: #7a0000; text-shadow: 0 0 5px rgba(255, 0, 0, 0.4), 0 0 15px rgba(200, 0, 0, 0.2); }
  75% { transform: scale(1.04); color: #a30000; text-shadow: 0 0 10px #ff0000, 0 0 25px #aa0000, 0 0 40px #550000; }
  80% { transform: scale(1); }
  85% { transform: scale(1.08); color: #ff0000; text-shadow: 0 0 15px #ff0000, 0 0 35px #dd0000, 0 0 60px #880000; }
  95% { transform: scale(1); }
}

@keyframes true-blood-mist {
  0%, 70% { text-shadow: 0 0 0 rgba(255, 0, 0, 0); transform: translateY(0) scale(1); opacity: 0; filter: blur(0px); }
  85% { text-shadow: 0 -10px 10px rgba(255, 0, 0, 0.8), 0 -20px 20px rgba(200, 0, 0, 0.6); transform: translateY(-3px) scale(1.05); opacity: 1; filter: blur(2px); }
  100% { text-shadow: 0 -25px 20px rgba(150, 0, 0, 0), 0 -40px 30px rgba(100, 0, 0, 0); transform: translateY(-8px) scale(1.1); opacity: 0; filter: blur(6px); }
}

@keyframes true-blood-slash {
  0%, 74% { opacity: 0; transform: scaleX(0.8); }
  75% { opacity: 0.6; clip-path: polygon(0 45%, 100% 35%, 100% 55%, 0 45%); transform: scaleX(1.03); }
  80% { opacity: 0; }
  85% { opacity: 1; clip-path: polygon(0 55%, 100% 45%, 100% 65%, 0 55%); transform: scaleX(1.12); filter: brightness(1.5) drop-shadow(0 0 8px #ff0000); }
  90%, 100% { opacity: 0; transform: scaleX(1); }
}

.effect-deus { 
  position: relative;
  display: inline-block;
  color: #c98a4b; 
  
  
  animation: deus-engine-body 4s infinite linear; 
}

.effect-deus::before, .effect-deus::after {
  content: "⚙"; 
  position: absolute; 
  top: 50%; 
  color: rgba(200, 130, 60, 0.95); 
  font-size: 1.25em;
  font-family: sans-serif; 
  pointer-events: none;
  margin-top: -0.55em; 
}

.effect-deus::before { 
  left: -24px; 
  animation: deus-gear-left 4s infinite linear; 
}

.effect-deus::after { 
  right: -24px; 
  animation: deus-gear-right 4s infinite linear; 
}

@keyframes deus-engine-body {
  
  0%, 8%, 16%, 24%, 32%, 40% { 
    transform: translate(0, 0); 
    text-shadow: 0 0 5px rgba(200, 130, 60, 0.4); 
  }
  2%, 10%, 18%, 26%, 34% { 
    transform: translate(-1px, -1px); 
    text-shadow: 0 0 8px rgba(255, 150, 0, 0.6); 
  }
  4%, 12%, 20%, 28%, 36% { 
    transform: translate(1px, 1px); 
    text-shadow: 0 0 6px rgba(255, 100, 0, 0.5); 
  }
  6%, 14%, 22%, 30%, 38% { 
    transform: translate(-1px, 1px); 
    text-shadow: 0 0 10px rgba(255, 120, 0, 0.7); 
  }

  
  41%, 45% { 
    transform: translate(0, 0); 
    text-shadow: 0 0 5px rgba(200, 130, 60, 0.4); 
  }

  
  46% { 
    transform: translateY(-2px); 
    text-shadow: 0 0 15px rgba(255, 170, 80, 0.9); 
  }

  
  55%, 100% { 
    transform: translateY(0); 
    text-shadow: 0 0 5px rgba(200, 130, 60, 0.4); 
  }
}

@keyframes deus-gear-left {
  
  0% { transform: rotate(0deg); text-shadow: 0 0 0 rgba(240,240,240,0); }
  40% { transform: rotate(-720deg); text-shadow: 0 0 0 rgba(240,240,240,0); }
  
  
  41%, 45% { transform: rotate(-720deg); text-shadow: 0 0 0 rgba(240,240,240,0); }
  
  
  46% { 
    transform: rotate(-720deg); 
    text-shadow: 
      -4px 4px 6px rgba(255,255,255,0.9),
      -8px 8px 12px rgba(230,230,230,0.8);
  }
  
  
  55% {
    transform: rotate(-720deg); 
    text-shadow: 
      -18px 18px 15px rgba(255,255,255,0.7),
      -30px 30px 25px rgba(200,200,200,0.5);
  }
  
  
  75%, 100% {
    transform: rotate(-720deg); 
    text-shadow: 
      -30px 30px 25px rgba(255,255,255,0),
      -50px 50px 40px rgba(200,200,200,0);
  }
}

@keyframes deus-gear-right {
  
  0% { transform: rotate(0deg); text-shadow: 0 0 0 rgba(240,240,240,0); }
  40% { transform: rotate(720deg); text-shadow: 0 0 0 rgba(240,240,240,0); }
  
  
  41%, 45% { transform: rotate(720deg); text-shadow: 0 0 0 rgba(240,240,240,0); }
  
  
  46% { 
    transform: rotate(720deg); 
    text-shadow: 
      4px 4px 6px rgba(255,255,255,0.9),
      8px 8px 12px rgba(230,230,230,0.8);
  }
  
  
  55% {
    transform: rotate(720deg); 
    text-shadow: 
      18px 18px 15px rgba(255,255,255,0.7),
      30px 30px 25px rgba(200,200,200,0.5);
  }
  
  
  75%, 100% {
    transform: rotate(720deg); 
    text-shadow: 
      30px 30px 25px rgba(255,255,255,0),
      50px 50px 40px rgba(200,200,200,0);
  }
}

.effect-abaddon {
  position: relative;
  display: inline-block;
  isolation: isolate;
  
  
  color: transparent !important;
  text-shadow: none !important;
  -webkit-text-stroke: 0 transparent !important;
}

.effect-abaddon::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: #000000;
  z-index: 2;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.1);
  
  
  animation: abaddon-glitch-black 2.1s infinite;
}

.effect-abaddon::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: #8a8a8a;
  z-index: 1;
  
  
  animation: abaddon-glitch-gray 1.45s infinite;
}

@keyframes abaddon-glitch-black {
  0%, 14% { transform: translate(0, 0) skew(0deg) scale(1); clip-path: inset(0 0 0 0); }
  
  
  15% { transform: translate(-8px, 2px) skewX(25deg) scaleX(1.1); clip-path: inset(10% 0 40% 0); }
  16%, 17% { transform: translate(5px, -6px) skewX(-15deg) scaleY(1.2); clip-path: inset(50% 0 10% 0); }
  18%, 35% { transform: translate(0, 0) skew(0deg) scale(1); clip-path: inset(0 0 0 0); } 
  
  
  36%, 38% { transform: translate(-3px, 7px) skewY(10deg); clip-path: inset(80% 0 5% 0); }
  39%, 55% { transform: translate(2px, -1px); clip-path: inset(0 0 0 0); } 
  
  
  56% { transform: translate(9px, -8px) scaleX(1.3); clip-path: inset(20% 0 60% 0); }
  57%, 59% { transform: translate(-6px, 9px) scaleX(0.8); clip-path: inset(0 0 0 0); }
  60%, 82% { transform: translate(0, 0); } 
  
  
  83%, 85% { transform: translate(-7px, -4px) skewX(-30deg); clip-path: inset(60% 0 30% 0); }
  86%, 100% { transform: translate(0, 0) skew(0deg); clip-path: inset(0 0 0 0); }
}

@keyframes abaddon-glitch-gray {
  0%, 8% { transform: translate(0, 0) scale(1); opacity: 1; clip-path: inset(0 0 0 0); }
  
  
  9%, 10% { transform: translate(7px, -3px) skewX(-20deg); opacity: 0.4; clip-path: inset(15% 0 45% 0); }
  11%, 14% { transform: translate(-10px, 8px) skewX(30deg) scaleY(1.4); opacity: 0.9; clip-path: inset(70% 0 5% 0); }
  15%, 32% { transform: translate(0, 0) scale(1) skewX(0); opacity: 1; clip-path: inset(0 0 0 0); } 
  
  
  33%, 34% { transform: translate(5px, 6px); opacity: 0.2; }
  35%, 45% { transform: translate(-3px, -5px); opacity: 0.8; }
  
  
  46%, 47% { transform: translate(-12px, -2px) scaleX(1.5); opacity: 0.5; clip-path: inset(5% 0 80% 0); }
  48%, 70% { transform: translate(0, 0) scaleX(1); opacity: 1; clip-path: inset(0 0 0 0); }
  
  
  71%, 73% { transform: translate(8px, -8px) skewY(-15deg); opacity: 0.6; clip-path: inset(35% 0 25% 0); }
  74%, 80% { transform: translate(-6px, 3px) skewY(0); opacity: 1; clip-path: inset(0 0 0 0); }
  81%, 82% { transform: translate(10px, 10px) scale(0.9); opacity: 0.3; }
  83%, 100% { transform: translate(0, 0) scale(1); opacity: 1; }
}

.effect-goetia {
  position: relative;
  display: inline-block;
  isolation: isolate;

  
  color: #e70000;
  text-shadow: none;
  
  
  animation: goetia-breathe 2.5s infinite alternate ease-in-out;
}

.effect-goetia::before {
  content: ""; 
  position: absolute;
  top: 50%;
  left: 50%;
  
  
  width: 2.6em;
  height: 2.6em;
  
  
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='15' y='15' width='70' height='70' fill='none' stroke='rgba(180,20,20,0.4)' stroke-width='2.5'/%3E%3Crect x='15' y='15' width='70' height='70' fill='none' stroke='rgba(180,20,20,0.4)' stroke-width='2.5' transform='rotate(45 50 50)'/%3E%3Ccircle cx='50' cy='50' r='8' fill='rgba(180,20,20,0.4)'/%3E%3Ccircle cx='50' cy='50' r='24' fill='none' stroke='rgba(180,20,20,0.3)' stroke-width='1.5'/%3E%3C/svg%3E"),
    radial-gradient(circle, rgba(120, 0, 0, 0.8) 10%, rgba(40, 0, 0, 0.9) 60%, rgba(10, 0, 0, 1) 90%, transparent 100%);
  background-position: center;
  
  background-size: 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  
  
  border-radius: 50%;
  border: 1px dashed rgba(200, 30, 30, 0.6); 
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.9),        
    0 0 0 3px rgba(150, 0, 0, 0.4),      
    0 0 10px rgba(200, 0, 0, 0.3),       
    inset 0 0 10px rgba(200, 0, 0, 0.5); 
  
  z-index: -1;
  pointer-events: none;
  
  
  animation: goetia-magic-circle 12s linear infinite;
}

.effect-goetia::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  
  color: #ff3300; 
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: color-dodge; 
  
  animation: goetia-flame 2s infinite ease-in;
}

@keyframes goetia-breathe {
  0% { filter: brightness(0.9) contrast(1.1); }
  100% { filter: brightness(1.2) contrast(1.3); }
}

@keyframes goetia-magic-circle {
  0% { 
    transform: translate(-50%, -50%) rotate(0deg) scale(0.85); 
    opacity: 0.8; 
  }
  50% { 
    transform: translate(-50%, -50%) rotate(180deg) scale(0.95); 
    opacity: 1; 
    border-color: rgba(200, 50, 50, 0.8);
    box-shadow: 
      0 0 0 1px rgba(0, 0, 0, 0.9), 
      0 0 0 3px rgba(200, 30, 30, 0.6), 
      0 0 15px rgba(200, 0, 0, 0.5),
      inset 0 0 15px rgba(200, 30, 30, 0.6);
  }
  100% { 
    transform: translate(-50%, -50%) rotate(360deg) scale(0.85); 
    opacity: 0.8; 
  }
}

@keyframes goetia-flame {
  0% { opacity: 0.6; transform: translateY(0) scale(1) skewX(0deg); filter: blur(1px); }
  50% { opacity: 0.3; transform: translateY(-4px) scale(1.02) skewX(3deg); filter: blur(3px); }
  100% { opacity: 0; transform: translateY(-8px) scale(1.05) skewX(-4deg); filter: blur(6px); }
}

.effect-gumiho{
  position: relative;
  display: inline-block;
  isolation: isolate;
  overflow: visible;

  color: #ffffff;
  text-shadow:
    0 0 6px rgba(255,255,255,0.95),
    0 0 18px rgba(255,255,255,0.35);

  animation: gumiho-body-shimmer 1.8s infinite ease-in-out;
}

.effect-gumiho::before,
.effect-gumiho::after{
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;

  -webkit-text-stroke: 0 transparent;
  mix-blend-mode: screen;

  transform-origin: 50% 55%;
  will-change: transform, opacity, filter, text-shadow;
}

.effect-gumiho::before{
  opacity: 0;
  filter: blur(0.7px) contrast(1.35) saturate(1.4);

  text-shadow:
    -2px 0 0 rgba(80,210,255,1),
    -6px 0 14px rgba(80,210,255,0.65),
    -14px 0 34px rgba(80,210,255,0.40),
    -24px 0 60px rgba(80,210,255,0.22);

  animation: gumiho-phantom-sky 1.15s infinite ease-in-out;
}

.effect-gumiho::after{
  opacity: 0;
  filter: blur(1px) contrast(1.30) saturate(1.6);

  text-shadow:
    2px 0 0 rgba(255,70,190,1),
    6px 0 16px rgba(255,70,190,0.75),
    14px 0 38px rgba(255,70,190,0.45),
    26px 0 70px rgba(255,70,190,0.28);

  animation: gumiho-phantom-pink 1.45s infinite ease-in-out 0.12s;
}

@keyframes gumiho-body-shimmer{
  0%,100%{
    filter: none;
  }
  50%{
    filter: brightness(1.05);
  }
}

@keyframes gumiho-phantom-sky{
  0%   { opacity: 0;    transform: translate(0,0) scale(1); }
  20%  { opacity: 1;    transform: translate(-3px,-1px) scale(1.02); }
  55%  { opacity: 0.55; transform: translate(-10px,-2px) scale(1.05); }
  100% { opacity: 0;    transform: translate(-18px,-4px) scale(1.08); }
}

@keyframes gumiho-phantom-pink{
  0%   { opacity: 0;    transform: translate(0,0) scale(1); }
  22%  { opacity: 1;    transform: translate(3px,0px) scale(1.02); }
  60%  { opacity: 0.50; transform: translate(12px,3px) scale(1.06); }
  100% { opacity: 0;    transform: translate(20px,5px) scale(1.10); }
}

/* ===================== 미디르 ===================== */
.effect-midir {
  position: relative;
  display: inline-block;
  /* 본체는 고정된 주황색 테두리와 불타는 후광만을 유지 */
  color: transparent !important; 
  -webkit-text-stroke: 1.5px #ff8c00; 
  text-shadow: 0 0 8px #ff6600, 0 0 15px #ff3300; 
}

/* 1. 기존 글자: 1타 맥동 후 2타 때 연기처럼 흩어지며 사라짐 */
.effect-midir::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  color: #000000; /* 순수한 검은색 */
  -webkit-text-stroke: 0 transparent;
  text-shadow: 0 0 4px #000; 
  z-index: 3; /* 흩어지는 글자가 위로 */
  transform-origin: center;
  animation: midir-old-text 2.4s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

/* 2. 새 글자: 2타 타이밍에 내부에서 맺히며 등장하여 자리를 채움 */
.effect-midir::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  color: #000000;
  -webkit-text-stroke: 0 transparent;
  text-shadow: 0 0 4px #000;
  z-index: 2; /* 새 글자는 안쪽에서 생성 */
  transform-origin: center;
  animation: midir-new-text 2.4s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

/* 기존 글자: 쿵(1타) -> 쿵(2타) 이후 연기처럼 서서히 확산되며 주황색으로 타들어감 */
@keyframes midir-old-text {
  0% { transform: scale(1); opacity: 1; filter: blur(0); color: #000; text-shadow: 0 0 4px #000; }
  15% { transform: scale(1.08); opacity: 1; filter: blur(0); color: #000; text-shadow: 0 0 4px #000; } /* 1타 */
  30% { transform: scale(1); opacity: 1; filter: blur(0); color: #000; text-shadow: 0 0 4px #000; }
  
  49% { transform: scale(1); opacity: 1; filter: blur(0); color: #000; text-shadow: 0 0 4px #000; }
  50% { transform: scale(1.15); opacity: 1; filter: blur(0); color: #000; text-shadow: 0 0 8px #000; } /* 2타 */
  
  /* 퍼져나가면서 점점 검은색 -> 주황색 -> 붉은색으로 타들어가며 소멸 */
  65% { transform: scale(1.3); opacity: 0.5; filter: blur(6px); color: #ff6600; text-shadow: 0 0 15px #ff3300; } 
  100% { transform: scale(1.6); opacity: 0; filter: blur(15px); color: #ff1a1a; text-shadow: 0 0 25px #ff0000; }
}
/* 새 글자: 기존 글자가 흩어지는 동안 안쪽에서 서서히 맺힘 */
@keyframes midir-new-text {
  0%, 49% { transform: scale(0.5); opacity: 0; filter: blur(4px); } /* 이전까지는 잠복 */
  
  50% { transform: scale(0.6); opacity: 0; filter: blur(2px); } /* 2타 타이밍에 생성 시작 */
  75% { transform: scale(1); opacity: 1; filter: blur(0); } /* 새 글자가 완전히 굳어지는 속도도 조금 늦춤 */
  
  100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

/* ===================== 장산범 ===================== */
.effect-jangsan {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.2em; /* 상하 잘림 완벽 방지 */
  color: transparent !important;
  text-shadow: none !important;
  overflow: visible;
}
.effect-jangsan::before {
  content: "장산범";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #e6f0ff;
  text-shadow: 0 0 8px rgba(200, 220, 255, 0.6);
  white-space: nowrap;
  animation: jangsan-mimic 6s infinite; /* 대기 시간 대폭 단축 */
}

@keyframes jangsan-mimic {
  /* 평상시 유지 */
  0%, 5% { content: "장산범"; transform: translate(-50%, -50%); filter: none; text-shadow: 0 0 8px rgba(200,220,255,0.6); color: #e6f0ff; }
  
  /* 1 */
  6% { content: "A7bK9zXq"; transform: translate(-50%, -50%) skewX(10deg); color: #ff4d4d; text-shadow: none; }
  7% { content: "W$3vR!pL"; transform: translate(-50%, -50%) skewX(-10deg); color: #b30000; text-shadow: none; }
  8%, 15% { content: "안녕?"; color: #ff1a1a; text-shadow: 2px 0 5px #800000; transform: translate(-50%, -50%) scale(1.05) rotate(-2deg); }
  
  /* 2 */
  16% { content: "헤8Xq#mC"; transform: translate(-50%, -50%) skewX(15deg); color: #cc0000; text-shadow: none; }
  17% { content: "L2@vT!&k"; transform: translate(-50%, -50%) skewX(-15deg); color: #ff3333; text-shadow: none; }
  18%, 25% { content: "열어줘"; color: #990000; text-shadow: -2px 0 5px #ff6666; transform: translate(-50%, -50%) scale(0.95) rotate(2deg); }
  
  /* 3 */
  26% { content: "P@9$Zx#"; transform: translate(-50%, -50%) skewX(5deg); color: #e60000; text-shadow: none; }
  27% { content: "K#mC8Xq"; transform: translate(-50%, -50%) skewX(-5deg); color: #800000; text-shadow: none; }
  28%, 35% { content: "살려줘"; color: #cc0000; text-shadow: 0 2px 5px #ff1a1a; transform: translate(-50%, calc(-50% + 2px)); }
  
  /* 4 */
  36% { content: "V!9$Zx#"; transform: translate(-50%, -50%) skewX(20deg); color: #ff4d4d; text-shadow: none; }
  37% { content: "R!pLW$3"; transform: translate(-50%, -50%) skewX(-20deg); color: #660000; text-shadow: none; }
  38%, 45% { content: "키킥"; color: #800000; text-shadow: 0 -2px 5px #ff4d4d; transform: translate(-50%, -50%) skewX(-10deg); }
  
  /* 5 */
  46% { content: "Z#mC8Xq"; transform: translate(-50%, -50%) skewX(10deg); color: #b30000; text-shadow: none; }
  47% { content: "Q#$B&4n"; transform: translate(-50%, -50%) skewX(-10deg); color: #ff3333; text-shadow: none; }
  48%, 55% { content: "메아리가 들려?"; color: #660000; text-shadow: 0 0 10px #ff0000; transform: translate(-50%, -50%) scale(1.1); }
  
  /* 6 */
  56% { content: "Xq#1@9k"; transform: translate(-50%, -50%) skewX(25deg); color: #cc0000; text-shadow: none; }
  57% { content: "9$Zx#V!"; transform: translate(-50%, -50%) skewX(-25deg); color: #ff1a1a; text-shadow: none; }
  58%, 62% { content: "???"; color: #4d0000; text-shadow: 0 0 15px #ff3333; transform: translate(-50%, -50%) skewX(10deg); }

  /* 붉은색 스크린 치지직 글리치 (화면 깨짐 + 색상 분리) */
  63% { content: "장산범"; transform: translate(calc(-50% - 8px), -50%) skewX(30deg); filter: blur(2px); text-shadow: 5px 0 #ff0000, -5px 0 #800000; color: #ffcccc; }
  64% { content: "장산범"; transform: translate(calc(-50% + 8px), -50%) skewX(-30deg); filter: invert(0.2); text-shadow: -5px 0 #cc0000, 5px 0 #ff4d4d; color: #ffe6e6; }
  65% { content: "장산범"; transform: translate(-50%, calc(-50% + 4px)); filter: blur(1px); text-shadow: 0 5px #e60000, 0 -5px #990000; color: #ffb3b3; }
  66% { content: "장산범"; transform: translate(-50%, -50%); filter: none; text-shadow: 0 0 8px rgba(200, 220, 255, 0.6); color: #e6f0ff; }
  
  /* 원래대로 복구 */
  67%, 100% { content: "장산범"; transform: translate(-50%, -50%); filter: none; text-shadow: 0 0 8px rgba(200, 220, 255, 0.6); color: #e6f0ff; }
}

/* 🌐 영어 모드 전용 (동일한 노이즈 프레임, 실제 문구만 영어로) */
body.lang-en-active .effect-jangsan::before {
  animation-name: jangsan-mimic-en;
}
@keyframes jangsan-mimic-en {
  /* 평상시 유지 */
  0%, 5% { content: "Jangsanbeom"; transform: translate(-50%, -50%); filter: none; text-shadow: 0 0 8px rgba(200,220,255,0.6); color: #e6f0ff; }

  /* 1 */
  6% { content: "A7bK9zXq"; transform: translate(-50%, -50%) skewX(10deg); color: #ff4d4d; text-shadow: none; }
  7% { content: "W$3vR!pL"; transform: translate(-50%, -50%) skewX(-10deg); color: #b30000; text-shadow: none; }
  8%, 15% { content: "Hello?"; color: #ff1a1a; text-shadow: 2px 0 5px #800000; transform: translate(-50%, -50%) scale(1.05) rotate(-2deg); }

  /* 2 */
  16% { content: "헤8Xq#mC"; transform: translate(-50%, -50%) skewX(15deg); color: #cc0000; text-shadow: none; }
  17% { content: "L2@vT!&k"; transform: translate(-50%, -50%) skewX(-15deg); color: #ff3333; text-shadow: none; }
  18%, 25% { content: "Let me in"; color: #990000; text-shadow: -2px 0 5px #ff6666; transform: translate(-50%, -50%) scale(0.95) rotate(2deg); }

  /* 3 */
  26% { content: "P@9$Zx#"; transform: translate(-50%, -50%) skewX(5deg); color: #e60000; text-shadow: none; }
  27% { content: "K#mC8Xq"; transform: translate(-50%, -50%) skewX(-5deg); color: #800000; text-shadow: none; }
  28%, 35% { content: "Help me"; color: #cc0000; text-shadow: 0 2px 5px #ff1a1a; transform: translate(-50%, calc(-50% + 2px)); }

  /* 4 */
  36% { content: "V!9$Zx#"; transform: translate(-50%, -50%) skewX(20deg); color: #ff4d4d; text-shadow: none; }
  37% { content: "R!pLW$3"; transform: translate(-50%, -50%) skewX(-20deg); color: #660000; text-shadow: none; }
  38%, 45% { content: "Hehehe"; color: #800000; text-shadow: 0 -2px 5px #ff4d4d; transform: translate(-50%, -50%) skewX(-10deg); }

  /* 5 */
  46% { content: "Z#mC8Xq"; transform: translate(-50%, -50%) skewX(10deg); color: #b30000; text-shadow: none; }
  47% { content: "Q#$B&4n"; transform: translate(-50%, -50%) skewX(-10deg); color: #ff3333; text-shadow: none; }
  48%, 55% { content: "Do you hear the echo?"; color: #660000; text-shadow: 0 0 10px #ff0000; transform: translate(-50%, -50%) scale(1.1); }

  /* 6 */
  56% { content: "Xq#1@9k"; transform: translate(-50%, -50%) skewX(25deg); color: #cc0000; text-shadow: none; }
  57% { content: "9$Zx#V!"; transform: translate(-50%, -50%) skewX(-25deg); color: #ff1a1a; text-shadow: none; }
  58%, 62% { content: "???"; color: #4d0000; text-shadow: 0 0 15px #ff3333; transform: translate(-50%, -50%) skewX(10deg); }

  /* 붉은색 스크린 치지직 글리치 (화면 깨짐 + 색상 분리) */
  63% { content: "Jangsanbeom"; transform: translate(calc(-50% - 8px), -50%) skewX(30deg); filter: blur(2px); text-shadow: 5px 0 #ff0000, -5px 0 #800000; color: #ffcccc; }
  64% { content: "Jangsanbeom"; transform: translate(calc(-50% + 8px), -50%) skewX(-30deg); filter: invert(0.2); text-shadow: -5px 0 #cc0000, 5px 0 #ff4d4d; color: #ffe6e6; }
  65% { content: "Jangsanbeom"; transform: translate(-50%, calc(-50% + 4px)); filter: blur(1px); text-shadow: 0 5px #e60000, 0 -5px #990000; color: #ffb3b3; }
  66% { content: "Jangsanbeom"; transform: translate(-50%, -50%); filter: none; text-shadow: 0 0 8px rgba(200, 220, 255, 0.6); color: #e6f0ff; }

  /* 원래대로 복구 */
  67%, 100% { content: "Jangsanbeom"; transform: translate(-50%, -50%); filter: none; text-shadow: 0 0 8px rgba(200, 220, 255, 0.6); color: #e6f0ff; }
}

/* ===================== 바엘세붑 ===================== */
.effect-beelzebub {
  position: relative;
  display: inline-block;
  color: #4a5c39;
  text-shadow: 0 2px 5px rgba(0,0,0,1), 0 0 10px rgba(100, 255, 0, 0.3);
  animation: beelzebub-pulse 2s infinite alternate;
}
.effect-beelzebub::before,
.effect-beelzebub::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  color: transparent;
  pointer-events: none;
  opacity: 0.6;
}
.effect-beelzebub::before {
  text-shadow: 2px -2px 1px rgba(0, 0, 0, 0.9), -2px 2px 1px rgba(50, 100, 0, 0.8);
  animation: beelzebub-flies 0.08s infinite linear;
}
.effect-beelzebub::after {
  text-shadow: -1px -1px 1px rgba(150, 255, 0, 0.6), 1px 1px 1px rgba(0, 0, 0, 0.9);
  animation: beelzebub-flies 0.12s infinite linear reverse;
}
@keyframes beelzebub-pulse {
  0% { color: #4a5c39; text-shadow: 0 2px 5px rgba(0,0,0,1), 0 0 10px rgba(100, 255, 0, 0.3); }
  100% { color: #6b8e23; text-shadow: 0 2px 5px rgba(0,0,0,1), 0 0 20px rgba(100, 255, 0, 0.6); }
}
@keyframes beelzebub-flies {
  0% { transform: translate(0, 0); }
  25% { transform: translate(1px, -1px); }
  50% { transform: translate(-1px, 0); }
  75% { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  
  
  background-image: url('image/ash_desert.webp');
  background-size: cover;
  background-position: center;
  z-index: -10;
  
  
  opacity: 0;
  filter: blur(15px) brightness(0);
  transition: opacity 2.5s ease-in-out, filter 2.5s ease-in-out;
  pointer-events: none;
}

body.show-ash-desert::before {
  opacity: 1;
  
  filter: blur(6px) brightness(0.15); 
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -11; 
  
  background: radial-gradient(circle at 50% 50%, #313b42 0%, #23292e 45%, #0d0f10 100%);
  
  opacity: 0;
  pointer-events: none;
  transition: opacity 2.5s ease-in-out;
}

body.show-mysterious-space::after {
  opacity: 1;
  
  animation: mystic-space-breathe 10s infinite alternate ease-in-out;
}

@keyframes mystic-space-breathe {
  0% { 
    transform: scale(1);
    filter: hue-rotate(0deg) brightness(1);
  }
  100% { 
    transform: scale(1.2); 
    filter: hue-rotate(25deg) brightness(1.3); 
  }
}

#historyChoices {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important; 
  gap: 14px;
  width: 100% !important;
  max-width: 1200px !important; 
  margin: 10px auto !important;
  box-sizing: border-box;
}

#historyChoices button.choice {
  width: 100% !important;
  max-width: none !important;
  height: 100%; 
}

body.instant-bg-switch::before,
body.instant-bg-switch::after {
  transition: none !important;
}

#intro {
  position: fixed;
  inset: 0;
  background-color: #000000;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

#introPreludeOverlay {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

#introPreludeOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

.intro-prelude-text {
  min-height: 2.4em;
  width: min(88vw, 980px);
  padding: 0 24px;
  color: rgba(236, 236, 236, 0.95);
  font-family: "HeirofLight", "Noto Serif KR", serif;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: 0.12em;
  text-align: center;
  white-space: pre-wrap;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.08);
}

.intro-prelude-text.typing::after {
  content: "_";
  display: inline-block;
  margin-left: 0.08em;
  color: rgba(236, 236, 236, 0.95);
  animation: intro-prelude-caret 0.9s steps(1, end) infinite;
}

@keyframes intro-prelude-caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.skip-intro-btn {
  position: absolute;
  bottom: 40px;
  right: 50px;
  background: transparent;
  border: none;
  color: #666;
  font-family: "Georgia", "Noto Serif KR", serif;
  font-size: 1.1em;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.2s ease;
  z-index: 100060;
  outline: none;
}

.skip-intro-btn:hover {
  color: #aaa;
  transform: translateX(5px);
}

.skip-intro-btn:active {
  transform: translateX(2px);
}

#intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('image/intro_bg.png'); /* 사용할 배경 이미지 파일 이름으로 변경해주세요 */
  background-size: 50%;
  background-position: center 29%;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

#intro.start-bg-anim::before {
  /* 메뉴 오픈 시 부드럽게 나타남 */
  animation: intro-bg-fade-in 1.5s ease-in-out forwards;
}

@keyframes intro-bg-fade-in {
  from { opacity: 0; }
  to { opacity: 0.17; } /* 투명도를 0.5에서 0.25로 더 낮춤 (더 투명해짐) */
}

body.intro-modal-open #intro {
  z-index: 10;
}

.intro-content {
  text-align: center;
}

.intro-content h1 {
  font-family: "HeirofLightRegular", var(--font-kr);
  font-size: clamp(2.2rem, 6.8vw, 4.7rem);
  font-weight: 300;
  letter-spacing: 0.15em;
  color: #f8f8f8;
  margin: 0;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 24px rgba(255, 255, 255, 0.55), 0 0 42px rgba(255, 255, 255, 0.35);
}

.intro-content h2 {
  font-size: clamp(0.8rem, 1.5vw, 1.2rem);
  font-weight: 300;
  letter-spacing: 0.15em;
  color: #777;
  font-style: normal;
  margin: 0;
}

/* 🌟 [버그 수정] 예전엔 요소마다 vw 계수가 제각각인 독립 clamp()를 썼는데,
   각 clamp가 최소/최대에 도달하는 화면 너비가 서로 달라서(예: 구분선은 1357px 밑에서 고정,
   문양은 1174px 위에서 고정) 화면 비율이 바뀔 때 요소들이 서로 다른 속도로 커지고 작아지며
   어긋나 겹치는 문제가 있었음. 지금은 --title-unit(기준 100px 크기의 "1배수" 길이 값) 하나로
   모든 위치/크기를 비율(숫자) 곱셈만으로 계산해서 항상 같은 비율로 함께 움직이게 함.
   (주의: clamp()/min() 안에 길이값과 단위 없는 숫자를 섞으면 값 전체가 무효화되므로,
   반드시 --title-unit 자체는 순수 길이로 두고, 각 요소는 그 길이에 "단위 없는 배수"만 곱한다.)
   가로/세로 둘 다 고려(min(vw, vh))해서 화면 비율이 바뀌어도 안전하게 축소됨. */
.title-row {
  --title-unit: clamp(50px, min(6.25vw, 11.111vh), 100px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--title-unit) * 0.45);
  margin-bottom: 10px;
  transform: translateX(calc(var(--title-unit) * -0.8));
}

/* 🌟 CYO를 문양 상단(위쪽 다이아) 높이에 맞춰 왼쪽에 붙여서 'A'처럼 보이게 함 */
.title-cyo {
  position: relative;
  top: calc(var(--title-unit) * -0.82);
  left: calc(var(--title-unit) * -1.58);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title-cyo h1 {
  position: relative;
  top: calc(var(--title-unit) * 0.16);
  font-size: calc(var(--title-unit) * 1.0528);
}

/* 🌟 ERANCE 바로 아래에 배치하는 자막 텍스트 */
h2.title-below-erance {
  position: absolute;
  top: 50%;
  left: 50%;
  --ba-x: calc(var(--title-unit) * 2.78);
  --ba-y: calc(var(--title-unit) * 1.00);
  transform: translate(calc(-50% + var(--ba-x)), calc(-50% + var(--ba-y)));
  color: #888;
  font-size: calc(var(--title-unit) * 0.2128);
  white-space: nowrap;
  margin: 0;
}

/* 🌟 CYO 텍스트와 문양 윗부분을 가로질러 지나가는 칼날 모양 구분선 */
.cyoa-divider-line {
  position: absolute;
  top: 50%;
  left: 50%;
  --divider-x: calc(var(--title-unit) * -1.60);
  --divider-y: calc(var(--title-unit) * -0.46);
  transform: translate(calc(-50% + var(--divider-x)), calc(-50% + var(--divider-y)));
  width: calc(var(--title-unit) * 5.28);
  height: calc(var(--title-unit) * 0.044);
  background-color: #ffffff;
  clip-path: polygon(0% 50%, 50% 0%, 100% 50%, 50% 100%);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.45));
}

/* 🌟 문양 아랫부분(아래 다이아) 왼쪽에 배치하는 SE 텍스트 */
.title-se {
  position: absolute;
  top: 50%;
  left: 50%;
  --se-x: calc(var(--title-unit) * -0.95);
  --se-y: calc(var(--title-unit) * 0.36);
  transform: translate(calc(-50% + var(--se-x)), calc(-50% + var(--se-y)));
  font-family: "HeirofLightRegular", "EsamanruLight", serif;
  font-size: calc(var(--title-unit) * 0.9408);
  letter-spacing: 0.1em;
  color: #ffffff;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.85), 0 0 24px rgba(255, 255, 255, 0.6), 0 0 42px rgba(255, 255, 255, 0.4);
}

/* 🌟 문양 아랫부분(아래 다이아) 오른쪽에 배치하는 ERANCE 텍스트 (SE와 동일 형식) */
.title-erence {
  position: absolute;
  top: 50%;
  left: 50%;
  --erence-x: calc(var(--title-unit) * 2.78);
  --erence-y: calc(var(--title-unit) * 0.36);
  transform: translate(calc(-50% + var(--erence-x)), calc(-50% + var(--erence-y)));
  font-family: "HeirofLightRegular", "EsamanruLight", serif;
  font-size: calc(var(--title-unit) * 0.9408);
  letter-spacing: 0.1em;
  color: #ffffff;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.85), 0 0 24px rgba(255, 255, 255, 0.6), 0 0 42px rgba(255, 255, 255, 0.4);
}

/* 🌟 텍스트 흐름(flex gap)에서 분리하여 위치를 고정 — 글자 너비가 바뀌어도 항상 같은 자리에 있음 */
.cyoa-center-gem {
  position: absolute;
  top: 50%;
  left: 50%;
  --gem-x: calc(var(--title-unit) * 0.05);
  transform: translate(calc(-50% + var(--gem-x)), -50%);
  width: calc(var(--title-unit) * 1.212);
  height: calc(var(--title-unit) * 2.352);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-20 -25 140 260' overflow='visible'><g fill='none' stroke='white' stroke-width='10.5' stroke-linejoin='miter' stroke-linecap='square'><path d='M50,2 Q58,30 84,76 Q64,92 50,110 Q36,92 16,76 Q42,30 50,2 Z'/><path d='M50,77 Q66,93 84,113 Q58,167 50,191 Q42,167 16,113 Q34,93 50,77 Z'/></g></svg>");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.55)) drop-shadow(0 0 9px rgba(255, 255, 255, 0.32)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.2));
}

.title-fade {
  opacity: 0;
}

.title-fade.start-anim {
  animation: ds-fade-in 1.5s ease-out forwards;
}

.title-fade.delay-1.start-anim {
  animation-delay: 0.28s;
}

@keyframes ds-fade-in {
  0% { opacity: 0; filter: blur(12px); transform: scale(0.95); }
  100% { opacity: 1; filter: blur(0); transform: scale(1); }
}

/* 🌟 문양: 처음엔 어두운 회색으로 등장, 색상 전환은 클릭 후 선 안착 시점에 JS로 트리거 */
.cyoa-center-gem.title-fade.start-anim {
  animation: cyoa-gem-fade-in 1.5s ease-out forwards;
}

.cyoa-center-gem.do-reveal {
  animation: cyoa-gem-color-reveal 0.8s ease-out forwards !important;
}

@keyframes cyoa-gem-fade-in {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + var(--gem-x)), -50%) scale(0.95);
    filter: blur(12px) brightness(0.4) drop-shadow(0 0 3px rgba(255, 255, 255, 0.55)) drop-shadow(0 0 9px rgba(255, 255, 255, 0.32)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.2));
  }
  100% {
    opacity: 1;
    transform: translate(calc(-50% + var(--gem-x)), -50%) scale(1);
    filter: blur(0) brightness(0.4) drop-shadow(0 0 3px rgba(255, 255, 255, 0.55)) drop-shadow(0 0 9px rgba(255, 255, 255, 0.32)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.2));
  }
}

@keyframes cyoa-gem-color-reveal {
  0%   { filter: brightness(0.4) drop-shadow(0 0 3px rgba(255, 255, 255, 0.55)) drop-shadow(0 0 9px rgba(255, 255, 255, 0.32)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.2)); }
  45%  { filter: brightness(3.2) drop-shadow(0 0 3px rgba(255, 255, 255, 0.55)) drop-shadow(0 0 9px rgba(255, 255, 255, 0.32)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.2)); }
  100% { filter: brightness(1) drop-shadow(0 0 3px rgba(255, 255, 255, 0.55)) drop-shadow(0 0 9px rgba(255, 255, 255, 0.32)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.2)); }
}

/* 🌟 구분선: 모든 연출이 끝난 맨 마지막에, 화면 밖의 거대한 크기에서 줄어들며 제자리에 안착(입체감) */
.cyoa-divider-line.title-fade.start-anim {
  animation: cyoa-divider-zoom-in 0.5s cubic-bezier(0.65, 0, 0.8, 1) 1.5s forwards;
}

@keyframes cyoa-divider-zoom-in {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + var(--divider-x)), calc(-50% + var(--divider-y))) scale(10);
    filter: blur(18px) drop-shadow(0 0 4px rgba(255,255,255,0.45));
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(calc(-50% + var(--divider-x)), calc(-50% + var(--divider-y))) scale(1);
    filter: blur(0) drop-shadow(0 0 4px rgba(255,255,255,0.45));
  }
}

/* 🌟 개별 글자 슬라이딩: 어두운 회색으로 날아오고, 구분선 안착(5.3s) 시점에 환하게 빛나며 흔들림 */
/* animation-delay 인라인 style은 "슬라이드delay, 5.3s, 5.3s" 세 값으로 지정 */
.title-char {
  display: inline-block;
}

/* 색상 전환은 클릭 후 JS로 .do-reveal 클래스 추가해 트리거 */
.title-char.title-char-left.title-fade.start-anim {
  animation: title-char-slide-left 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.title-char.title-char-right.title-fade.start-anim {
  animation: title-char-slide-right 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.title-char.do-reveal {
  animation: title-char-color-reveal 0.8s ease-out forwards !important;
}

@keyframes title-char-slide-left {
  0%   { opacity: 0; transform: translateX(-90px); filter: blur(6px) brightness(0.4); }
  100% { opacity: 1; transform: translateX(0);     filter: blur(0) brightness(0.4); }
}

@keyframes title-char-slide-right {
  0%   { opacity: 0; transform: translateX(90px); filter: blur(6px) brightness(0.4); }
  100% { opacity: 1; transform: translateX(0);    filter: blur(0) brightness(0.4); }
}

@keyframes title-char-color-reveal {
  0%   { filter: brightness(0.4); }
  45%  { filter: brightness(3); }
  100% { filter: brightness(1); }
}

/* 🌟 화면 전체 흔들림: 색상 전환(선 안착) 시점에 #intro에 클래스 추가로 트리거 */
#intro.screen-shake {
  animation: screen-shake 0.5s ease-out forwards;
}

@keyframes screen-shake {
  0%   { transform: translate(0, 0); }
  12%  { transform: translate(-6px, -3px); }
  25%  { transform: translate(6px, 3px); }
  37%  { transform: translate(-5px, 2px); }
  50%  { transform: translate(4px, -2px); }
  62%  { transform: translate(-3px, 1px); }
  75%  { transform: translate(2px, -1px); }
  87%  { transform: translate(-1px, 0px); }
  100% { transform: translate(0, 0); }
}

/* 🌟 파티클: 날렵한 가로 타원 모양, 크기/속도 개별화 */
.title-particle {
  position: fixed;
  width: calc(var(--psize, 4px) * 1.2);
  height: var(--psize, 4px);
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 100001;
  transform: translate(-50%, -50%);
  animation: title-particle-burst var(--pdur, 2.5s) linear forwards;
}

@keyframes title-particle-burst {
  0% {
    animation-timing-function: cubic-bezier(0.03, 0, 0.08, 1);
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--pr0)) scale(0.5);
  }
  30% {
    animation-timing-function: linear;
    opacity: 1;
    transform: translate(calc(-50% + var(--rx)), calc(-50% + var(--ry))) rotate(var(--pr1)) scale(2.2);
  }
  32.5% {
    animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
    opacity: 0.88;
    transform: translate(calc(-50% + var(--rx)), calc(-50% + var(--ry))) rotate(var(--pr1)) scale(2.0);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--rx) - var(--lx)), calc(-50% + var(--ry) + var(--ly))) rotate(var(--pr2)) scale(0.08);
  }
}

/* 🌟 자막: 마지막 글자 안착 + 글로우 후 등장 */
h2.title-below-erance.title-fade.start-anim {
  animation: cyoa-below-erance-fade-in 1s ease-out 2.8s forwards;
}

@keyframes cyoa-below-erance-fade-in {
  0%   { opacity: 0; transform: translate(calc(-50% + var(--ba-x)), calc(-50% + var(--ba-y))); filter: blur(6px); }
  100% { opacity: 1; transform: translate(calc(-50% + var(--ba-x)), calc(-50% + var(--ba-y))); filter: blur(0); }
}

/* 🌟 자막 타이핑 커서 */
.title-below-erance.title-typing::after {
  content: '|';
  opacity: 0.6;
  animation: title-cursor-blink 0.6s step-end infinite;
}

@keyframes title-cursor-blink {
  50% { opacity: 0; }
}

.press-start {
  margin-top: 100px;
  font-family: "Georgia", serif; 
  font-size: 1.2em;
  letter-spacing: 0.2em;
  color: #666;
  text-transform: uppercase;
  opacity: 0;
}

.press-start.start-anim {
  animation: press-start-show 0.95s ease-out 1.05s forwards, ds-blink 3s ease-in-out infinite 2.05s;
}

@keyframes press-start-show {
  0% { 
    opacity: 0; 
    filter: blur(8px); 
    transform: scale(0.98); 
    text-shadow: 0 0 0px rgba(255,255,255,0); 
  }
  100% { 
    opacity: 1; 
    filter: blur(0); 
    transform: scale(1); 
    text-shadow: 0 0 10px rgba(255,255,255,0.2); 
  }
}

@keyframes ds-blink {
  0%, 100% { 
    opacity: 1; 
    text-shadow: 0 0 10px rgba(255,255,255,0.2); 
  }
  50% { 
    opacity: 0.3; 
    text-shadow: 0 0 0px rgba(255,255,255,0); 
  }
}

.intro-menu-area {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px; 
  margin-top: 60px;
}

#pressStartText {
  position: absolute;
  margin: 0;
  white-space: nowrap; 
  transition: opacity 0.8s ease, filter 0.8s ease, transform 0.8s ease;
}

#pressStartText.hide-for-menu {
  /* 기존 깜빡임 애니메이션을 무시하고, 강제로 커지며 사라지는 애니메이션 실행 */
  animation: press-start-hide 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
  pointer-events: none;
}

@keyframes press-start-hide {
  0% { 
    opacity: 1; 
    filter: blur(0); 
    transform: scale(1); 
  }
  100% { 
    opacity: 0; 
    filter: blur(10px); 
    transform: scale(1.25); /* 부드럽게 커짐 */
  }
}

.ds-menu {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  pointer-events: none;
}

.ds-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ds-menu-btn {
  position: relative;
  min-width: 240px;
  padding: 4px 28px;
  border: none;
  background: transparent;

  font-family: "Noto Serif KR", serif;
  font-size: 1.2rem;
  font-weight: 400 !important;
  text-transform: capitalize;
  color: rgba(255, 255, 255, 0.38);

  line-height: 1.35;
  letter-spacing: 0.18em;
  text-align: center;
  cursor: pointer;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-shadow: none !important;
  transition: color 0.4s ease, transform 0.2s ease;
}

.ds-menu-btn:hover,
.ds-menu-btn:focus-visible {
  color: rgba(255, 255, 255, 0.65); 
  outline: none;
}

.ds-menu-btn:active {
  transform: translateY(1px);
}

.ds-menu-btn::before,
.ds-menu-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.ds-menu-btn::before {
  top: 50%;
  height: 20px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse at center,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.04) 40%,
      rgba(255, 255, 255, 0.00) 70%);
  filter: blur(4px);
}

.ds-menu-btn.is-selected {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 400 !important;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.1) !important;
}

.ds-menu-btn.is-selected::before {
  opacity: 1;
}

#physicalMeritChoices .choiceImage,
#mentalMeritChoices .choiceImage,
#sexualMeritChoices .choiceImage,
#physicalFlawChoices .choiceImage,
#mentalFlawChoices .choiceImage,
#sexualFlawChoices .choiceImage {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: 900 / 1080 !important; 
  object-fit: cover !important;
  border-radius: 16px !important; 
  margin-bottom: 24px !important; 
}

#physicalMeritChoices,
#mentalMeritChoices,
#sexualMeritChoices,
#physicalFlawChoices,
#mentalFlawChoices,
#sexualFlawChoices,
#hiddenExtraMeritChoices {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important; 
  width: 100% !important;
  max-width: 100% !important; 
  margin-left: auto !important;
  margin-right: auto !important;
  padding-bottom: 80px; 
}

.body-part-img {
  width: 100% !important;
  height: auto !important;
  max-height: none !important; 
  aspect-ratio: 1050 / 1200 !important; 
  object-fit: cover !important;
  border-radius: 8px;
  margin: 0 auto 14px auto !important;
  border: 1px solid rgba(255, 255, 255, 0.15); 
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  pointer-events: none; 
  
  transform: translateZ(0); 
  content-visibility: auto;
}

#raceBaseChoices .body-part-img,
#bloodChoices .body-part-img,
#beastChoices .body-part-img,
#holyChoices .body-part-img,
#abyssChoices .body-part-img,
#natureChoices .body-part-img,
#curseChoices .body-part-img,
#machineChoices .body-part-img,
#insectChoices .body-part-img,
#hiddenRaceChoices .body-part-img {
  aspect-ratio: 1050 / 1450 !important; 
  max-height: none !important;
}

#raceSection button.choice,
#bloodChoices button.choice,
#beastChoices button.choice,
#holyChoices button.choice,
#abyssChoices button.choice,
#natureChoices button.choice,
#curseChoices button.choice,
#machineChoices button.choice,
#insectChoices button.choice,
#hiddenRaceChoices button.choice {
  min-height: 420px !important; 
}

#genderChoices .body-part-img,
#genderChoices .choiceImage,
button[data-group="bodyImpression"] .body-part-img {
  aspect-ratio: 1050 / 1600 !important; 
  max-height: none !important; 
}

button[data-group="bodyShape"] .body-part-img,
button[data-group="height"] .body-part-img,
button[data-group="age"] .body-part-img {
  aspect-ratio: 1050 / 1400 !important; 
  max-height: none !important;
}

#genderChoices button.choice,
button[data-group="bodyImpression"],
button[data-group="bodyShape"],
button[data-group="height"],
button[data-group="age"] {
  min-height: 480px !important; 
  height: auto !important; 
  justify-content: flex-start !important;
  align-items: center !important;
}

#hairChoices button.choice,
#hairColorChoices button.choice,
#eyeColorChoices button.choice,
#pupilChoices button.choice,
#secBodyShape .choiceLine button.choice,
#heightChoices button.choice,
#secAge .choiceLine button.choice,
#historyChoices button.choice {
  justify-content: flex-start !important;
  align-items: center !important;
  min-height: 280px; 
}

#genderChoices .choiceTitle,
#hairChoices .choiceTitle,
#hairColorChoices .choiceTitle,
#eyeColorChoices .choiceTitle,
#pupilChoices .choiceTitle,
#secBodyShape .choiceLine .choiceTitle,
#heightChoices .choiceTitle,
#secAge .choiceLine .choiceTitle,
#historyChoices .choiceTitle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5em !important;
  margin-bottom: 5px !important;
  width: 100%;
}

#genderChoices .choiceComment,
#hairChoices .choiceComment,
#hairColorChoices .choiceComment,
#eyeColorChoices .choiceComment,
#pupilChoices .choiceComment,
#secBodyShape .choiceLine .choiceComment,
#heightChoices .choiceComment,
#secAge .choiceLine .choiceComment,
#historyChoices .choiceComment {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin-top: 10px !important;
  line-height: 1.6 !important;
  word-break: keep-all !important;
}

button.choice[data-value="혼합색"] .choiceComment {
  margin-top: 0px !important;
}

#tsFlashOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: radial-gradient(circle, rgba(255,100,200,0.6) 0%, rgba(100,200,255,0.6) 100%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

#tsFlashOverlay.flash {
  opacity: 1;
  transform: scale(1.1);
  animation: ts-shake 0.4s ease-out forwards;
}

@keyframes ts-shake {
  0% { filter: invert(1) brightness(2); }
  50% { filter: invert(0) brightness(1.5) hue-rotate(90deg); }
  100% { filter: brightness(1) hue-rotate(0deg); }
}

.ts-title-male {
  color: #66ccff !important;
  text-shadow: 0 0 12px rgba(102, 204, 255, 0.4) !important;
  transition: color 0.6s ease, text-shadow 0.6s ease !important;
}
.ts-title-female {
  color: #ff66cc !important;
  text-shadow: 0 0 12px rgba(255, 102, 204, 0.4) !important;
  transition: color 0.6s ease, text-shadow 0.6s ease !important;
}

.ts-title-glow {
  animation: ts-text-glow 0.8s ease-out forwards;
}
@keyframes ts-text-glow {
  0% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(2.5) drop-shadow(0 0 20px #fff); transform: scale(1.1); }
  100% { filter: brightness(1); transform: scale(1); }
}

#tsCardOverlay {
  position: fixed; inset: 0; z-index: 9999998;
  display: flex; justify-content: center; align-items: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s ease; 
  perspective: 1200px; 
}
#tsCardOverlay.show {
  opacity: 1; pointer-events: auto;
}

.ts-card-wrapper {
  /* 🌟 카드를 실제 남자.webp/여자.webp 이미지의 가로세로 비율(약 234:93)에 맞춤.
     기존 9:16(세로로 긴 비율)은 실제 이미지보다 훨씬 길어서, 이미지가 카드 중앙에
     작게 떠 있고 카드 자체는 텅 빈 채로 과도하게 커 보이는 문제가 있었다. */
  width: min(640px, 88vw);
  aspect-ratio: 234 / 93;
  height: auto;
  max-height: 88vh;
  position: relative;
  transform-style: preserve-3d;
  
  transition: transform 0.8s cubic-bezier(0.34, 1.2, 0.64, 1);
  transform: translateY(30px);
}
#tsCardOverlay.show .ts-card-wrapper {
  transform: translateY(0);
}

#tsCardOverlay.show .ts-card-wrapper.flipped {
  transform: translateY(0) rotateY(180deg);
}

.ts-card-face {
  --ts-accent: rgba(230, 230, 230, 0.9);
  --ts-accent-soft: rgba(230, 230, 230, 0.24);
  --ts-glow: rgba(230, 230, 230, 0.12);
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: #141414;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  border-radius: 16px;
  padding: 24px 22px 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 22px 54px rgba(0,0,0,0.82),
    inset 0 0 0 1px rgba(255,255,255,0.05),
    0 0 24px var(--ts-glow);
  overflow: hidden;
}
.ts-card-face::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 8, 10, 0.12) 0%,
    rgba(8, 8, 10, 0.16) 28%,
    rgba(8, 8, 10, 0.52) 58%,
    rgba(8, 8, 10, 0.86) 78%,
    rgba(8, 8, 10, 0.94) 100%
  );
  pointer-events: none;
}
.ts-card-face::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  border: 1px solid var(--ts-accent-soft);
  background:
    linear-gradient(var(--ts-accent), var(--ts-accent)) top left / 46px 2px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) top left / 2px 46px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) top right / 46px 2px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) top right / 2px 46px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) bottom left / 46px 2px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) bottom left / 2px 46px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) bottom right / 46px 2px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) bottom right / 2px 46px no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    inset 0 0 24px rgba(255,255,255,0.025),
    0 0 18px var(--ts-glow);
  pointer-events: none;
}
.ts-card-face > * {
  position: relative;
  z-index: 1;
}
.ts-card-back {
  transform: rotateY(180deg);
}

.ts-card-title {
  font-size: 1.6em;
  font-weight: bold;
  margin: 0;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  background: rgba(5, 5, 8, 0.64);
  border: 1px solid var(--ts-accent-soft);
  border-radius: 12px;
  text-shadow: 0 0 12px rgba(0,0,0,0.45);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 14px rgba(0,0,0,0.16);
}

.ts-card-male {
  background-image: url('image/남자.webp');
  border: 1px solid rgba(102, 204, 255, 0.4);
  box-shadow: 0 0 40px rgba(102, 204, 255, 0.15), inset 0 0 20px rgba(102, 204, 255, 0.05);
}
.ts-card-male .ts-card-title {
  color: #66ccff;
  text-shadow: 0 0 10px rgba(102, 204, 255, 0.5);
}

.ts-card-female {
  background-image: url('image/여자.webp');
  border: 1px solid rgba(255, 102, 204, 0.4);
  box-shadow: 0 0 40px rgba(255, 102, 204, 0.15), inset 0 0 20px rgba(255, 102, 204, 0.05);
}
.ts-card-female .ts-card-title {
  color: #ff66cc;
  text-shadow: 0 0 10px rgba(255, 102, 204, 0.5);
}

.ts-card-face {
  --ts-accent: rgba(230, 230, 230, 0.9);
  --ts-accent-soft: rgba(230, 230, 230, 0.24);
  --ts-glow: rgba(230, 230, 230, 0.12);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 22px 54px rgba(0,0,0,0.82),
    inset 0 0 0 1px rgba(255,255,255,0.05),
    0 0 24px var(--ts-glow);
}

.ts-card-face::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  border: 1px solid var(--ts-accent-soft);
  background:
    linear-gradient(var(--ts-accent), var(--ts-accent)) top left / 46px 2px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) top left / 2px 46px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) top right / 46px 2px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) top right / 2px 46px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) bottom left / 46px 2px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) bottom left / 2px 46px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) bottom right / 46px 2px no-repeat,
    linear-gradient(var(--ts-accent), var(--ts-accent)) bottom right / 2px 46px no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    inset 0 0 24px rgba(255,255,255,0.025),
    0 0 18px var(--ts-glow);
  pointer-events: none;
}

.ts-card-title {
  border: 1px solid var(--ts-accent-soft);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 14px rgba(0,0,0,0.16);
}

.ts-card-male {
  --ts-accent: rgba(166, 228, 255, 0.95);
  --ts-accent-soft: rgba(102, 204, 255, 0.34);
  --ts-glow: rgba(102, 204, 255, 0.16);
  background-image: url('image/남자.webp');
  border: 1px solid rgba(102, 204, 255, 0.45);
  box-shadow:
    0 0 40px rgba(102, 204, 255, 0.15),
    inset 0 0 20px rgba(102, 204, 255, 0.05),
    0 0 28px rgba(102, 204, 255, 0.12);
}

.ts-card-female {
  --ts-accent: rgba(255, 196, 232, 0.95);
  --ts-accent-soft: rgba(255, 102, 204, 0.34);
  --ts-glow: rgba(255, 102, 204, 0.16);
  background-image: url('image/여자.webp');
  border: 1px solid rgba(255, 102, 204, 0.45);
  box-shadow:
    0 0 40px rgba(255, 102, 204, 0.15),
    inset 0 0 20px rgba(255, 102, 204, 0.05),
    0 0 28px rgba(255, 102, 204, 0.12);
}

.ts-card-male,
.ts-card-female {
  background-position: center center;
  background-size: contain;
  background-repeat: no-repeat;
}

.ts-card-male {
  background-image: url('image/남자.webp');
}

.ts-card-female {
  background-image: url('image/여자.webp');
}

.ts-card-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.ts-card-male .ts-card-title::before,
.ts-card-male .ts-card-title::after,
.ts-card-female .ts-card-title::before,
.ts-card-female .ts-card-title::after {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1em;
  font-size: 0.9em;
  line-height: 1;
}

.ts-card-male .ts-card-title::before,
.ts-card-male .ts-card-title::after {
  content: "❖";
  color: #b7e7ff;
  text-shadow: 0 0 10px rgba(102, 204, 255, 0.5);
}

.ts-card-female .ts-card-title::before,
.ts-card-female .ts-card-title::after {
  content: "⚜";
  color: #ffd9ee;
  text-shadow: 0 0 10px rgba(255, 162, 220, 0.52);
}

/* 🌟 설정창 내부 액션 버튼 스타일 */
.settings-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccc;
  padding: 12px 20px;
  font-size: 1.05em;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 0 !important; /* 직각 */
}
.settings-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.settings-action-btn.active {
  background: rgba(255, 218, 102, 0.15);
  color: #ffda66;
  border-color: #ffda66;
}

/* 🌟 뮤직 플레이어 모달 오버레이 (좌측 하단 정렬 및 투명화 버그 픽스) */
.music-modal-overlay {
  justify-content: flex-start !important;
  align-items: flex-end !important;
  padding: 20px 0 20px 20px !important;
  pointer-events: none; 
  background: transparent !important; /* 전체 화면이 어두워지는 현상 방지 */
}

/* 창이 열렸을 때 무조건 노출 강제 */
.music-modal-overlay.show {
  opacity: 1 !important; 
}

/* 🌟 사운드 트랙 전용 레이아웃 (무조건 화면에 보이도록 강제 고정) */
.music-modal-content {
  width: 90vw !important;
  max-width: 600px !important; /* 가로 길이를 600px로 일치시킴 */
  height: auto !important;
  min-height: 400px !important;
  padding: 0 !important; 
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden; 
  border-radius: 0 !important;
  pointer-events: auto; 
  
  background: rgba(0, 0, 0, 0.95) !important; /* 확실한 검은색 배경 */
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 30px 60px rgba(0,0,0,0.9) !important;
  
  /* 숨겨지는 버그 방지를 위해 위치 강제 고정 및 렌더링 확정 */
  transform: none !important;
  opacity: 1 !important; 
  visibility: visible !important;
}

/* 🌟 음악창(사운드트랙) 닫기(X) 버튼 위치 우상단으로 바짝 밀착 */
#musicModal .close-btn {
  top: 15px !important;
  right: 15px !important;
  z-index: 1000 !important;
}

.music-modal-content .mp3-container {
  padding: 25px 20px !important; /* 내부 패딩 축소 */
}
.music-modal-content .mp3-title {
  font-size: 1.4em !important; /* 타이틀 축소 */
  margin-bottom: 15px !important;
  padding-bottom: 10px !important;
}
.music-modal-content .track-item {
  padding: 12px 15px !important; /* 트랙 리스트 패딩 축소 */
  font-size: 0.9em !important;
}
.music-modal-content .mp3-player-bottom {
  padding: 15px !important; /* 하단 플레이어 패딩 축소 */
  margin-top: 15px !important;
}
.music-modal-content .now-playing-text {
  font-size: 1.1em !important;
  margin-bottom: 10px !important;
}
.music-modal-content .volume-box {
  width: 100% !important; /* 가로폭에 맞게 */
  flex: 1;
}

.close-btn {
  position: absolute; top: 25px; right: 30px;
  background: transparent; border: none; color: #888;
  font-size: 2em; cursor: pointer; transition: color 0.2s ease, transform 0.2s ease; z-index: 100;
}
.close-btn:hover { color: #fff; transform: scale(1.1); }

/* 상하 분할 구조 */
.mp3-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 40px;
  box-sizing: border-box;
}

/* 상단 트랙 리스트 */
.mp3-list-side {
  flex: 1;
  display: flex; flex-direction: column; min-height: 300px; max-height: 50vh;
}
.mp3-title {
  margin: 0 0 20px 0; font-size: 1.8em; color: #f0f0f0; font-weight: 300; letter-spacing: 0.1em; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px;
}
.tracklist-box {
  flex: 1; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255,255,255,0.05); box-shadow: inset 0 0 20px rgba(0,0,0,0.8); border-radius: 0; overflow-y: auto; margin-bottom: 25px; padding: 10px 0;
  scrollbar-width: thin; scrollbar-color: #555 transparent;
}
.tracklist-box::-webkit-scrollbar { width: 6px; }
.tracklist-box::-webkit-scrollbar-thumb { background: #555; border-radius: 0; }

.track-list { list-style: none !important; margin: 0; padding: 0; }
.track-list li { list-style-type: none !important; } 

.track-item {
  padding: 16px 25px; border-bottom: 1px solid rgba(255,255,255,0.03); cursor: pointer; display: flex; gap: 15px; text-align: left;
  transition: background 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
  color: #8a939b; font-weight: 300; letter-spacing: 0.05em;
}
.track-item:hover { background: rgba(255,255,255,0.05); color: #fff; padding-left: 32px; }
.track-item:last-child { border-bottom: none; }
.track-item.active { background: rgba(255,255,255,0.1); color: #ffda66; font-weight: bold; border-left: 4px solid #ffda66; padding-left: 32px; }
.track-num { opacity: 0.4; font-size: 0.9em; font-family: sans-serif; }

/* 하단 플레이어 파트 */
.mp3-player-bottom {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.03);
  padding: 20px 30px;
  border: 1px solid rgba(255,255,255,0.05);
  margin-top: 10px;
}

.now-playing-text {
  font-size: 1.4em; color: #fff; font-weight: 300; letter-spacing: 0.05em;
  text-align: left; margin-bottom: 15px; text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* 프로그레스 바 (유튜브 스타일) - 하얀색 선 & 동그라미 정렬 수정 */
.progress-container {
  display: flex; align-items: center; gap: 15px; width: 100%; margin-bottom: 25px; /* 하단 여백 약간 추가 */
}
.progress-container span {
  color: #aaa; font-family: monospace; font-size: 1.1em; min-width: 45px;
}
#songProgressBar {
  flex: 1; -webkit-appearance: none; appearance: none; height: 6px; background: rgba(255,255,255,0.2); outline: none; cursor: pointer; transition: 0.2s;
  background-image: linear-gradient(#ffffff, #ffffff); background-repeat: no-repeat; background-size: 0% 100%;
  border-radius: 3px; /* 선 양끝을 살짝 둥글게(선택) */
}

/* 🌟 동그라미(Thumb)가 선 중앙에 오도록 margin-top 정밀 교정 ( (선높이 - 손잡이높이) / 2 ) */
#songProgressBar::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; 
  background: #ffffff; cursor: pointer; box-shadow: 0 0 10px rgba(255, 255, 255, 0.6); 
  transition: transform 0.1s;
  margin-top: -4px; /* 높이 6px인 선의 중앙에 14px 동그라미 배치: (6-14)/2 = -4 */
}
#songProgressBar::-webkit-slider-thumb:hover { transform: scale(1.3); }

/* 하단 컨트롤 & 볼륨 레이아웃 */
.controls-row {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
}

.music-controls {
  display: flex; align-items: center; gap: 20px;
}
.ctrl-btn {
  background: transparent; border: none; color: #bbb;
  width: 44px; height: 44px; display: flex; justify-content: center; align-items: center;
  cursor: pointer; transition: all 0.2s ease; border-radius: 0;
}
.ctrl-btn:hover { color: #fff; transform: scale(1.1); }
.ctrl-btn:active { transform: scale(0.9); }
.ctrl-btn svg { width: 28px; height: 28px; }
.ctrl-btn.play-pause { width: 56px; height: 56px; }
.ctrl-btn.play-pause svg { width: 40px; height: 40px; }

/* 🌟 볼륨 조절 바 영역을 유동적으로 남은 공간 전체 차지하게 확장 */
.volume-box { display: flex; align-items: center; gap: 15px; flex: 1; min-width: 250px; } 
.volume-box label { color: #aaa; display: flex; align-items: center; margin: 0; cursor: pointer; transition: color 0.2s ease; }
.volume-box label:hover { color: #fff; }
.volume-box input[type=range] { flex: 1; width: 100%; }
#volumeValue { color: #fff; font-weight: normal; font-size: 0.95em; min-width: 45px; text-align: right; }

/* 🌟 볼륨 조절 바 동그라미(Thumb) 중앙 정렬 교정 */
input[type=range]#masterVolume::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; 
  height: 16px; width: 16px; border-radius: 50%; 
  background: #ffffff; cursor: pointer; 
  margin-top: -6px;
  box-shadow: 0 0 8px rgba(0,0,0,0.8);
}

/* 🌟 좌측 하단 알림 팝업 (Now Playing) 스타일 - 팝업 가려짐 픽스 */
.toast-notification {
  position: fixed;
  bottom: 80px; 
  left: -500px; 
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 3px solid #ffda66;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.7);
  z-index: 2147483647 !important; /* 🌟 모달창에 가려지지 않게 최상위 고정 */
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
  opacity: 0;
  border-radius: 0 !important; 
  pointer-events: none; /* 클릭 방해 금지 */
}
.toast-notification.show {
  transform: translateX(520px) translateZ(100px); /* 🌟 Z축 위상 강제 조절로 맨 앞에 나오게 함 */
  opacity: 1;
}
.toast-content { display: flex; flex-direction: row; align-items: baseline; gap: 8px; }
.toast-title { color: #aaa; font-size: 1.05em; font-weight: normal; letter-spacing: 0.05em; }
.toast-song { color: #ffda66; font-size: 1.1em; font-weight: bold; white-space: nowrap; text-shadow: 0 0 10px rgba(255, 218, 102, 0.3); }

.vision-overlay {
  position: fixed;
  inset: 0;
  z-index: -5; 
  pointer-events: none;
  overflow: hidden;
  
  
  background: radial-gradient(circle at center, rgba(25, 35, 44, 0.4) 0%, rgba(18, 18, 19, 0.8) 100%);
  backdrop-filter: blur(2px) contrast(1.2);
  
  opacity: 0;
  transition: opacity 2s ease-in-out;
}
.vision-overlay.show {
  opacity: 1;
}

.black-shard-up {
  position: absolute;
  bottom: -20vh; 
  background: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0));
  animation: fly-up linear forwards;
  border-radius: 5px;
}
@keyframes fly-up {
  0% { transform: translateY(0); }
  100% { transform: translateY(-120vh); } 
}

.black-shard-down {
  position: absolute;
  top: -20vh; 
  background: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
  animation: fall-down linear forwards;
  border-radius: 5px;
}
@keyframes fall-down {
  0% { transform: translateY(0); }
  100% { transform: translateY(120vh); } 
}

#loreEventImage {
  transition: opacity 0.5s ease-in-out;
  opacity: 1;
}

body.show-vision-bg::before,
body.show-vision-bg-2::before,
body.show-vision-bg-city::before {
  
  transition: opacity 0.5s ease-in-out, filter 0.5s ease-in-out !important;
}

body.show-vision-bg::before {
  background-image: url('image/realitySinking.webp') !important;
  filter: blur(4px) brightness(0.4) contrast(1.1) !important; 
  opacity: 1 !important;
  z-index: -10 !important;
}

body.show-vision-bg-2::before {
  background-image: url('image/realitySinking2.webp') !important;
  filter: blur(4px) brightness(0.4) contrast(1.1) !important; 
  opacity: 1 !important;
  z-index: -10 !important;
}

body.show-vision-bg-city::before {
  background-image: url('image/eveCity.webp') !important;
  filter: blur(4px) brightness(0.4) contrast(1.1) !important; 
  opacity: 1 !important;
  z-index: -10 !important;
}

body.bg-fade-out::before {
  opacity: 0 !important;
}

.glitch-blink {
  opacity: 1 !important;
  background: #000 !important;
  z-index: 999999 !important; 
  animation: black-glitch-blink 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes black-glitch-blink {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  30%  { opacity: 0; }
  45%  { opacity: 1; }
  60%  { opacity: 0; }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

#eveChoices:not(.hidden),
#loreChoices1:not(.hidden) {
  display: flex !important;
  flex-direction: row !important; 
  flex-wrap: wrap !important;     
  justify-content: center !important; 
  align-items: center !important;
  gap: 12px !important;           
  width: 100% !important;
  max-width: 1400px !important;   
  margin: 20px auto 0 !important;
}

/* Eve prologue: stretch the panel, then JS keeps the whole block framed */
#eveContainer:not(.hidden) {
  height: calc(100vh - clamp(56px, 10vh, 120px) - 80px) !important;
  height: calc(100dvh - clamp(56px, 10dvh, 120px) - 80px) !important;
  min-height: 0 !important;
  margin-bottom: 0 !important;
}

#eveContainer:not(.hidden) .eve-image-box {
  min-height: 0 !important;
  height: 100% !important;
}

/* Eve dialogue bottom scroll space */
#eveChoices:not(.hidden) {
  margin-bottom: 0 !important;
  flex-shrink: 0;
}
#eveChoices.hidden,
#loreChoices1.hidden {
  display: none !important;
}

#eveChoices button.choice,
#loreChoices1 button.choice {
  width: auto !important;         
  max-width: none !important;
  margin-top: 0 !important;       
}

#loreEventImage {
  transition: opacity 0.5s ease-in-out, filter 0.8s ease-in-out;
  opacity: 1;
}

.holy-flash {
  animation: holy-burst-transition 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes holy-burst-transition {
  0% {
    filter: brightness(1) contrast(1);
    box-shadow: 0 12px 28px rgba(0,0,0,0.55);
  }
  30% {
    
    filter: brightness(5) contrast(1.5) drop-shadow(0 0 50px rgba(255, 230, 150, 1));
    box-shadow: 0 0 100px rgba(255, 240, 180, 1), 0 0 200px rgba(255, 215, 0, 0.8);
  }
  100% {
    
    filter: brightness(1) contrast(1);
    box-shadow: 0 12px 28px rgba(0,0,0,0.55);
  }
}

.golden-border-glow {
  display: none !important;
}

#creditModal {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(0, 0, 0, 0.5) !important; 
}

.credit-content {
  position: relative;
  overflow-y: auto;
  max-height: 90vh;
  
  background: rgba(90, 90, 90, 0.15) !important;
  
  
  backdrop-filter: blur(20px) saturate(120%) !important;       
  -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
  
  
  border: 1px solid rgba(255, 255, 255, 0.6) !important; 
  border-radius: 12px;
  
  width: 90%;
  max-width: 550px;
  padding: 50px 40px;
  text-align: center;
  
  
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.05) !important;
  
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#creditModal.show .credit-content {
  transform: translateY(0);
}

.credit-title {
  margin: 0 0 25px 0;
  font-size: 2em;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.6); 
}

.credit-text {
  color: #eeeeee; 
  font-size: 1.1em;
  line-height: 1.8;
  letter-spacing: 0.03em;
  font-weight: 300;
}

.credit-text p {
  margin: 0 0 12px 0;
}

.credit-footer {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.5) !important;
  margin-top: 30px !important;
}

.credit-content .close-btn {
  position: absolute;
  top: 20px;
  right: 25px;
  background: transparent;
  border: none;
  font-size: 1.5em;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.credit-content .close-btn:hover {
  color: #ffffff;
  transform: scale(1.1);
}

#essenceBloomSection.hidden {
  display: none !important;
}

.essence-bloom-section-wrapper {
  margin-top: 40px !important;
  text-align: left;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

#btnEssenceBloom {
  border-color: rgba(255, 215, 0, 0.5) !important;
  box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.5) !important;
  transition: all 0.5s ease;
  overflow: hidden;
}

#btnEssenceBloom:hover {
  
  background: rgba(12, 12, 14, 0.66) !important;
  border-color: rgba(255, 215, 0, 0.8) !important;
  box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.2), 0 8px 20px rgba(0, 0, 0, 0.6) !important;
}

#btnEssenceBloom.selected {
  background: #070707 !important;
  border-color: #3a0000 !important;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.9), 0 5px 20px rgba(50,0,0,0.6) !important;
}

#btnEssenceBloom .choiceTitle {
  font-size: 1.4em !important; 
  margin-bottom: 20px !important;
}

#btnEssenceBloom .choiceComment {
  font-size: 1.1em !important; 
  line-height: 1.8 !important;
}

.essence-title-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 1.8em;
}

.essence-title-gold {
  position: absolute;
  color: #ffda66;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  font-weight: bold;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}

.essence-title-dark {
  position: absolute;
  transform: scale(0.5);
  color: #000000;
  text-shadow: 0 0 15px rgba(0,0,0,1), 0 0 30px rgba(150,0,0,0.8);
  font-weight: 900;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  pointer-events: none;
}

#btnEssenceBloom.selected .essence-title-gold {
  opacity: 0;
  transform: scale(1.5);
  filter: blur(5px);
  text-shadow: 
    -25px -25px 10px rgba(255, 215, 0, 0),
     25px  25px 10px rgba(255, 215, 0, 0),
    -25px  25px 10px rgba(255, 215, 0, 0),
     25px -25px 10px rgba(255, 215, 0, 0);
}

#btnEssenceBloom.selected .essence-title-dark {
  opacity: 1;
  transform: scale(1.15);
}

.essence-text-normal {
  position: relative; 
  width: 100%;
  transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
  text-align: center;
}

.essence-text-dark {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  color: #880000;
  font-size: 1.1em;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-50%) scale(0.9);
  filter: blur(4px);
  transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
  text-align: center;
  pointer-events: none;
}

#btnEssenceBloom.selected .essence-text-normal {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(-10px);
  pointer-events: none;
}

#btnEssenceBloom.selected .essence-text-dark {
  opacity: 1;
  filter: blur(0);
  transform: translateY(-50%) scale(1);
}

.essence-detail-box {
  background: rgba(15, 15, 15, 0.85) !important; 
  border: 1px solid rgba(255, 215, 0, 0.3) !important; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 20px rgba(255, 215, 0, 0.05) !important; 
  padding: 40px 50px !important;
}

.essence-detail-title {
  text-align: center !important;
  font-size: 1.4em !important;
  color: #ffda66 !important;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5) !important;
  margin-bottom: 40px !important;
}

.essence-detail-content {
  text-align: left !important;
  line-height: 1.8 !important;
}

.essence-detail-subtitle {
  color: #ffda66 !important;
  font-size: 1.2em !important;
  margin-bottom: 12px !important;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2) !important;
  padding-bottom: 8px !important;
}

.essence-detail-text {
  color: #d2d2d2 !important;
  margin-bottom: 35px !important;
  word-break: keep-all !important;
}

.essence-detail-list {
  color: #aaaaaa !important;
  margin-bottom: 25px !important;
  padding-left: 20px !important;
  line-height: 1.7 !important;
}
.essence-detail-list li {
  margin-bottom: 10px !important;
}
.essence-detail-list strong {
  color: #ffffff !important;
}

.essence-detail-warning {
  color: #ff8888 !important;
  font-weight: bold !important;
  background: rgba(255, 0, 0, 0.1) !important;
  padding: 12px 16px !important;
  border-radius: 8px !important;
  border-left: 4px solid #ff4d4d !important;
  word-break: keep-all !important;
  box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.05) !important;
}

/* 🌟 플로팅 버튼 좌우 간격 56px씩 띄워서 재배치 */
.music-btn {
  left: 76px;
}
.music-btn:hover svg {
  transform: scale(1.1) translateY(-2px);
}
/* 🌟 하단 플로팅 버튼 간격 강제 고정 (겹침 방지) */
#settingsBtn { left: 20px !important; }
#musicBtn { left: 76px !important; }
#statusBtn { left: 132px !important; }
#statToggleBtn { left: 188px !important; }
#exchangeBtn { left: 244px !important; }
#exportBtn { left: 300px !important; }
#saveGameBtn { left: 356px !important; }

#settingsBtn:hover svg, #musicBtn:hover svg, #statusBtn:hover svg, #statToggleBtn:hover svg {
  transform: scale(1.1) translateY(-2px);
}
#exchangeBtn:hover svg {
  transform: rotate(180deg) scale(1.1);
}
#exportBtn:hover svg {
  transform: translateY(2px) scale(1.1);
}
.exchange-btn {
  left: 244px; 
}
.exchange-btn:hover svg {
  transform: rotate(180deg) scale(1.1);
}
.export-btn {
  left: 300px;
}
.export-btn:hover svg {
  transform: translateY(2px) scale(1.1);
}
.save-btn {
  left: 356px;
}
#saveGameBtn:hover svg {
  transform: scale(1.1) translateY(-2px);
}

.stat-modal-content {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  display: block !important; /* 🌟 flex 버그 회피를 위해 block으로 변경 */
  overflow-y: auto !important; /* 🌟 메인 창에 스크롤 생성 */
  overflow-x: hidden !important;
  
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;

  padding: 8vh 20px 8vh 20px !important; /* 🌟 상하단 여백 확보 */
  box-sizing: border-box !important;
}

/* 🌟 #statCloseBtn은 스크롤되는 .stat-modal-content 내부가 아니라 그 바깥
   #statModalOverlay의 형제로 옮겨져 있음(스탯창을 스크롤해도 X버튼이 같이
   밀려서 사라지지 않도록). 그래서 더 이상 .stat-modal-content .close-btn로
   찾히지 않으므로 id로 직접 지정한다. */
#statCloseBtn {
  top: 2vh !important;
  right: max(14px, calc(50% - 475px)) !important;
  position: fixed !important;
  z-index: 100;
  color: #fff;
  opacity: 0.6;
  transition: opacity 0.2s;
}
#statCloseBtn:hover { opacity: 1; }

#statModalScrollArea {
  display: block !important; /* 🌟 flex 해제 */
  
  width: min(900px, 92vw) !important; 
  height: auto !important; 
  max-height: none !important; /* 🌟 내부 최대 높이 제한 해제 (부모 창이 스크롤하도록 맡김) */
  margin: 0 auto !important; /* 🌟 가로 중앙 정렬 유지 */
  
  overflow: visible !important; 
  padding: 40px 26px 56px; 

  background: rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(10px) saturate(110%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(110%) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7), inset 0 0 20px rgba(255,255,255,0.02) !important;
  border-radius: 16px;
}

#statModalScrollArea > .stat-tab-container {
  flex: 0 0 auto;
  width: 100%;
  margin: 0 0 28px;
}

#statModalScrollArea.show-guide {
  gap: 40px;
  max-width: 1550px; 
}

#statModalScrollArea::-webkit-scrollbar { width: 6px; }
#statModalScrollArea::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

#statModalScrollArea #statSection { 
  width: 100% !important;
  max-width: 820px !important; 
  margin: 0 auto !important; 
  border: none; 
  box-shadow: none; 
  background: transparent !important; 
  padding-top: 0;
  display: flex;
  flex-direction: column;
}

.statExplainRow {
  width: 100% !important; 
  max-width: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  
  background: transparent !important; 
  border: none !important;
  box-shadow: none !important;
}

.statExplainRow::-webkit-scrollbar { width: 4px; }
.statExplainRow::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.statExplainRow.show-guide {
  flex: 0 1 600px !important; 
  opacity: 1;
  pointer-events: auto;
  padding: 10px 0 !important; 
}

.stat-guide-toggle-btn {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #bbb;
  border-radius: 12px;
  font-family: var(--font-kr);
  font-size: 1.1em;
  font-weight: bold;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.stat-guide-toggle-btn.small-btn {
  width: fit-content;
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 0.9em;
  border-radius: 8px;
}
.stat-guide-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}
.stat-guide-toggle-btn.active {
  background: rgba(255, 218, 102, 0.1);
  color: #ffda66;
  border-style: solid;
  border-color: rgba(255, 218, 102, 0.4);
}

#nameModalOverlay,
#startWarningOverlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#nameModalOverlay.show,
#startWarningOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

.rpg-modal-band {
  width: 100%;
  background: rgba(15, 15, 15, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  box-shadow: 0 15px 40px rgba(0,0,0,0.8);
  border-top: 1px solid rgba(200, 200, 200, 0.5);
  border-bottom: 1px solid rgba(200, 200, 200, 0.5);
}

.rpg-modal-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 200, 200, 0.5), transparent);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.rpg-modal-content {
  padding: 50px 20px;
  text-align: center;
}

.rpg-modal-title {
  font-family: "Georgia", serif;
  color: #e0e0e0; 
  font-size: 1.8em;
  font-weight: normal;
  margin: 0 0 20px 0;
  letter-spacing: 0.05em;
}

.rpg-modal-desc {
  color: #888;
  font-size: 0.95em;
  line-height: 1.6;
  margin: 0 0 35px 0;
  letter-spacing: 0.02em;
}

.rpg-name-input {
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.4em;
  text-align: center;
  padding: 12px 20px;
  width: 400px;
  max-width: 90vw;
  font-family: inherit;
  outline: none;
  margin-bottom: 40px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rpg-name-input:focus {
  border-color: rgba(200, 200, 200, 0.8);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

.rpg-modal-actions {
  display: flex;
  justify-content: center;
  gap: 60px; 
}

.rpg-action-btn {
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.35em;
  font-family: "Georgia", "Noto Serif KR", serif;
  cursor: pointer;
  transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.1s ease;
  padding: 0;
  letter-spacing: 0.08em;
}

.rpg-action-btn:hover { 
  color: #fff; 
  text-shadow: 0 0 15px rgba(100, 200, 255, 0.8), 0 0 5px rgba(100, 200, 255, 0.5);
}

.rpg-action-btn:active { transform: scale(0.95); }

#nameModalOverlay .rpg-action-btn:hover { 
  color: #fff; 
  text-shadow: 0 0 15px rgba(100, 200, 255, 0.8), 0 0 5px rgba(100, 200, 255, 0.5);
}

#startWarningText {
  color: #e8e8e8;
  font-size: 1.1em;
  line-height: 1.8;
  margin-bottom: 40px;
  word-break: keep-all;
}

#startWarningOverlay .yes-glow:hover {
  color: #fff !important;
  text-shadow: 0 0 15px rgba(100, 200, 255, 0.9), 0 0 5px rgba(100, 200, 255, 0.6) !important;
}

#startWarningOverlay .no-glow:hover {
  color: #fff !important;
  text-shadow: 0 0 15px rgba(255, 77, 77, 0.9), 0 0 5px rgba(255, 77, 77, 0.6) !important;
}

.stat-profile-header {
  display: flex;
  flex-direction: column;
  gap: 25px; 
  width: 100%;
  padding: 0 10px; 
  margin-bottom: 35px; 
  box-sizing: border-box;
}

.profile-name-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 6px;
}

.status-top-name {
  margin: 0 10px 18px;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; 
  gap: 30px;
  align-items: start;
}

.profile-item-full {
  grid-column: 1 / -1;
}

.profile-left, .profile-right {
  display: flex;
  flex-direction: column;
  gap: 18px; 
}
.stat-name-input-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15); 
  transition: all 0.2s ease;
  padding-bottom: 4px;
}
.stat-name-input-wrapper:focus-within {
  border-bottom-color: rgba(255, 255, 255, 0.6); 
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}
.stat-name-input {
  flex: 1; background: transparent; border: none; border-radius: 0;
  color: #e8e8e8; font-family: inherit; font-size: 1.15em; font-weight: 400; 
  padding: 4px 0 6px 0; transition: all 0.2s ease; box-shadow: none; box-sizing: border-box;
}
.stat-name-input:focus { outline: none; }
/* 🌟 margin-left를 margin-right로 변경 */
.edit-icon { width: 18px; height: 18px; color: rgba(255, 255, 255, 0.25); margin-right: 10px; margin-bottom: 2px; cursor: text; transition: color 0.2s ease; }
.stat-name-input-wrapper:focus-within .edit-icon { color: rgba(255, 255, 255, 0.8); }

.profile-info-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 14px;
}
.profile-item { display: flex; flex-direction: column; align-items: flex-start; }
.profile-label { font-size: 0.85em; color: #777; letter-spacing: 0.05em; margin-bottom: 6px; }
.profile-value { font-size: 1.1em; font-weight: 400; color: #d2d2d2; text-shadow: none; }

.highlight-class {
  color: #ffda66;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 218, 102, 0.3);
}

.trait-list-wrap { width: 100%; }
.trait-tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trait-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9em;
  color: #e0e0e0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  white-space: nowrap;
}
.trait-tag.empty {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #666;
  box-shadow: none;
}

.statExplainDesc {
  display: flex;
  flex-direction: column;
  margin-top: 1px;
}

.desc-main {
  margin-bottom: 14px; 
  color: #e0e0e0;      
  font-weight: 500;
  line-height: 1.5;
  word-break: keep-all;
}

.desc-tier {
  margin-bottom: 6px;  
  color: #9a9a9a;      
  line-height: 1.45;
  font-size: 0.95em;
  word-break: keep-all;
}

.desc-tier:last-child {
  margin-bottom: 0;
}

.dust-vanish {
  animation: dust-fade-out 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes dust-fade-out {
  0% { 
    opacity: 1; 
    filter: blur(0px) sepia(0) contrast(1); 
    transform: translate(0, 0) scale(1); 
  }
  40% { 
    opacity: 0.8; 
    
    filter: blur(3px) sepia(0.6) contrast(1.2); 
    transform: translate(5px, -5px) scale(1.02); 
  }
  100% { 
    opacity: 0; 
    
    filter: blur(15px) sepia(1) contrast(1.5); 
    transform: translate(15px, -25px) scale(1.05); 
  }
}

.glitch-vanish {
  animation: image-glitch-out-bw 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

@keyframes image-glitch-out-bw {
  0% { opacity: 1; transform: translate(0); filter: grayscale(1) brightness(1) contrast(1); clip-path: inset(0 0 0 0); }
  10% { transform: translate(-5px, 2px); filter: grayscale(1) brightness(1.5) contrast(2); clip-path: inset(20% 0 40% 0); }
  20% { transform: translate(5px, -2px); filter: grayscale(1) invert(0.8); opacity: 0.8; clip-path: inset(10% 0 60% 0); }
  30% { transform: translate(-2px, 5px); filter: grayscale(1) brightness(0.5) contrast(3); clip-path: inset(50% 0 10% 0); opacity: 1; }
  40% { transform: translate(4px, -5px); filter: grayscale(1) brightness(1.2) contrast(1.5); clip-path: inset(30% 0 20% 0); opacity: 0.5; }
  50% { transform: translate(0); filter: grayscale(1) invert(1); clip-path: inset(0 0 0 0); opacity: 0.9; }
  60% { transform: translate(-6px, 0) skewX(20deg); filter: grayscale(1) brightness(2); clip-path: inset(40% 0 40% 0); opacity: 0.4; }
  70% { transform: translate(6px, 0) skewX(-20deg); filter: grayscale(1) brightness(0); clip-path: inset(10% 0 80% 0); opacity: 0.8; }
  80% { transform: translate(-2px, 2px); filter: grayscale(1) contrast(4); clip-path: inset(70% 0 5% 0); opacity: 0.2; }
  90% { transform: translate(2px, -2px); filter: grayscale(1) brightness(3); clip-path: inset(20% 0 50% 0); opacity: 0.6; }
  100% { opacity: 0; transform: translate(0) scale(0.95); filter: grayscale(1) brightness(0); clip-path: inset(50% 0 50% 0); }
}

.class-card {
  min-height: 180px !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  background: linear-gradient(145deg, rgba(20,20,20,0.8), rgba(5,5,5,0.9)) !important;
}

.class-card:hover {
  transform: translateY(-5px) !important;
}

.constellation-container {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 50%, #151a20 0%, #080a0c 60%, #000000 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.constellation-container .close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  z-index: 1000;
  color: #fff;
  font-size: 2.5em;
  opacity: 0.7;
}

.stigma-header {
  height: 90px;
  background: rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 0 40px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.stigma-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 140px; 
}

.stigma-label { font-size: 0.9em; color: #888; letter-spacing: 0.05em; }
.stigma-value { font-size: 1.8em; font-weight: bold; color: #e0e0e0; font-family: monospace; }
.stigma-value.highlight { color: #ffcc66; text-shadow: 0 0 15px rgba(255, 204, 102, 0.6); }

.stigma-converter {
  display: flex;
  gap: 15px;
  align-items: center;
}

.extract-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px; 
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.05);
  user-select: none;
}
.extract-btn:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255,255,255,0.1); }
.extract-btn:active { transform: translateY(1px); }
.extract-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }

.extract-btn.refund {
  border-color: rgba(255, 100, 100, 0.4);
  color: #ff8888;
}
.extract-btn.refund:hover:not(:disabled) {
  background: rgba(255, 50, 50, 0.15);
  box-shadow: 0 5px 15px rgba(255, 50, 50, 0.2);
  color: #ffcccc;
}

.class-modal-container {
  width: 95vw;
  max-width: 1400px; 
  height: 85vh;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}

.class-global-point-bottom {
  position: absolute;
  bottom: 30px;    
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95em; 
  color: #aaa;
  z-index: 100;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 24px; 
  border-radius: 999px; 
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
}
.class-global-point-bottom .highlight {
  color: #ffda66;  
  font-weight: bold;
  font-size: 1.15em; 
  margin-left: 8px;
  text-shadow: 0 0 10px rgba(255, 218, 102, 0.6);
}

.class-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.class-sidebar {
  width: 22%; 
  min-width: 260px; 
  background: rgba(20, 20, 20, 0.8);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
}
.sidebar-title {
  padding: 15px 20px;
  font-size: 0.9em;
  color: #666;
  letter-spacing: 0.1em;
  font-weight: bold;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.class-tree-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}
.class-tree-list::-webkit-scrollbar { width: 4px; }
.class-tree-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

.tree-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  color: #888;
}
.tree-item:hover { background: rgba(255,255,255,0.03); color: #ccc; }
.tree-item.selected { background: rgba(255,255,255,0.05); border-left-color: var(--item-color, #fff); color: #fff; }
.tree-item.locked { opacity: 0.4; cursor: not-allowed; }
.tree-item.unlocked { color: var(--item-color, #fff); font-weight: bold; text-shadow: 0 0 10px rgba(255,255,255,0.2); }

.tree-tier { font-size: 0.75em; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,0.5); }

.tier-1 { padding-left: 20px; }
.tier-2 { padding-left: 40px; position: relative; }
.tier-2::before { content: "└"; position: absolute; left: 22px; color: #444; }
.tier-3 { padding-left: 60px; position: relative; }
.tier-3::before { content: "└"; position: absolute; left: 42px; color: #444; }

.class-content {
  flex: 1;
  position: relative;
  
  
  background: rgba(5, 5, 8, 0.45);
  backdrop-filter: blur(5px); 
  -webkit-backdrop-filter: blur(5px);
  
  overflow-y: auto;
}
.class-detail-empty {
  position: absolute; inset: 0;
  display: flex; justify-content: center; align-items: center;
  color: #555; font-size: 1.2em; letter-spacing: 0.05em;
}

.class-detail-wrap { 
  padding: 40px 60px; 
  display: flex; 
  flex-direction: column; 
  gap: 30px; 
}

.class-info-box {
  text-align: center;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
  width: 100%;
  max-width: 900px; 
  margin: 0 auto;
}

.class-tier { font-size: 0.9em; color: #aaa; letter-spacing: 0.1em; margin-bottom: 10px; }
.class-name { font-size: 2.5em; margin: 0 0 15px 0; color: var(--item-color, #fff); text-shadow: 0 0 20px var(--item-color, #fff); }
.class-desc { font-size: 1.1em; color: #ccc; line-height: 1.6; word-break: keep-all; }

.class-unlock-section { margin-top: 25px; background: rgba(0,0,0,0.3); padding: 20px; border-radius: 8px; border: 1px dashed rgba(255,255,255,0.2); transition: 0.3s ease; }
.class-unlock-section p { margin: 0 0 15px 0; color: #aaa; }
.class-unlock-section span { color: #ffcc66; font-weight: bold; font-size: 1.2em; }
.class-unlock-btn { padding: 12px 30px; font-size: 1.1em; font-weight: bold; background: var(--item-color, #555); color: #000; border: none; border-radius: 6px; cursor: pointer; box-shadow: 0 0 15px var(--item-color, #555); transition: 0.2s; }
.class-unlock-btn:hover:not(:disabled) { transform: scale(1.05); filter: brightness(1.2); }
.class-unlock-btn:disabled { opacity: 0.3; cursor: not-allowed; box-shadow: none; filter: grayscale(1); }

.class-unlock-section.refund-mode { border-color: rgba(255, 50, 50, 0.4); background: rgba(50, 0, 0, 0.2); }
.class-unlock-btn.refund-mode { background: #111; color: #ff4d4d; border: 1px solid #ff4d4d; box-shadow: 0 0 10px rgba(255, 50, 50, 0.3); }
.class-unlock-btn.refund-mode:hover:not(:disabled) { background: #ff4d4d; color: #fff; box-shadow: 0 0 20px #ff4d4d; }

.stigma-converter-box {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(0,0,0,0.5); padding: 15px 25px; border-radius: 8px; margin-bottom: 20px;
  border-left: 4px solid var(--item-color, #fff);
}
.stigma-status { display: flex; flex-direction: column; }
.stigma-label { font-size: 0.85em; color: #888; margin-bottom: 5px; }
.stigma-val { font-size: 1.8em; font-weight: bold; color: var(--item-color, #fff); text-shadow: 0 0 10px var(--item-color, #fff); }

.stigma-actions { display: flex; gap: 10px; }
.stigma-btn { padding: 10px 15px; border-radius: 6px; font-weight: bold; border: 1px solid rgba(255,255,255,0.2); background: #111; color: #ccc; cursor: pointer; transition: 0.2s; }
.stigma-btn.extract:hover:not(:disabled) { background: var(--item-color, #fff); color: #000; }
.stigma-btn.refund:hover:not(:disabled) { background: #ff4d4d; color: #fff; border-color: #ff4d4d; }
.stigma-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.class-stigma-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stigma-tree-container {
  position: relative;
  width: 100%;
  min-height: 480px; 
  
  
  background-color: #141414;
  
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 40px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
  
  display: flex;
  align-items: center; 
}
.stigma-tree-container::-webkit-scrollbar { height: 6px; }
.stigma-tree-container::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }

.stigma-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

.stigma-tree {
  display: flex; align-items: center; gap: 70px;
  position: relative; z-index: 2; min-width: max-content;
  margin: auto 0; 
}
.stigma-tree-level { display: flex; flex-direction: column; justify-content: center; gap: 40px; }

.stigma-circle {
  width: 56px; height: 56px; border-radius: 50%;
  
  
  background: #1a1a1a;
  border: 2px solid #3a3a3a; 
  color: #555;
  
  display: flex; justify-content: center; align-items: center;
  font-size: 1.6em;
  line-height: 0; 
  padding-bottom: 4px; 
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.stigma-circle.is-active { 
  border-color: rgba(255, 255, 255, 0.9) !important; 
  box-shadow: 0 0 20px rgba(255,255,255,0.4), inset 0 0 10px rgba(255,255,255,0.3) !important; 
  transform: scale(1.15); 
}
.stigma-circle:hover { transform: scale(1.1); filter: brightness(1.3); }

.stigma-circle.locked { opacity: 0.25; cursor: not-allowed; }

.stigma-circle.available { border-color: #888; color: #aaa; }
.stigma-circle.available:hover { border-color: #ddd; box-shadow: 0 0 15px rgba(255,255,255,0.2); }

.stigma-circle.unlocked {
  background: var(--item-color, #fff); 
  border-color: #fff; 
  color: #000;
  box-shadow: 0 0 25px var(--item-color, #fff), inset 0 0 10px rgba(255, 255, 255, 0.5); 
  text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.stigma-popup-detail {
  position: absolute;
  z-index: 100;
  width: 280px;
  
  
  background: rgba(0, 0, 0, 0.35) !important; 
  
  
  backdrop-filter: blur(12px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
  
  
  border: 1px solid rgba(255, 255, 255, 0.25) !important; 
  
  
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.95), inset 0 0 15px rgba(255, 255, 255, 0.05) !important;
  
  padding: 18px; 
  border-radius: 10px; 
  
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.stigma-popup-detail.show { opacity: 1; transform: translateY(0); }

.stigma-popup-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px; }
.stigma-popup-title { font-size: 1.15em; font-weight: bold; letter-spacing: 0.05em; color: var(--item-color, #fff); }
.stigma-popup-cost { font-size: 0.85em; color: #ffcc66; font-weight: bold; }
.stigma-popup-desc { font-size: 0.95em; color: #ccc; line-height: 1.6; margin-bottom: 18px; word-break: keep-all; }

.stigma-popup-action { display: flex; justify-content: center; }
.stigma-action-btn { width: 100%; padding: 10px; border-radius: 6px; font-weight: bold; font-size: 1em; cursor: pointer; transition: 0.2s; background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.stigma-action-btn:hover:not(:disabled) { background: var(--item-color, #fff); color: #000; box-shadow: 0 0 15px var(--item-color, #fff); border-color: #fff; }
.stigma-action-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.stigma-action-btn.refund-mode { background: rgba(255, 50, 50, 0.15); color: #ff4d4d; border-color: rgba(255, 50, 50, 0.4); }
.stigma-action-btn.refund-mode:hover:not(:disabled) { background: #ff4d4d; color: #fff; box-shadow: 0 0 15px #ff4d4d; border-color: #ff4d4d; }

.action-btn {
  background: rgba(20, 20, 20, 0.8);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px 36px;
  cursor: pointer;
  font-family: var(--font-kr);
  font-size: 1.05em;
  font-weight: bold;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: all 0.2s ease;
  margin: 0 auto;
  display: inline-block;
}

.action-btn:hover {
  background: rgba(40, 40, 40, 0.9);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
}

.action-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

#classCardBox:hover {
  transform: translateY(-4px) scale(1.02);
  filter: brightness(1.2);
}
#classCardBox:active {
  transform: translateY(2px) scale(0.98);
}

.coverflow-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1700px;  
  margin: 0 auto;
  overflow: visible;
  padding: 20px 100px; 
  box-sizing: border-box;
}

.coverflow-container {
  flex: 1;
  position: relative;
  height: 750px;      
  perspective: 1500px; 
  display: flex;
  justify-content: center;
  align-items: center;
}

.coverflow-container.slide-left { 
  animation: swipe-left 0.45s cubic-bezier(0.25, 1, 0.5, 1) forwards; 
}
.coverflow-container.slide-right { 
  animation: swipe-right 0.45s cubic-bezier(0.25, 1, 0.5, 1) forwards; 
}

@keyframes swipe-left {
  0% { 
    transform: translateX(400px) translateZ(-150px) rotateY(-20deg); 
    opacity: 0; 
  }
  100% { 
    transform: translateX(0) translateZ(0) rotateY(0deg); 
    opacity: 1; 
  }
}

@keyframes swipe-right {
  0% { 
    transform: translateX(-400px) translateZ(-150px) rotateY(20deg); 
    opacity: 0; 
  }
  100% { 
    transform: translateX(0) translateZ(0) rotateY(0deg); 
    opacity: 1; 
  }
}

.coverflow-wrap .carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  padding: 20px;
  font-size: 4em;
  
  
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  
  
  color: rgba(255, 255, 255, 0.4) !important;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  outline: none;
}

.coverflow-wrap .carousel-arrow:hover {
  color: #fff !important;
  transform: translateY(-50%) scale(1.1);
}

.coverflow-wrap .carousel-arrow:active {
  transform: translateY(-50%) scale(0.9);
}

#btnClassPrev { left: 10px; } 
#btnClassNext { right: 10px; }

.coverflow-card {
  position: absolute !important;
  width: 480px !important;        
  height: 720px !important;       
  max-width: none !important;
  background: linear-gradient(145deg, rgba(20,20,20,0.95), rgba(5,5,5,1)) !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 50px 40px !important;  
  cursor: pointer !important;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  font-family: var(--font-kr) !important;
  outline: none !important;
  overflow: hidden !important;
  margin: 0 !important;
}

.coverflow-card #carouselClassTitle, 
.coverflow-card .side-card-title {
  margin-top: 0 !important;
  order: unset !important;
}
.coverflow-card #carouselClassDesc, 
.coverflow-card .side-card-desc {
  margin-top: 0 !important;
  order: unset !important;
}

.active-card {
  transform: translateX(0) scale(1) translateZ(0) rotateY(0deg);
  z-index: 10;
  opacity: 1;
  
  
  background: rgba(15, 15, 15, 0.65) !important; 
  
  
  backdrop-filter: blur(12px) saturate(100%) !important; 
  -webkit-backdrop-filter: blur(12px) saturate(100%) !important;
  
  
  border: 1px solid rgba(255, 255, 255, 0.15) !important; 
  
  
  box-shadow: 
    0 30px 60px rgba(0,0,0,0.8), 
    inset 0 0 30px rgba(255,255,255,0.03) !important;
}

.active-card:hover {
  transform: translateX(0) scale(1.02) translateZ(30px) rotateY(0deg);
  
  background: rgba(25, 25, 25, 0.75) !important;
  box-shadow: 
    0 40px 70px rgba(0,0,0,0.9), 
    inset 0 0 40px rgba(255,255,255,0.06) !important;
  filter: brightness(1.15);
}

.active-card:active {
  transform: translateX(0) scale(0.98) translateZ(0) rotateY(0deg);
}

.side-card {
  z-index: 5;
  opacity: 0.35; 
  filter: brightness(0.4) blur(2px);
}
.side-card:hover {
  opacity: 0.7;
  filter: brightness(0.8) blur(0px);
}

#cardPrev { 
  transform: translateX(-105%) scale(0.8) rotateY(25deg); 
}
#cardNext { 
  transform: translateX(105%) scale(0.8) rotateY(-25deg); 
}

#carouselClassTitle, .side-card-title {
  font-family: "HeirofLight", "Noto Serif KR", serif !important;
  font-size: 3em !important;
  font-weight: bold;
  margin: 0 0 30px 0 !important;
  text-align: center;
  pointer-events: none;
  color: inherit;
}
#carouselClassDesc, .side-card-desc {
  font-size: 1.25em !important;
  color: #ccc;
  line-height: 1.8 !important;
  text-align: center;
  pointer-events: none;
  word-break: keep-all;
}

#genderChoices button.choice,
#hairChoices button.choice,
#hairColorChoices button.choice,
#eyeColorChoices button.choice,
#pupilChoices button.choice,
.choiceGrid3 button.choice,
.choiceGrid5 button.choice,
#heightChoices button.choice,
#historyChoices button.choice {
  justify-content: flex-start !important;
  align-items: center !important;
  min-height: 220px; 
}

#genderChoices .choiceTitle,
#hairChoices .choiceTitle,
#hairColorChoices .choiceTitle,
#eyeColorChoices .choiceTitle,
#pupilChoices .choiceTitle,
.choiceGrid3 .choiceTitle,
.choiceGrid5 .choiceTitle,
#heightChoices .choiceTitle,
#historyChoices .choiceTitle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5em !important;
  margin-bottom: 5px !important;
  width: 100%;
}

#genderChoices .choiceComment,
#hairChoices .choiceComment,
#hairColorChoices .choiceComment,
#eyeColorChoices .choiceComment,
#pupilChoices .choiceComment,
.choiceGrid3 .choiceComment,
.choiceGrid5 .choiceComment,
#heightChoices .choiceComment,
#historyChoices .choiceComment {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin-top: 10px !important;
  line-height: 1.6 !important;
  word-break: keep-all !important;
}

.body-part-img {
  width: 100% !important;
  height: auto !important;
  max-height: none !important; 
  aspect-ratio: 1050 / 1200 !important; 
  object-fit: cover !important;
  border-radius: 8px;
  margin: 0 auto 14px auto !important;
  border: 1px solid rgba(255, 255, 255, 0.15); 
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  pointer-events: none; 
  
  
  transform: translateZ(0); 
  will-change: transform, opacity;
  content-visibility: auto;
}

.fake-input-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
}

.fake-input-box {
  width: 100%;
  max-width: 400px;
  background: rgba(15, 15, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  cursor: text; 
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.6), 0 4px 10px rgba(0,0,0,0.5);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.fake-input-box:hover {
  background: rgba(25, 25, 25, 0.9);
  border-color: rgba(200, 200, 255, 0.5);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.8), 0 0 15px rgba(100, 200, 255, 0.2);
}

.fake-input-placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.15em;
  font-family: var(--font-kr);
  letter-spacing: 0.05em;
}

.fake-input-box .edit-icon {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.4);
}

.fake-input-box.completed {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  cursor: default;
}
.fake-input-box.completed .fake-input-placeholder {
  color: rgba(255, 255, 255, 0.2);
}
.fake-input-box.completed .edit-icon {
  display: none;
}

#traitChoices .body-part-img {
  width: 75% !important;        
  margin-left: auto !important; 
  margin-right: auto !important;
  
  
}

#hiddenExtraMeritChoices button.choice {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important; 
  align-items: center !important;
  min-height: 520px !important;           
  padding-top: 25px !important;           
}

#hiddenExtraMeritChoices .reqBadge {
  position: static !important;            
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-content: flex-start !important;   
  gap: 6px !important;
  width: 100% !important;
  min-height: 90px !important;            
  margin: 0 0 10px 0 !important;          
}

#hiddenExtraMeritChoices .choiceImage {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: 900 / 1080 !important; 
  object-fit: cover !important;
  border-radius: 16px !important;
  margin: 0 auto 20px auto !important;    
}

#hiddenExtraMeritChoices .choiceTitle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 3em !important;             
  width: 100% !important;
  margin: 0 0 10px 0 !important;
}

#hiddenExtraMeritChoices .choiceComment {
  flex: 1 !important;                     
  display: block !important;
  text-align: center !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  width: 100% !important;
}

.heavenly-title.melt {
  display: inline-block !important;
  height: auto !important;
  
}

@keyframes text-black-glitch {
  0%, 30% { color: #ffffff; text-shadow: 0 0 8px rgba(255, 255, 255, 0.6); transform: none; }
  
  31% { color: #000000; transform: translateX(-8px) skewX(20deg); text-shadow: 15px 0 0 rgba(255, 255, 255, 0.8); }
  32% { color: #ffffff; transform: translateX(0); text-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
  34% { color: #000000; transform: translateX(10px) skewX(-25deg); text-shadow: -20px 0 0 rgba(150, 150, 150, 0.8); }
  35% { color: #ffffff; transform: translateX(0); text-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
  37% { color: transparent; transform: translateX(-5px); text-shadow: -15px 0 0 #000000, 15px 0 0 #555555; }
  38% { color: #ffffff; transform: translateX(0); text-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
  40% { color: #000000; transform: translateX(6px) skewX(10deg); text-shadow: -12px 0 0 rgba(0, 0, 0, 0.5); }
  42%, 70% { color: #000000; transform: none; text-shadow: 0 0 10px rgba(0, 0, 0, 0.9); }
  75%, 100% { color: #ffffff; text-shadow: 0 0 8px rgba(255, 255, 255, 0.6); transform: none; }
}

.essence-bloom-section-wrapper {
  margin-top: 40px !important;
  width: 100%;
  max-width: 1400px; 
  margin-left: auto;
  margin-right: auto;
}

.essence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  width: 100%;
}

.essence-card {
  width: 100%;
  height: 100%; 
  
  
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 12px;
  padding: 30px 40px;
  
  box-shadow: 
    0 10px 20px rgba(0,0,0,0.6), 
    inset 0 0 10px rgba(255, 215, 0, 0.05);
  
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
}

.essence-card:hover {
  background: rgba(15, 12, 5, 0.8);
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 
    0 12px 25px rgba(0,0,0,0.8), 
    inset 0 0 15px rgba(255, 215, 0, 0.1);
}

.essence-card-title {
  color: #ffda66;
  font-size: 1.3em;
  font-weight: bold;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  padding-bottom: 10px;
  width: 100%;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.essence-card-desc {
  color: #d2d2d2;
  font-size: 1.05em;
  line-height: 1.8;
  word-break: keep-all;
  width: 100%;
}

#raceTraitPanel {
  width: 100%;
  margin: 30px 0 10px;
}

#raceTraitTitle {
  letter-spacing: 0.04em;
}

#raceTraitIntro {
  color: rgba(228, 224, 214, 0.9);
}

.race-trait-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  width: 100%;
}

.race-trait-extra {
  width: 100%;
  margin-top: 18px;
}

.race-trait-extra-box {
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(160, 190, 255, 0.12);
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.35),
    inset 0 0 10px rgba(180, 210, 255, 0.03);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.race-trait-extra-box.tone-draconic {
  border-color: rgba(210, 170, 92, 0.18);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.35),
    inset 0 0 10px rgba(223, 187, 112, 0.04);
}

.race-trait-extra-box.tone-tenebris {
  border-color: rgba(112, 136, 168, 0.16);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.35),
    inset 0 0 10px rgba(110, 132, 160, 0.04);
}

.race-trait-extra-title {
  width: 100%;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(160, 190, 255, 0.14);
  color: #aecfff;
  font-size: 1.12em;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.race-trait-extra-title.tone-draconic {
  border-bottom-color: rgba(210, 170, 92, 0.2);
  color: #d8b15c;
}

.race-trait-extra-title.tone-tenebris {
  border-bottom-color: rgba(112, 136, 168, 0.18);
  color: #7f95ab;
}

.race-trait-extra-body {
  word-break: keep-all;
}

.race-trait-extra-body p {
  margin: 0 0 14px;
  color: #d7d3c9;
  font-size: 1.01em;
  line-height: 1.9;
}

.race-trait-extra-body p:last-child {
  margin-bottom: 0;
}

.race-trait-card {
  background: rgba(0, 0, 0, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.45),
    inset 0 0 12px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.race-trait-card-title {
  width: 100%;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 235, 196, 0.14);
  color: #f4ddb0;
  font-size: 1.22em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(255, 223, 155, 0.14);
}

.race-trait-card-body,
.race-trait-card-appendix-body,
.race-trait-card-effect {
  word-break: keep-all;
}

.race-trait-card-body p,
.race-trait-card-appendix-body p {
  margin: 0 0 14px;
  color: #d7d3c9;
  font-size: 1.02em;
  line-height: 1.9;
}

.race-trait-card-body p:last-child,
.race-trait-card-appendix-body p:last-child {
  margin-bottom: 0;
}

.race-trait-gap {
  height: 8px;
}

.race-trait-card-appendix {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(160, 190, 255, 0.12);
}

.race-trait-card-appendix-title {
  margin-bottom: 10px;
  color: #aecfff;
  font-size: 1.02em;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.race-trait-card-effect {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 216, 160, 0.12);
  color: #ece1c3;
  font-size: 1.01em;
  font-weight: 600;
  line-height: 1.8;
}

.race-trait-card-effect strong {
  color: #ffe8a8;
}

.race-trait-inline-appendix.tone-default { color: #aecfff; }
.race-trait-inline-appendix.tone-draconic { color: #d8b15c; }
.race-trait-inline-appendix.tone-tenebris { color: #7f95ab; }

.crit-toggle-label {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; background: rgba(255,255,255,0.04); padding: 14px 16px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); transition: 0.2s ease;
  gap: 15px; 
}
.crit-toggle-label:hover { 
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); 
}
.crit-toggle-info {
  display: flex; flex-direction: column; gap: 6px; flex: 1;
}
.crit-toggle-header {
  display: flex; align-items: center; gap: 8px;
}
.crit-toggle-name {
  font-weight: bold; color: #fff; font-size: 1.05em;
}
.crit-toggle-val {
  color: #ffda66; font-weight: bold; font-size: 1.05em;
}
.crit-toggle-desc {
  font-size: 0.9em; color: #aaa; line-height: 1.45; word-break: keep-all;
}
.crit-toggle-cb { 
  cursor: pointer; width: 18px; height: 18px; flex-shrink: 0; 
}

#critProbList::-webkit-scrollbar, #critDmgList::-webkit-scrollbar { width: 4px; }
#critDmgList::-webkit-scrollbar-thumb, #critProbList::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 2px; }

.city-inline-carousel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  
  
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 20px 0 80px 0 !important;
  
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  
  padding: 0 6vw !important; 
  box-sizing: border-box;
}

.city-nav-arrow {
  position: absolute !important;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important; 
  border: none !important; 
  box-shadow: none !important;
  color: rgba(255,255,255,0.4) !important;
  font-size: 5em !important; 
  cursor: pointer; 
  padding: 20px; 
  z-index: 20;
  transition: color 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}
.city-nav-arrow:hover { color: #fff !important; transform: translateY(-50%) scale(1.1) !important; }
.city-nav-arrow:active { transform: translateY(-50%) scale(0.9) !important; }

#btnInlineCityPrev { left: 1vw !important; }
#btnInlineCityNext { right: 1vw !important; }

.city-inline-viewport {
  width: 100%;
  overflow: hidden;
  padding: 30px 10px; 
  margin: -30px -10px;
}

.city-inline-track {
  display: flex;
  justify-content: flex-start;
  gap: 1.5vw;
  width: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.city-inline-card {
  flex: 0 0 calc((100% - (1.5vw * 3)) / 4); 
  aspect-ratio: 9 / 16 !important; 
  min-height: 600px !important;    
  
  background: #000;
  border: 3px solid rgba(255,255,255,0.15);
  border-radius: 8px !important; 
  cursor: pointer;
  position: relative;
  
  
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 !important; 
  
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 15px 30px rgba(0,0,0,0.6);
  overflow: hidden;
}

.city-inline-card:hover {
  transform: translateY(-15px) scale(1.02);
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 25px 50px rgba(0,0,0,0.9);
  z-index: 5; 
}

.city-inline-card.selected {
  
  border: 5px solid var(--city-color, #fff) !important;
  box-shadow: 0 0 30px var(--city-color, #fff), inset 0 0 15px var(--city-color, #fff) !important;
  transform: translateY(-10px);
}

.city-inline-card-bg {
  position: absolute; 
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0.65; 
  transition: opacity 0.3s ease, filter 0.3s ease, transform 6s linear;
}

.city-inline-card:hover .city-inline-card-bg { 
  opacity: 1; 
  filter: brightness(1.1);
  transform: scale(1.08); 
}

.city-inline-title-box {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
  padding: 60px 10px 20px 10px; 
  text-align: center;
}

.city-inline-title-box h4 {
  font-size: 1.9em; 
  margin: 0;
  color: var(--city-color, #fff);
  text-shadow: 0 0 15px rgba(0,0,0,1), 0 0 20px var(--city-color, #fff);
  font-weight: bold;
  letter-spacing: 0.02em;
  word-break: keep-all; 
}

.city-inline-title-box p {
  margin: 8px 0 0 0;
  font-size: 0.95em; 
  color: #909090;    
  text-shadow: 0 0 10px #000;
  font-weight: normal;
  letter-spacing: 0.05em;
  font-family: "HeirofLight", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", serif;
}

.city-detail-lore {
  overflow-y: visible !important;
  pointer-events: auto !important;
  padding: 10px 0 20px 0;
  margin: 0 auto 10px auto;
  width: 100%;
  max-width: none !important; 
  
  display: flex;
  flex-direction: column;
  gap: 20px; 
  align-items: stretch;

  font-size: 1.08em; 
  color: #d2d2d2;
  text-align: left; 
}

.city-detail-lore::-webkit-scrollbar { width: 8px; }
.city-detail-lore::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 4px; }

.city-lore-section {
  background: transparent;
  border: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15); 
  padding: 0 0 25px 0; 
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.city-lore-section:first-child {
  padding-top: 0; 
}
.city-lore-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ── 태허도 3구역 서브탭 (요람 상세 모달 내부) ── */
.csn-container { margin: 22px 0 0; }
.csn-label {
  font-size: 0.75em;
  letter-spacing: 0.14em;
  color: rgba(180,150,240,0.45);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.csn-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.csn-tab {
  padding: 5px 16px;
  border: 1px solid rgba(176,136,245,0.25);
  border-radius: 4px;
  background: rgba(176,136,245,0.04);
  color: rgba(190,160,245,0.55);
  font-size: 0.87em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
}
.csn-tab:hover {
  border-color: rgba(176,136,245,0.55);
  color: rgba(210,185,255,0.85);
  background: rgba(176,136,245,0.09);
}
.csn-tab.active {
  border-color: rgba(176,136,245,0.75);
  background: rgba(176,136,245,0.16);
  color: #caa8ff;
  font-weight: 600;
}
.csn-panel { display: none; }
.csn-panel.active { display: block; }
.csn-region-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.75em;
  letter-spacing: 0.1em;
  border: 1px solid rgba(176,136,245,0.35);
  color: rgba(190,160,245,0.65);
  background: rgba(176,136,245,0.08);
}

.city-detail-lore h3 { 
  font-size: 1.38em; 
  margin: 0 0 20px 0; 
  font-weight: bold;
  color: #ffda66; 
  letter-spacing: 0.05em;
  border-bottom: none; 
  padding-bottom: 0;
}

.city-detail-lore p { 
  margin: 0 0 1.8em 0; 
  word-break: keep-all; 
  opacity: 0.9; 
  line-height: 2.2; 
  letter-spacing: 0.02em; 
}
.city-detail-lore p:last-child {
  margin-bottom: 0;
}

.city-detail-lore .quote { 
  display: block !important;
  text-align: center !important;
  font-size: 1.15em !important; 
  font-weight: bold !important;
  font-style: italic !important; 
  color: #ff8888 !important; 
  text-shadow: 0 0 10px rgba(255, 100, 100, 0.3) !important;
  margin-top: 30px !important;
  margin-bottom: 20px !important;
  padding-top: 20px !important;
  border-top: 1px dashed rgba(255, 100, 100, 0.3) !important;
}

#btnModalCitySelect {
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  
  width: 90% !important; 
  max-width: 950px !important;
  text-align: center;
  font-size: 1.25em !important; 
  font-weight: bold;
  font-style: italic; 
  color: #ff8888 !important; 
  text-shadow: 0 0 10px rgba(255, 100, 100, 0.3) !important;
  
  padding: 16px 20px !important; 
  pointer-events: auto;
  letter-spacing: 0.03em;
  border-radius: 12px;
  margin: 0 !important;
  
  
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important;
}

#btnModalCitySelect:hover {
  text-shadow: 0 0 15px rgba(255, 100, 100, 0.8) !important;
  transform: translateX(-50%) scale(1.02) !important;
  background: rgba(255, 0, 0, 0.05) !important;
  border-color: rgba(255, 100, 100, 0.2) !important;
}

#btnModalCitySelect:active {
  transform: translateX(-50%) scale(0.98) !important;
}

#btnModalCitySelect.selected {
  color: #ff4d4d !important;
  background: rgba(255, 0, 0, 0.08) !important;
  
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.15), inset 0 0 10px rgba(255, 0, 0, 0.05) !important;
}

/* 🌟 요람 상세 모달 전체 화면화 및 좌측 이미지 레이아웃 적용 */
.city-modal-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 !important; /* 여백 완전히 제거하여 화면 꽉 채움 */
  box-sizing: border-box;
}

.city-modal-container .close-btn {
  position: absolute;
  top: 25px;
  right: 35px;
  z-index: 1000;
  color: #fff;
  font-size: 2em;
}

.city-detail-wrap {
  width: 100%;
  max-width: none !important;
  height: 100%;
  max-height: none !important;
  display: flex; /* 좌우 분할을 위해 flex 유지 */
}

/* 🌟 추가된 좌측 이미지 영역 */
.city-detail-image-side {
  width: 15%; /* 가로의 약 1/7 (15%) 차지 */
  min-width: 200px; /* 너무 좁아지지 않게 최소 너비 설정 */
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-right: 2px solid rgba(255, 255, 255, 0.15); /* 본문 영역과의 경계선 */
  box-shadow: 10px 0 30px rgba(0,0,0,0.8); /* 그림자로 깊이감 부여 */
  z-index: 2;
}

.faction-detail-image-side {
  width: 18%; /* 🌟 가로 크기를 25%에서 18%로 대폭 축소 */
  min-width: 200px; /* 🌟 최소 보장 크기도 250px에서 200px로 축소 */
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-right: 2px solid rgba(255, 255, 255, 0.15); /* 🌟 좌측 배치를 위해 오른쪽 테두리로 변경 */
  box-shadow: 10px 0 30px rgba(0,0,0,0.8); /* 🌟 그림자 방향 변경 */
  z-index: 2;
}

@media (max-width: 1100px) {
  .faction-detail-image-side {
    display: none !important; /* 모바일/태블릿에서는 가림 */
  }
}

.city-detail-card {
  position: relative;
  flex: 1;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 0 !important;
  border: none !important;
  display: block;
  overflow-y: auto;
  padding: 80px 6vw 60px 6vw !important;
  box-sizing: border-box;
}

.city-detail-title {
  position: relative;
  font-size: 2.1em !important; 
  margin: 0 0 45px 0 !important; 
  padding-bottom: 25px !important; 
  text-align: center;
  letter-spacing: 0.05em;
}

.city-detail-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 450px; 
  height: 2px;
  
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.7;
}

/* 🌟 요람 및 세력 상세 모달 하단 버튼 (검은 직각 형태) */
#btnModalCitySelect, #btnModalFactionSelect {
  display: block;
  position: static !important;
  width: auto !important;
  max-width: none !important;
  text-align: center;
  font-size: 1.1em !important;
  font-weight: bold;
  color: #d2d2d2 !important;
  padding: 14px 35px !important;
  pointer-events: auto;
  letter-spacing: 0.05em;
  border-radius: 0 !important;
  margin: 36px auto 0 auto !important;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.8) !important;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
  outline: none !important;
}

#btnModalCitySelect:hover, #btnModalFactionSelect:hover {
  background: rgba(20, 20, 20, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
}

#btnModalCitySelect:active, #btnModalFactionSelect:active {
  background: #000 !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

#btnModalCitySelect.selected, #btnModalFactionSelect.selected {
  color: #111 !important;
  background: var(--city-color, #ffda66) !important;
  border-color: var(--city-color, #ffda66) !important;
  box-shadow: 0 0 15px var(--city-color, rgba(255, 218, 102, 0.3)) !important;
  text-shadow: none !important;
}

/* 요람(City) 모달의 Select 버튼만 화면 우측 하단에 고정 배치 (세력 버튼은 그대로 중앙 하단 유지) */
#btnModalCitySelect {
  position: fixed !important;
  bottom: 30px !important;
  right: 30px !important;
  left: auto !important;
  top: auto !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 1001;
}
#btnModalCitySelect:hover {
  transform: scale(1.03) !important;
}
#btnModalCitySelect:active {
  transform: scale(0.97) !important;
}

/* ===== 세력 패널 (새 디자인) ===== */
.faction-panel-box {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  background: rgba(0,0,0,0.82);
  border: 1px solid rgba(255,255,255,0.10);
  box-sizing: border-box;
  overflow: hidden;
}

/* 상단 탭 바 */
.faction-tab-bar {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.4);
}
.faction-tab-bar::-webkit-scrollbar { display: none; }

.faction-tab {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 22px;
  cursor: pointer;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.07);
  background: transparent;
  transition: background 0.2s, opacity 0.2s;
  min-width: 90px;
}
.faction-tab:hover { background: rgba(255,255,255,0.05); }
.faction-tab.active { background: rgba(255,255,255,0.08); border-bottom: 2px solid var(--fc, #fff); }

.faction-tab-logo {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 0px var(--fc, #fff));
  transition: filter 0.25s;
}
.faction-tab-logo svg {
  width: 100%;
  height: 100%;
}
.faction-tab.active .faction-tab-logo {
  filter: drop-shadow(0 0 8px var(--fc, #fff));
}
.faction-tab:not(.active) .faction-tab-logo {
  opacity: 0.45;
}

/* 하단 설명 패널 — 가로/세로 크기를 고정하고, 왼쪽엔 세로로 긴 세력 이미지를 고정 배치,
   오른쪽 내용(fp-scroll)은 내용이 넘치면 그 안에서만 스크롤된다 */
.faction-detail-panel {
  display: flex;
  flex-direction: row;
  gap: 28px;
  padding: 28px 32px;
  width: 100%;
  height: 560px;
  box-sizing: border-box;
}

.fp-image {
  flex: 0 0 260px;
  align-self: stretch;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
}

.fp-scroll {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding-right: 10px;
}
.fp-scroll::-webkit-scrollbar { width: 6px; }
.fp-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 3px; }
.fp-scroll::-webkit-scrollbar-track { background: transparent; }

.fp-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.fp-name {
  font-family: "HeirofLight", "Noto Serif KR", serif;
  font-size: 1.7em;
  font-weight: bold;
  margin: 0 0 4px 0;
  letter-spacing: 0.06em;
}

.fp-quote {
  font-family: "Noto Serif KR", serif;
  font-style: italic;
  color: rgba(255,255,255,0.55);
  font-size: 0.95em;
  line-height: 1.6;
  margin: 0;
  border-left: 2px solid rgba(255,255,255,0.18);
  padding-left: 12px;
}

.fp-desc {
  font-family: "Noto Serif KR", serif;
  color: rgba(255,255,255,0.75);
  font-size: 0.95em;
  line-height: 1.7;
  margin: 0;
}

.fp-select-btn {
  margin-top: 10px;
  align-self: flex-start;
  border-radius: 0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.18) !important;
  filter: none !important;
  padding: 12px 24px !important;
  font-size: 1em !important;
}

.fp-body {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
}

/* ===== 세력 아코디언 (구 디자인 - 유지) ===== */
.faction-accordion {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

/* 아코디언 행 — 이름만 보이는 상태 */
.faction-row {
  border-bottom: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
}
.faction-row:first-child { border-top: 1px solid rgba(255,255,255,0.07); }

.faction-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: #e0e0e0;
  font-family: 'Noto Serif KR', serif;
  transition: background 0.2s;
  gap: 16px;
}
.faction-row-header:hover {
  background: rgba(255,255,255,0.04);
}
.faction-row-header.faction-selected {
  background: rgba(255,255,255,0.06);
}

.faction-row-name {
  font-size: 1.3em;
  font-weight: bold;
  letter-spacing: 0.05em;
  flex: 1;
  transition: color 0.25s, text-shadow 0.25s;
}
.faction-row-header.faction-open .faction-row-name {
  font-size: 1.6em;
  text-shadow: 0 0 15px currentColor;
}

.faction-row-chevron {
  font-size: 0.9em;
  color: #555;
  transition: transform 0.28s ease, color 0.2s;
  flex-shrink: 0;
}
.faction-row-header.faction-open .faction-row-chevron {
  transform: rotate(180deg);
  color: #aaa;
}

/* 펼쳐지는 콘텐츠 영역 */
.faction-row-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.faction-row-body.faction-body-open {
  max-height: 3000px;
}

.faction-row-content {
  padding: 0 28px 36px;
}

/* 선택 버튼 */
.faction-pick-btn {
  display: block;
  width: 100%;
  margin-top: 28px;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ccc;
  font-family: 'Noto Serif KR', serif;
  font-size: 1.05em;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.faction-pick-btn:hover {
  background: rgba(255,255,255,0.09);
  color: #fff;
}
.faction-pick-btn.faction-btn-selected {
  border-color: var(--faction-color, #fff);
  color: var(--faction-color, #fff);
  box-shadow: 0 0 12px var(--faction-color, #fff);
}

/* 콘텐츠 내부 스타일 유지 */
.faction-header { width: 100%; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.faction-header h3 { font-size: 0; margin: 0; } /* 이름은 row-header에서 표시하므로 숨김 */
.faction-quote { font-size: 1.15em; font-style: italic; color: #ff8888; margin: 0 0 14px 0; opacity: 0.9; }
.faction-desc { font-size: 1.05em; color: #ccc; line-height: 1.7; margin: 0; word-break: keep-all; }

.faction-body { display: flex; flex-direction: column; gap: 60px; width: 100%; } /* 🌟 카테고리(특전, 혜택, 의무) 사이 간격을 30px -> 60px로 대폭 확장 */

.faction-category h4 { font-size: 1.25em; margin: 0 0 20px 0; border-bottom: 1px dashed rgba(255,255,255,0.25); padding-bottom: 12px; letter-spacing: 0.02em; } /* 🌟 소제목 크기를 살짝 키우고 밑줄을 더 선명하게 변경 */
.faction-item { margin-bottom: 25px; } /* 🌟 세부 항목(아이템) 간의 간격도 살짝 넓힘 */
.faction-item:last-child { margin-bottom: 0; }
.faction-item strong { display: block; font-size: 1.05em; color: #e0e0e0; margin-bottom: 7px; letter-spacing: 0.02em; }
.faction-item p { font-size: 1.02em; color: #aaa; line-height: 1.85; margin: 0; padding-left: 14px; border-left: 2px solid rgba(255,255,255,0.1); word-break: keep-all; }

.faction-lore-toggle { background: rgba(255, 255, 255, 0.03); border: 1px dashed rgba(255, 255, 255, 0.15); border-radius: 8px; overflow: hidden; margin-bottom: 25px; transition: all 0.3s ease; }
.faction-lore-summary { display: flex; align-items: center; gap: 12px; padding: 14px 20px; cursor: pointer; background: rgba(0, 0, 0, 0.4); list-style: none; }
.faction-lore-summary::-webkit-details-marker { display: none; }
.faction-lore-summary:hover { background: rgba(255, 255, 255, 0.05); }
.lore-icon { font-size: 1.2em; }
.lore-title { flex: 1; font-size: 1em; color: #ccc; font-weight: bold; letter-spacing: 0.05em; }
.lore-chevron { color: #888; font-size: 0.9em; transition: transform 0.3s ease; }
.faction-lore-toggle[open] { border-color: rgba(255, 100, 100, 0.3); box-shadow: inset 0 0 15px rgba(255, 100, 100, 0.05); }
.faction-lore-toggle[open] .lore-chevron { transform: rotate(-180deg); color: #ff6b6b; }
.faction-lore-toggle[open] .lore-title { color: #ff6b6b; }
.faction-lore-content { padding: 20px 25px; background: rgba(0, 0, 0, 0.6); border-top: 1px solid rgba(255, 255, 255, 0.05); }
.faction-lore-content p { color: #bbb; font-size: 0.95em; line-height: 1.8; margin: 0 0 15px 0; word-break: keep-all; }
.faction-lore-content p:last-child { margin-bottom: 0; }


.weapon-tier-header {
  text-align: center;
  margin-bottom: 25px;
}
.tier-title {
  font-family: "HeirofLight", "Noto Serif KR", serif !important;
  font-size: 1.8em;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: #e0e0e0;
  margin: 0 0 10px 0;
  font-family: "Georgia", "HeirofLight", "Noto Serif KR", serif;
}
.tier-lore {
  font-size: 1.05em;
  color: #888;
  font-style: italic;
  word-break: keep-all;
  line-height: 1.6;
  margin: 0;
}

.ds-divider {
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  margin: 50px auto;
}

.weapon-class-btn {
  min-height: 160px !important;
  border: 1px dashed rgba(255, 255, 255, 0.2) !important;
  background: rgba(15, 15, 15, 0.8) !important;
}
.weapon-class-btn:hover {
  border-style: solid !important;
  border-color: rgba(255, 218, 102, 0.5) !important;
  background: rgba(25, 20, 10, 0.9) !important;
}
.weapon-class-btn.selected {
  border: 2px solid #ffda66 !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.8), inset 0 0 20px rgba(255, 218, 102, 0.15) !important;
  background: rgba(20, 15, 5, 0.95) !important;
}
.weapon-class-btn.selected .choiceTitle {
  color: #ffda66 !important;
  text-shadow: 0 0 10px rgba(255, 218, 102, 0.5);
}

.martial-class-btn {
  min-height: 160px !important;
  border: 1px dashed rgba(255, 255, 255, 0.2) !important;
  background: rgba(15, 15, 15, 0.8) !important;
}
.martial-class-btn:hover {
  border-style: solid !important;
  border-color: rgba(212, 180, 138, 0.5) !important;
  background: rgba(25, 20, 10, 0.9) !important;
}
.martial-class-btn.selected {
  border: 2px solid #d4b48a !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.8), inset 0 0 20px rgba(212, 180, 138, 0.15) !important;
  background: rgba(20, 15, 5, 0.95) !important;
}
.martial-class-btn.selected .choiceTitle {
  color: #d4b48a !important;
  text-shadow: 0 0 10px rgba(212, 180, 138, 0.5);
}

.imagery-btn {
  border-color: rgba(var(--imagery-col, 255,255,255), 0.45) !important;
  background: #000000 !important;
  transition: border-color 0.18s, background 0.25s, box-shadow 0.18s;
}
.imagery-btn:hover {
  border-color: rgba(var(--imagery-col, 255,255,255), 0.7) !important;
  background: rgba(var(--imagery-col, 255,255,255), 0.12) !important;
}
.imagery-btn.selected {
  border: 2px solid rgba(var(--imagery-col, 255,255,255), 1) !important;
  background: rgba(var(--imagery-col, 255,255,255), 0.45) !important;
  box-shadow: 0 0 0 3px rgba(var(--imagery-col, 255,255,255), 0.25), 0 0 26px rgba(var(--imagery-col, 255,255,255), 0.5) !important;
}
.imagery-btn.selected .choiceTitle {
  text-shadow: 0 0 16px rgba(var(--imagery-col, 255,255,255), 0.95) !important;
}

.stance-block {
  border-left: 3px solid rgba(163, 0, 0, 0.6);
  padding-left: 25px;
  margin-bottom: 50px;
  background: linear-gradient(90deg, rgba(163, 0, 0, 0.05) 0%, transparent 60%);
  border-radius: 0 8px 8px 0;
  padding-top: 10px;
  padding-bottom: 10px;
}

.sub-skill-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

.sub-skill-list li {
  margin-bottom: 22px !important;
  line-height: 1.6 !important;
  color: #c2c2c2 !important;
  text-align: center !important; 
  word-break: keep-all !important;
}

.sub-skill-list li:last-child {
  margin-bottom: 0 !important;
}

.sub-skill-list li::before {
  display: none !important;
}

.sub-skill-list li strong {
  display: block !important;     
  font-size: 1em !important;     
  font-weight: bold !important;  
  margin-bottom: 6px !important; 
  letter-spacing: 0.02em !important;
}

.stance-block .sub-skill-list li strong { 
  color: #ff8888 !important; 
  text-shadow: 0 0 5px rgba(255, 100, 100, 0.3) !important; 
}

.stance-block[style*="#66b3ff"] .sub-skill-list li strong { 
  color: #b3d9ff !important; 
  text-shadow: 0 0 5px rgba(102, 179, 255, 0.4) !important;
}

.stance-block[style*="#ffda66"] .sub-skill-list li strong { 
  color: #ffda66 !important; 
  text-shadow: 0 0 5px rgba(255, 218, 102, 0.4) !important;
}

.stance-block[style*="#a3a3a3"] .sub-skill-list li strong { 
  color: #e0e0e0 !important; 
  text-shadow: 0 0 5px rgba(200, 200, 200, 0.4) !important;
}

.stance-block .sub-skill-list li strong { color: #ff8888 !important; text-shadow: 0 0 5px rgba(255, 100, 100, 0.3) !important; }
.stance-block[style*="#66b3ff"] .sub-skill-list li strong { color: #b3d9ff !important; text-shadow: 0 0 5px rgba(102, 179, 255, 0.4) !important; }
.stance-block[style*="#ffda66"] .sub-skill-list li strong { color: #ffda66 !important; text-shadow: 0 0 5px rgba(255, 218, 102, 0.4) !important; }
.stance-block[style*="#a3a3a3"] .sub-skill-list li strong { color: #e0e0e0 !important; text-shadow: 0 0 5px rgba(200, 200, 200, 0.4) !important; }

.stance-block[style*="#d9d9d9"] .sub-skill-list li strong { color: #ffffff !important; text-shadow: 0 0 5px rgba(255, 255, 255, 0.4) !important; } 
.stance-block[style*="#ff4d4d"] .sub-skill-list li strong { color: #ff9999 !important; text-shadow: 0 0 5px rgba(255, 77, 77, 0.4) !important; } 
.stance-block[style*="#66cc99"] .sub-skill-list li strong { color: #99e6cc !important; text-shadow: 0 0 5px rgba(102, 204, 153, 0.4) !important; } 
.stance-block[style*="#3399ff"] .sub-skill-list li strong { color: #99ccff !important; text-shadow: 0 0 5px rgba(51, 153, 255, 0.4) !important; } 

.weaponSkillBlock .choiceImage,
#weaponClassSelectorSection .choiceImage {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: 900 / 1080 !important; 
  object-fit: cover !important;
  border-radius: 12px !important;
  margin-bottom: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.ultimate-skill-btn .choiceTitle {
  margin-top: 5px !important;
}

.stance-header {
  text-align: center !important;
  margin-bottom: 30px !important;
}

.stance-title {
  font-family: "HeirofLight", "Noto Serif KR", serif !important;
  font-size: 1.8em !important;
  font-weight: bold !important;
  margin: 0 0 15px 0 !important;
  letter-spacing: 0.08em !important;
}

.stance-lore {
  font-size: 1.05em !important;
  color: #aaa !important;
  font-style: italic !important;
  line-height: 1.7 !important;
  
  
  margin: 0 auto 20px auto !important; 
  max-width: 85% !important; 
  text-align: center !important; 
  word-break: keep-all !important;
}

.stance-header .reqBadge {
  margin-bottom: 10px !important;
}

.stance-header .reqBadge span.reqCond {
  font-size: 1.1em !important;       
  padding: 8px 20px !important;      
  border-width: 2px !important;      
  letter-spacing: 0.05em !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
}

.weaponSkillBlock .choiceImage {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: 900 / 1080 !important; 
  object-fit: cover !important;
  border-radius: 12px !important;
  margin-bottom: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.stance-skill-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important; 
  gap: 14px;
  
  
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto;
}

.stance-skill-grid > button.choice {
  
  flex: 0 0 calc(25% - 10.5px) !important; 
  max-width: calc(25% - 10.5px) !important;
  
  height: auto !important;
  min-height: 280px; 
  
  
  justify-content: flex-start !important; 
}

.equipment-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important; 
  gap: 14px;
  
  
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto;
}

.equipment-grid > button.choice {
  
  flex: 0 0 calc(25% - 10.5px) !important; 
  max-width: calc(25% - 10.5px) !important;
  
  height: auto !important;
  min-height: 520px; 
  justify-content: flex-start !important; 
  padding-bottom: 30px !important;
}

.equipment-grid .choiceImage {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  
  /* 🌟 세로 비율을 1/1.1 에서 3/4 로 늘려 무기와 갑옷이 시원하게 보이도록 수정 */
  aspect-ratio: 3 / 4 !important; 
  object-fit: cover !important;
  object-position: center !important; 
  border-radius: 12px !important;
  margin-bottom: 20px !important;
  border: 1px solid rgba(255, 215, 0, 0.2); 
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.equipment-grid > .equipment-choice-shell {
  flex: 0 0 calc(25% - 10.5px) !important;
  max-width: calc(25% - 10.5px) !important;
  display: block;
  position: relative;
}

.equipment-choice-shell > button.choice {
  width: 100%;
  height: auto !important;
  min-height: 520px;
  justify-content: flex-start !important;
  padding-bottom: 30px !important;
}

.eden-choice-shell {
  position: relative;
}

.eden-unlock-toggle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 72%;
  min-height: 110px;
  padding: 12px 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #f3f3f3;
  text-align: center;
  cursor: pointer;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease, filter 0.28s ease;
}

.eden-choice-shell.eden-ready-to-unseal .eden-unlock-toggle,
.eden-choice-shell.eden-chain-breaking .eden-unlock-toggle {
  opacity: 1;
}

.eden-unlock-toggle:hover {
  transform: translate(-50%, calc(-50% - 2px));
}

.eden-unlock-title-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 2.2em;
}

.eden-unlock-title-main {
  position: absolute;
  color: rgba(255,255,255,0.96);
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.48),
    0 0 22px rgba(255, 255, 255, 0.18);
  font-size: 1.55em;
  font-weight: 800;
  letter-spacing: 0.24em;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}

.eden-unlock-title-dark {
  position: absolute;
  transform: scale(0.5);
  color: rgba(255,255,255,0.08);
  text-shadow: 0 0 18px rgba(255,255,255,0.34), 0 0 34px rgba(255,255,255,0.18);
  font-size: 1.7em;
  font-weight: 900;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  pointer-events: none;
}

.eden-unlock-sub {
  font-size: 0.86em;
  letter-spacing: 0.1em;
  color: rgba(245, 245, 245, 0.88);
  text-shadow: 0 0 10px rgba(255,255,255,0.18);
}

.eden-replica-button {
  position: relative;
  overflow: hidden;
  transition:
    box-shadow 0.36s ease,
    border-color 0.36s ease,
    transform 0.36s ease,
    opacity 0.42s ease,
    filter 0.42s ease,
    background 0.36s ease;
}

.eden-replica-button .choiceImage {
  /* 다른 일반 무기들과 완벽히 동일한 배치와 크기를 따르도록 불필요한 속성 제거 */
  transition: filter 0.45s ease, transform 0.7s ease;
}

.eden-replica-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.82)),
    radial-gradient(circle at 50% 34%, rgba(255,255,255,0.05), transparent 58%);
  transition: opacity 0.24s ease, background 0.18s ease, filter 0.18s ease;
}

.eden-replica-button::after {
  content: "";
  position: absolute;
  inset: -8% 0 auto 0;
  height: 148%;
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 10% 8%, rgba(255,255,255,0.06) 0 5%, transparent 6%),
    radial-gradient(circle at 28% 12%, rgba(255,255,255,0.05) 0 4%, transparent 5%),
    radial-gradient(circle at 47% 9%, rgba(255,255,255,0.05) 0 5%, transparent 6%),
    radial-gradient(circle at 66% 13%, rgba(255,255,255,0.045) 0 4%, transparent 5%),
    radial-gradient(circle at 84% 10%, rgba(255,255,255,0.05) 0 5%, transparent 6%),
    linear-gradient(180deg, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.985) 68%, rgba(0,0,0,0.94) 100%);
  clip-path: polygon(
    0 0,
    100% 0,
    100% 72%,
    92% 79%,
    84% 72%,
    75% 84%,
    66% 70%,
    57% 86%,
    49% 72%,
    40% 84%,
    31% 71%,
    21% 82%,
    11% 73%,
    0 80%
  );
  filter: blur(0.2px);
  transform: translateY(-112%);
}

.eden-choice-shell.eden-ready-to-unseal .eden-replica-button::before,
.eden-choice-shell.eden-chain-breaking .eden-replica-button::before {
  opacity: 1;
  background: rgba(0, 0, 0, 0.75) !important; /* 완전히 칠하지 않고 반투명하게 덮음 */
}

.eden-choice-shell.eden-ready-to-unseal .eden-replica-button .choiceImage,
.eden-choice-shell.eden-chain-breaking .eden-replica-button .choiceImage {
  filter: brightness(0.5) saturate(0.5) !important; /* 이미지 밝기와 채도를 낮춤 */
  opacity: 1 !important;
}

.eden-choice-shell.eden-ready-to-unseal .eden-replica-button .choiceTitle,
.eden-choice-shell.eden-chain-breaking .eden-replica-button .choiceTitle,
.eden-choice-shell.eden-ready-to-unseal .eden-replica-button .choiceComment,
.eden-choice-shell.eden-chain-breaking .eden-replica-button .choiceComment {
  opacity: 0.4 !important; /* 원래 글씨를 희미하게 표시 */
  pointer-events: none;
}

.eden-chain-overlay {
  position: absolute;
  inset: 8px;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.24s ease, filter 0.24s ease;
  overflow: hidden;
  border-radius: 14px;
  background: transparent;
}

.eden-choice-shell.eden-ready-to-unseal .eden-chain-overlay,
.eden-choice-shell.eden-chain-breaking .eden-chain-overlay {
  opacity: 1;
}

.eden-chain-overlay::before {
  content: none;
  position: absolute;
  inset: 18% 20%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0.16) 34%, rgba(255,255,255,0.06) 48%, transparent 74%);
  filter: blur(18px);
  opacity: 0;
}

.eden-choice-shell.eden-ready-to-unseal .eden-chain-overlay::before {
  animation: none;
}

.eden-choice-shell.eden-chain-breaking .eden-chain-overlay::before {
  animation: none;
}

.eden-choice-shell.eden-ready-to-unseal .eden-chain-overlay {
  animation: none;
}

.eden-choice-shell.eden-chain-breaking .eden-chain-overlay {
  animation: none;
}

.eden-replica-button.eden-locked {
  border-color: rgba(194, 194, 194, 0.26) !important;
  box-shadow:
    0 5px 0 rgba(0, 0, 0, 0.45),
    0 0 20px rgba(115, 115, 115, 0.08),
    inset 0 0 18px rgba(255, 255, 255, 0.03) !important;
}

.eden-replica-button.eden-unlocked {
  background: rgba(2, 2, 2, 0.94) !important;
  border-color: rgba(0, 0, 0, 0.96) !important;
  box-shadow:
    0 5px 0 rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(0, 0, 0, 0.95),
    0 0 28px rgba(255, 255, 255, 0.08),
    inset 0 0 28px rgba(255, 255, 255, 0.03),
    inset 0 0 0 1px rgba(255,255,255,0.02) !important;
}

.eden-replica-button.eden-unlocked .choiceImage {
  filter: brightness(0.76) contrast(1.08) saturate(0.9);
}

.eden-replica-button.eden-unlocked .choiceTitle {
  color: #fafafa !important;
  text-shadow:
    0 0 8px rgba(255,255,255,0.72),
    0 0 22px rgba(255,255,255,0.32),
    0 0 36px rgba(255,255,255,0.14) !important;
}

.eden-replica-button.eden-unlocked,
.eden-replica-button.eden-unlocked .choiceComment,
.eden-replica-button.eden-unlocked .choiceComment p,
.eden-replica-button.eden-unlocked .choiceComment span,
.eden-replica-button.eden-unlocked #edenReplicaEffectText,
.eden-replica-button.eden-unlocked #edenReplicaEffectLabel,
.eden-replica-button.eden-unlocked #edenReplicaRecommendText,
.eden-replica-button.eden-unlocked .eden-replica-state-tag {
  color: rgba(238,238,238,0.94) !important;
}

.eden-replica-button.eden-unlocked .choiceComment {
  text-shadow:
    0 0 10px rgba(255,255,255,0.08),
    0 0 18px rgba(255,255,255,0.04) !important;
}

.eden-replica-button.eden-form-transitioning {
  opacity: 0;
  filter: none;
  transform: none;
}

.eden-replica-button.eden-form-transitioning::after {
  opacity: 1;
  transform: translateY(0);
  animation: original-sin-black-flood 0.82s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.eden-replica-button.eden-form-resolving::after {
  opacity: 0;
  transform: translateY(0);
  animation: none;
}

.eden-replica-state-tag {
  display: inline-block;
  margin-top: 2px;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #bdbdbd;
  font-size: 0.76em;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.eden-replica-button.eden-unlocked .eden-replica-state-tag {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.045);
  color: #f1f1f1;
  box-shadow:
    0 0 10px rgba(255,255,255,0.06),
    inset 0 0 8px rgba(255,255,255,0.02);
}

.eden-choice-shell.eden-ready-to-unseal .eden-unlock-title-main {
  opacity: 1;
  transform: scale(1.02);
  filter: blur(0);
}

.eden-choice-shell.eden-ready-to-unseal .eden-unlock-title-dark {
  opacity: 0;
  transform: scale(0.88);
}

.eden-choice-shell.eden-ready-to-unseal .eden-unlock-sub {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.eden-choice-shell.eden-chain-breaking .eden-unlock-toggle {
  animation: eden-unlock-text-fade 1.34s ease-out forwards;
}

@keyframes eden-unlock-text-fade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: none;
  }
  45% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.01);
    filter: none;
  }
  78% {
    opacity: 0.28;
    transform: translate(-50%, calc(-50% - 2px)) scale(1.015);
    filter: blur(0.8px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 4px)) scale(1.02);
    filter: blur(1.8px);
  }
}

@keyframes original-sin-black-flood {
  0% {
    opacity: 0;
    transform: translateY(-112%);
    filter: blur(0.4px);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.truth-rune-title {
  position: relative;
  display: inline-block;
  isolation: isolate;

  font-size: 1.3em !important;
  font-weight: 900 !important;
  color: #b87333 !important; 
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.05em;
  padding: 10px 0;
  
  
  animation: truth-breathe 4s infinite alternate ease-in-out;
}

.truth-rune-title::before {
  content: ""; 
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140%;
  height: 240%;
  transform: translate(-50%, -50%);
  
  
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='50,10 90,50 50,90 10,50' fill='none' stroke='rgba(184, 115, 51, 0.4)' stroke-width='1.5'/%3E%3Ccircle cx='50' cy='50' r='35' fill='none' stroke='rgba(184, 115, 51, 0.3)' stroke-width='1' stroke-dasharray='3, 3'/%3E%3C/svg%3E");
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  
  z-index: -2;
  pointer-events: none;
  
  
  animation: truth-rune-spin-forward 16s linear infinite;
}

.truth-rune-title::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 200%;
  transform: translate(-50%, -50%);
  
  
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='15,15 85,15 85,85 15,85' fill='none' stroke='rgba(200, 180, 150, 0.3)' stroke-width='1'/%3E%3Ccircle cx='50' cy='50' r='20' fill='none' stroke='rgba(184, 115, 51, 0.5)' stroke-width='1.5'/%3E%3Ccircle cx='50' cy='50' r='10' fill='rgba(184, 115, 51, 0.1)'/%3E%3C/svg%3E");
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  
  z-index: -1;
  pointer-events: none;
  
  
  animation: truth-rune-spin-reverse 12s linear infinite;
}

@keyframes truth-breathe {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.15) drop-shadow(0 0 5px rgba(184, 115, 51, 0.2)); }
}

@keyframes truth-rune-spin-forward {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.9); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(0.9); opacity: 0.6; }
}

@keyframes truth-rune-spin-reverse {
  0% { transform: translate(-50%, -50%) rotate(360deg) scale(1); opacity: 0.8; }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(0.9); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); opacity: 0.8; }
}

.status-modal-content {
  background: rgba(0, 0, 0, 0.45) !important; 
  backdrop-filter: blur(10px) saturate(120%) !important; 
  -webkit-backdrop-filter: blur(10px) saturate(120%) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 30px 60px rgba(0,0,0,0.9), inset 0 0 30px rgba(255,255,255,0.03) !important;
  border-radius: 16px !important;
  height: 96vh !important; 
  max-height: 1200px !important;
  
  overflow: hidden !important; 
  padding: 30px 20px !important; 
}

.status-modal-split {
  display: flex;
  flex-direction: row;
  align-items: flex-start; 
  gap: 50px; 
  width: 100%;
  height: 100%; 
  overflow-y: auto !important;
  padding-right: 10px;
}

.status-modal-split::-webkit-scrollbar { width: 6px; }
.status-modal-split::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.status-left {
  flex: 0 0 430px; 
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
  align-items: center;
  gap: 24px;
  padding-top: 10px;
}

.status-portrait-frame {
  width: min(100%, 360px);
  aspect-ratio: 3 / 4; 
  background: #000;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0,0,0,0.8), inset 0 0 20px rgba(255,255,255,0.05);
  position: relative;
  margin: 0 auto;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.status-portrait-frame:hover {
  border-color: rgba(255, 218, 102, 0.5);
  box-shadow: 0 15px 30px rgba(0,0,0,0.8), inset 0 0 20px rgba(255, 218, 102, 0.15);
}

.status-portrait-frame .portrait-frame {
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  min-height: auto;
}

.status-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; 
  display: block;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.status-portrait-frame:hover img {
  filter: brightness(0.4);
}

.status-portrait-frame .portrait-placeholder {
  opacity: 0;
  z-index: 5;
}

.status-portrait-frame:hover .portrait-placeholder {
  opacity: 1;
}

.status-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
  height: auto;

  overflow-x: hidden;
  overflow-y: visible !important;
  padding: 10px 10px 40px 10px;
}

.status-profile-panel {
  margin-bottom: 0;
  width: min(100%, 360px);
  padding: 4px 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin-left: auto;
  margin-right: auto;
}

.status-combat-panel {
  display: flex;
  flex-direction: column;
  gap: 38px;
  width: 100%;
  padding-top: 24px;
}

.status-combat-section {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.status-combat-title {
  display: flex;
  align-items: center;
  color: #e9e1cb;
  font-size: 1.26em;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.status-combat-title .stat-detail-btn {
  margin-left: 8px;
  transform: translateY(-1px);
}

.status-combat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* 🌟 2열에서 3열로 변경 */
  gap: 22px;
}

.status-combat-subtitle {
  color: #e9e1cb;
  font-size: 1.2em;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.status-combat-subtitle .stat-detail-btn {
  margin-left: 8px;
  transform: translateY(-1px);
}

.damage-stat-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
}

.damage-stat-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.damage-stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.damage-stat-name {
  color: #8e8e8e;
  font-size: 1.08em;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.damage-stat-name::before {
  content: attr(data-icon);
  color: #6f6f6f;
  width: 1.05em;
  flex: 0 0 1.05em;
  text-align: center;
  font-size: 0.95em;
  line-height: 1;
  opacity: 0.95;
  font-family: "Segoe UI Symbol", "Apple Symbols", sans-serif;
  filter: grayscale(100%);
}
.damage-stat-value {
  color: #ded7c7;
  font-size: 1.2em;
  font-weight: 600;
}

.status-right::-webkit-scrollbar { width: 6px; }
.status-right::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.profile-left-col, .profile-right-col {
  display: flex;
  flex-direction: column;
  gap: 18px; 
}

.profile-label { 
  font-size: 0.85em !important; 
  color: #777; 
  letter-spacing: 0.05em; 
  margin-bottom: 6px !important; 
}
.profile-value { 
  font-size: 1.1em !important; 
  font-weight: 400; 
  color: #d2d2d2; 
}

.status-combat-panel .profile-label {
  font-size: 1em !important;
  color: #a2a2a2;
  margin-bottom: 8px !important;
}

.stat-name-input {
  font-size: 1.15em !important; 
  padding-bottom: 4px !important;
}

.trait-tag {
  font-size: 0.9em !important; 
  padding: 6px 12px !important;
}

@media (max-width: 1180px) {
  .status-modal-split {
    flex-direction: column;
    gap: 28px;
  }

  .status-left,
  .status-right {
    flex: 1 1 auto;
    width: 100%;
  }

  .status-portrait-frame {
    width: min(100%, 340px);
  }

  .damage-stat-columns,
  .status-combat-grid,
  .profile-info-grid {
    grid-template-columns: 1fr;
  }
}

/* 🌟 1. 연산기 버튼 디자인 (기어 아이콘 선명도 및 호버 이펙트 강화) */
.stat-detail-btn {
  background: none; 
  border: none; 
  cursor: pointer;
  filter: grayscale(0.2); /* 이전보다 원색에 가깝게 설정 */
  opacity: 0.85; /* 이전보다 훨씬 밝게 (기존 0.5) */
  transition: all 0.2s ease;
  padding: 0; 
  margin-left: 8px; 
  transform: translateY(1px); 
  font-size: 1.15em;
  vertical-align: middle;
}
.stat-detail-btn:hover {
  filter: grayscale(0); 
  opacity: 1; 
  transform: translateY(1px) scale(1.2);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8); /* 마우스 올렸을 때 빛나게 */
}

/* 🌟 2. 툴팁 Z-index 뚫림 버그 픽스 (호버 시 해당 아이콘 자체를 최상단으로 끌어올림) */
.tooltip-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.7em;
  font-weight: bold;
  margin-left: 6px;
  cursor: help;
  position: relative;
  transform: translateY(-2px);
  transition: all 0.2s ease;
  z-index: 10; /* 기본 레이어 */
}

.tooltip-icon:hover {
  background: rgba(255, 218, 102, 0.8);
  color: #000;
  z-index: 999999 !important; /* 🌟 마우스 올렸을 때 연산기 버튼을 덮을 수 있도록 부모 위상 강제 상승 */
}

.tooltip-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: auto;
  bottom: auto;
  transform: translateX(0) translateY(-4px);
  display: block;
  width: min(340px, calc(100vw - 48px));
  min-width: 240px;
  max-width: 340px;
  height: auto !important;
  min-height: min-content;
  box-sizing: border-box;
  font-size: 0.92rem !important; 
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: break-word;
  color: #e0e0e0;
  text-align: left;
  background: rgba(0, 0, 0, 0.9) !important;
  border: 1px solid rgba(255, 218, 102, 0.5);
  padding: 15px 18px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999999 !important;
}

.tooltip-icon:hover::after {
  opacity: 1;
  transform: translateX(0) translateY(0);
}

.tooltip-icon.tooltip-open-left::after {
  left: auto;
  right: 0;
}

.tooltip-icon.tooltip-open-right::after {
  left: 0;
  right: auto;
}

.stat-tab-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  margin-bottom: 40px; 
  margin-top: 20px;
}

.stat-tab-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-kr);
  font-size: 1.25em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 5px 10px;
  letter-spacing: 0.1em;
}

.stat-tab-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.stat-tab-btn.active {
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  border-bottom: 2px solid #fff;
}

.stat-tab-divider {
  color: rgba(255, 255, 255, 0.15);
  font-size: 1.1em;
  pointer-events: none;
}

.tab-content-hidden {
  display: none !important;
}

#btnAbilityMagic {
  overflow: hidden;
  isolation: isolate;
}

#btnAbilityMagic .ability-magic-lock-overlay {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  z-index: 8;
  box-sizing: border-box;
  padding: 5px 8px;
  border-radius: inherit;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(170, 0, 0, 0.28), transparent 58%),
    linear-gradient(145deg, rgba(24, 0, 0, 0.88), rgba(8, 0, 0, 0.76));
  border: 1px solid rgba(255, 46, 46, 0.55);
  box-shadow:
    inset 0 0 28px rgba(255, 0, 0, 0.26),
    0 0 22px rgba(255, 28, 28, 0.16);
}

#btnAbilityMagic.ability-magic-locked {
  cursor: not-allowed;
  border-color: rgba(255, 52, 52, 0.72) !important;
  box-shadow:
    0 5px 0 rgba(0, 0, 0, 0.45),
    0 0 24px rgba(255, 24, 24, 0.22),
    inset 0 0 22px rgba(180, 0, 0, 0.18) !important;
}

#btnAbilityMagic.ability-magic-locked .choiceTitle,
#btnAbilityMagic.ability-magic-locked .choiceComment {
  opacity: 0.2;
  filter: saturate(0.45) blur(0.35px);
}

#btnAbilityMagic.ability-magic-locked .ability-magic-lock-overlay {
  display: block;
}

.ability-lock-warning-line {
  position: absolute;
  left: -8px;
  right: -8px;
  width: auto;
  margin: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
  color: rgba(255, 64, 64, 0.96);
  background: rgba(90, 0, 0, 0.7);
  border-block: 1px solid rgba(255, 88, 88, 0.32);
  border-radius: 0;
  font-size: 0.7em;
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 1.18;
  min-height: 22px;
  padding: 3px 0 3px;
  text-shadow: 0 0 8px rgba(255, 48, 48, 0.9);
}

.ability-lock-warning-line-top {
  top: 3px;
}

.ability-lock-warning-line-bottom {
  bottom: 3px;
}

.ability-lock-warning-track {
  display: flex;
  align-items: center;
  width: max-content;
  min-width: max-content;
  flex-wrap: nowrap;
  gap: 0;
  will-change: transform;
}

.ability-lock-warning-track span {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.18;
  padding-right: 0;
}

.ability-lock-warning-line-top .ability-lock-warning-track {
  animation: warning-marquee-left 7s linear infinite;
}

.ability-lock-warning-line-bottom .ability-lock-warning-track {
  animation: warning-marquee-right 7s linear infinite;
}

.ability-lock-core {
  position: absolute;
  inset: 34px 10px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  text-align: center;
  color: #ff3e3e;
  text-transform: uppercase;
}

.ability-lock-mark {
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  font-size: 1.02em;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-shadow: 0 0 10px rgba(255, 42, 42, 0.95);
  animation: crimson-lock-pulse 0.8s ease-in-out infinite alternate;
}

.ability-lock-sub {
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 174, 174, 0.86);
}

@keyframes warning-marquee-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes warning-marquee-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

@keyframes crimson-lock-pulse {
  from {
    opacity: 0.56;
    filter: brightness(0.84);
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    filter: brightness(1.34);
    transform: scale(1.04);
  }
}

@keyframes sysalert-pulse {
  0%, 100% { box-shadow: inset 0 0 12vw rgba(255, 0, 0, 0.4); }
  50% { box-shadow: inset 0 0 16vw rgba(255, 0, 0, 0.65); }
}

@keyframes sysalert-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ✨ 에덴 -> 원죄 해금 전환 애니메이션 스타일 */
.eden-anim-active::before {
  opacity: 1 !important;
  background: #000000 !important; /* 아예 완전히 검은색 */
  z-index: 3 !important;
  transition: background 0.5s ease, opacity 0.5s ease !important;
}

.eden-anim-active .choiceImage,
.eden-anim-active .choiceComment,
.eden-anim-active .choicePP {
  opacity: 0 !important; /* 이미지와 설명은 투명하게 숨김 */
  transition: opacity 0.4s ease !important;
}

.eden-anim-active .choiceTitle {
  color: #ffffff !important; /* 제목 하얀색으로 발광 */
  text-shadow: 0 0 20px rgba(255, 255, 255, 1), 0 0 40px rgba(255, 255, 255, 0.8) !important;
  z-index: 4 !important;
  transition: color 0.4s ease, text-shadow 0.4s ease, letter-spacing 0.3s ease !important;
}

/* 🌟 재화 변환기 버튼 위치 (내보내기 버튼과 위치 교환) */
.exchange-btn {
  left: 188px; 
}
.exchange-btn:hover svg {
  transform: rotate(180deg) scale(1.1);
}

/* 🌟 이미지 다운로드(Export) 버튼 전용 위치 및 애니메이션 */
.export-btn {
  left: 244px;
}
.export-btn:hover svg {
  transform: translateY(2px) scale(1.1); /* 아래로 다운로드 하는 느낌 */
}

/* 변환기 버튼 호버 스타일 */
#btnPtoV:hover:not(:disabled), #btnVtoP:hover:not(:disabled) {
  background: rgba(255, 218, 102, 0.2) !important;
  border-color: #ffda66 !important;
}
#btnPtoV:disabled, #btnVtoP:disabled {
  opacity: 0.3;
  cursor: not-allowed !important;
}

/* =================================================== */
/* 📱 모바일 및 태블릿 최적화 (반응형 UI) */
/* =================================================== */
@media (max-width: 1024px) {
  /* 스테이터스 모달 레이아웃 1열화 (태블릿부터 적용) */
  .status-modal-split { flex-direction: column !important; gap: 20px !important; }
  .status-left, .status-right { width: 100% !important; flex: none !important; }
  .status-portrait-frame { width: min(100%, 300px) !important; margin: 0 auto !important; }
  .damage-stat-columns { grid-template-columns: 1fr !important; gap: 15px !important; }
}

@media (max-width: 850px) {
  /* 0. 모바일 모달 닫기 버튼(X) 및 전체 크기/여백 최적화 (화면 바깥 잘림 완벽 방지) */
  .close-btn,
  #statCloseBtn,
  .status-modal-content .close-btn,
  .settings-content .close-btn,
  .city-modal-container .close-btn {
    top: 30px !important;
    right: 20px !important;
    font-size: 1.8rem !important;
    z-index: 999999 !important;
    background: rgba(0, 0, 0, 0.6) !important; /* 모바일에서 X 버튼 시인성 확보 */
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
  }
  
  .settings-content, 
  .stat-modal-content, 
  .status-modal-content,
  .credit-content {
    max-height: 88vh !important;
    height: auto !important;
    padding-top: 65px !important; /* X버튼이 내용물을 가리지 않도록 상단 여백 크게 확보 */
    overflow-y: auto !important;
    position: relative !important;
  }

  #statusModalOverlay .close-btn {
    position: fixed !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 9999999 !important;
  }

  /* 🌟 statCloseBtn은 index.html에서 스크롤 컨테이너(.stat-modal-content)
     바깥으로 옮겨졌지만, 혹시 모를 상황에 대비해 모바일에서도 확실히
     화면(뷰포트) 기준 고정 위치를 유지하도록 명시적으로 지정한다. */
  #statCloseBtn {
    position: fixed !important;
    top: 15px !important;
    right: 15px !important;
  }

  #statModalScrollArea {
    max-height: 78vh !important;
    padding: 10px 15px 40px !important;
  }

  /* 1. 각종 선택지 그리드를 2열로 강제 축소 */
  .choiceLine.choiceGrid3, .choiceLine.choiceGrid4, .choiceLine.choiceGrid5,
  #genderChoices, #hairChoices, #hairColorChoices, #eyeColorChoices, #pupilChoices, #heightChoices,
  #vesselChoices, #historyChoices, #postStatChoices, #partsChoices,
  #bloodChoices, #beastChoices, #holyChoices, #abyssChoices, #natureChoices, #curseChoices, #machineChoices, #insectChoices,
  #physicalMeritChoices, #mentalMeritChoices, #sexualMeritChoices,
  #physicalFlawChoices, #mentalFlawChoices, #sexualFlawChoices,
  #hiddenExtraMeritChoices, #traitChoices,
  #meritFlawChoices, #abilityChoices {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  /* 1열로 보여야 하는 큰 요소들 */
  #vesselChoices, #historyChoices, #postStatChoices, #machineChoices {
    grid-template-columns: 1fr !important;
  }
  
  /* 특성은 span 2를 해제하여 정상적인 그리드칸 차지 */
  #traitChoices > button.choice { grid-column: span 1 !important; }

  /* 2. 무기/스킬 트리의 Flex 레이아웃 수정 (4열 -> 2열) */
  .stance-skill-grid > button.choice,
  .equipment-grid > button.choice,
  .equipment-grid > .equipment-choice-shell {
    flex: 0 0 calc(50% - 7px) !important;
    max-width: calc(50% - 7px) !important;
    min-height: 240px !important;
  }

  /* 3. 좌측 스탯창 레이아웃 모바일화 */
  .statGrid { grid-template-columns: 1fr !important; gap: 20px !important; }
  #statColMain .statRow, #statColSub .statRow, #statColElement .statRow {
    grid-template-columns: minmax(100px, 1fr) auto !important; 
  }
  .stat-tab-container { gap: 15px !important; }
  .stat-tab-btn { font-size: 1.05em !important; }

  /* 4. 도시/세력 상세 모달 모바일 최적화 */
  .city-detail-card { padding: 80px 20px 100px 20px !important; } /* 상단 여백(80px) 추가로 X버튼에 안 가리게 보정 */
  .city-detail-lore { grid-template-columns: 1fr !important; gap: 20px !important; display: flex !important; flex-direction: column !important; }
  .city-lore-section { border-right: none !important; border-bottom: 1px solid rgba(255,255,255,0.1) !important; padding: 0 0 20px 0 !important; }
  
  .faction-row-header { padding: 14px 18px; }
  .faction-row-name { font-size: 1.1em; }
  .faction-row-header.faction-open .faction-row-name { font-size: 1.35em; }
  .faction-row-content { padding: 0 18px 28px; }

  /* 5. 성흔(클래스) 캐러셀 및 모달 */
  .coverflow-card { width: 85vw !important; height: auto !important; min-height: 60vh !important; padding: 30px 20px !important; }
  #carouselClassTitle, .side-card-title { font-size: 2.2em !important; margin-bottom: 15px !important; }
  
  .class-modal-body { flex-direction: column !important; }
  .class-sidebar { width: 100% !important; border-right: none !important; border-bottom: 1px solid rgba(255,255,255,0.1) !important; height: 180px !important; min-height: 180px !important; }
  .class-detail-wrap { padding: 20px !important; }
  .stigma-converter-box { flex-direction: column !important; gap: 15px !important; }
  .stigma-tree-container { padding: 20px !important; min-height: 350px !important; }
  
  /* 모바일 성흔 팝업창 중앙 고정 (화면 바깥으로 나가는 버그 방지) */
  .stigma-popup-detail {
    position: fixed !important;
    top: 50% !important; left: 50% !important;
    transform: translate(-50%, -40%) !important;
    width: 85vw !important; max-width: 320px !important;
    z-index: 999999 !important;
  }
  .stigma-popup-detail.show { transform: translate(-50%, -50%) !important; }

  /* 6. MP3 설정창 모바일화 */
  .mp3-container { padding: 20px !important; gap: 15px !important; overflow-y: auto !important; }
  .music-modal-content { height: 80vh !important; width: 90vw !important; max-width: 90vw !important; }
  .music-modal-overlay { justify-content: center !important; align-items: center !important; padding: 0 !important; }

  /* 7. 공통 UI 크기 조정 (텍스트, 버튼) */
  .row { padding: 15px !important; font-size: 0.95em !important; margin: 20px auto !important; }
  button.choice, button.choice.bodyChoice { padding: 15px 12px 12px !important; font-size: 0.95em !important; min-height: auto !important; }
  .choiceTitle { font-size: 1.1em !important; }
  .choiceComment { font-size: 0.9em !important; }
  .body-part-img, .choiceImage { border-radius: 8px !important; margin-bottom: 10px !important; }
  
  /* 본질 발아 버튼 하위 그리드 정렬 */
  .essence-grid { grid-template-columns: 1fr !important; }
  
  /* 하단 고정 플로팅 버튼들 모바일 크기 및 간격 조정 */
  .settings-btn { width: 40px !important; height: 40px !important; bottom: 15px !important; }
  #settingsBtn { left: 15px !important; }
  #musicBtn { left: 65px !important; }
  #statusBtn { left: 115px !important; }
  #statToggleBtn { left: 165px !important; }
  #exchangeBtn { left: 215px !important; }
  #exportBtn { left: 265px !important; }
  #saveGameBtn { left: 315px !important; }

  /* 화면이 좁아 하단 버튼 줄과 겹칠 수 있는 가능성/그릇 HUD를 버튼 줄 위로 올림 */
  .pointHUD { bottom: 65px !important; }

  /* 크로퍼 모달 */
  .cropper-workspace-frame { min-height: 250px !important; height: 40vh !important; }
  .cropper-modal-content { padding: 15px !important; }
  
  /* 이브(Eve) 대화창 세로 배치 */
  .eve-container { flex-direction: column !important; margin-top: 40px !important; }
  .eve-image-box { height: 40vh !important; min-height: 300px !important; flex: none !important; }
}

@media (max-width: 480px) {
  /* 모달 상단 텍스트 및 여백 초소형 최적화 */
  .settings-content h3, .credit-title { font-size: 1.4em !important; margin-bottom: 20px !important; }
  .status-portrait-frame { width: 100% !important; }
  .close-btn { right: 10px !important; top: 25px !important; } /* 화면 폭이 좁을 때 여백 최적화 */

  /* 아주 좁은 세로형 스마트폰 최적화 (모든 선택지 1열화) */
  .stance-skill-grid > button.choice,
  .equipment-grid > button.choice,
  .equipment-grid > .equipment-choice-shell {
    flex: 0 0 100% !important; max-width: 100% !important;
  }
  .choiceLine.choiceGrid3, .choiceLine.choiceGrid4, .choiceLine.choiceGrid5,
  #genderChoices, #hairChoices, #hairColorChoices, #eyeColorChoices, #pupilChoices, #heightChoices,
  #bloodChoices, #beastChoices, #holyChoices, #abyssChoices, #natureChoices, #curseChoices, #machineChoices, #insectChoices,
  #partsChoices, #traitChoices,
  #physicalMeritChoices, #mentalMeritChoices, #sexualMeritChoices,
  #physicalFlawChoices, #mentalFlawChoices, #sexualFlawChoices,
  #hiddenExtraMeritChoices,
  #meritFlawChoices, #abilityChoices {
    grid-template-columns: 1fr !important; /* 완벽하게 1열 */
  }
  
  /* 1열로 변하면서 이미지가 너무 거대해지는 것을 방지 */
  #traitChoices .body-part-img,
  .body-part-img { width: 60% !important; }

  /* 아주 좁은 화면에서 종족 특성 카드 그리드가 최소 폭(320px) 때문에 잘리지 않도록 축소 */
  .race-trait-grid { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)) !important; }
  
  /* 🌟 타이틀 폰트 크기는 .title-row의 --title-unit이 화면 크기에 맞춰 일괄로 축소하므로
     여기서 별도로 강제 지정하지 않음(안 그러면 이 글자들만 따로 놀아서 다시 겹치는 문제가 생김) */
  .ds-menu-btn { min-width: 180px !important; font-size: 1.1rem !important; }
}

/* =================================================== */
/* 🌟 왼쪽 하단 플로팅 버튼 및 연결된 모달 직각화 처리 */
/* =================================================== */
.settings-btn {
  border-radius: 0 !important; /* 플로팅 버튼 직각화 */
}
.settings-content, 
.stat-modal-content, 
.status-modal-content, 
.credit-content {
  border-radius: 0 !important; /* 설정, 스탯, 상태창, 연산기, 변환기 등 모든 모달창 직각화 */
}
#statModalScrollArea,
#exchangeModalOverlay .settings-content div {
  border-radius: 0 !important; /* 스탯창 내부 및 변환기 내부 박스 직각화 */
}
#btnPtoV, #btnVtoP {
  border-radius: 0 !important; /* 변환기 내부 버튼 직각화 */
}

/* ================================================
   히든 장점 타이틀 이펙트
   ================================================ */

/* 구속제어술식 제1, 2, 3호 — 뱀파이어 혈족 구속, 보라+핏빛 글리치 */
/* 구속제어술식 — 붉은 눈들이 열리는 이펙트 */
.soul-restraint-title {
  position: relative;
  display: inline-block;
  font-weight: 900 !important;
  font-size: 1.3em !important;
  letter-spacing: 0.12em;
  color: #e82222 !important;
  text-shadow: 0 0 10px rgba(220,0,0,0.9), 0 0 22px rgba(180,0,0,0.5);
  animation: eye-glow-main 2.5s infinite ease-in-out;
}
.soul-restraint-title::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  color: #ff2222;
  text-shadow: 0 0 18px rgba(255,0,0,1), 0 0 35px rgba(200,0,0,0.8);
  clip-path: inset(47% 0 47% 0 round 50%);
  pointer-events: none;
  z-index: 1;
  animation: eye-open-close-1 2.5s infinite ease-in-out;
}
.soul-restraint-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  color: rgba(255,60,60,0.75);
  text-shadow: 0 0 22px rgba(255,0,0,0.9);
  clip-path: inset(47% 0 47% 0 round 50%);
  pointer-events: none;
  z-index: 1;
  transform: translateY(2px);
  animation: eye-open-close-1 2.5s infinite ease-in-out 1.1s;
}
@keyframes eye-glow-main {
  0%,100% { text-shadow: 0 0 10px rgba(220,0,0,0.9), 0 0 22px rgba(180,0,0,0.5); filter: brightness(1); }
  40%     { text-shadow: 0 0 22px rgba(255,0,0,1), 0 0 50px rgba(220,0,0,0.8), 0 0 80px rgba(180,0,0,0.4); filter: brightness(1.5); }
  55%     { text-shadow: 0 0 10px rgba(220,0,0,0.9); filter: brightness(1); }
}
@keyframes eye-open-close-1 {
  0%, 5%    { clip-path: inset(47% 0 47% 0 round 50%); opacity: 0; }
  18%       { clip-path: inset(28% 0 28% 0 round 35%); opacity: 1; }
  32%, 58%  { clip-path: inset(2% 0 2% 0 round 8%); opacity: 1; }
  72%       { clip-path: inset(28% 0 28% 0 round 35%); opacity: 0.7; }
  88%, 100% { clip-path: inset(47% 0 47% 0 round 50%); opacity: 0; }
}

/* 웨폰 마스터 — 굵은 검은 글씨, 흰 아웃라인. 숫자 1~9가 텍스트를 중심으로 한 원형 위치(반지름
   ~59px)에서 하나씩(0.125초 간격) 차례로 "나타나서 그 자리에 쌓이고", 9번까지 전부 모이면 그
   즉시 9개 전부가 동시에 각자의 반대편으로 스치듯 지나가며 사라진다(t=1.3~1.55s). 숫자들이
   완전히 사라지는 바로 그 순간(t=1.55s) 글자가 세로 6조각으로 갈라져 흰색 그대로(검은색으로
   변하지 않음) 좌우로 번갈아 슬라이드하며 흩어지고(0.3초), 짧은 텀(0.03s) 뒤 글자가 복귀하면
   곧바로 참격 16개가 방사형으로 퍼퍼퍽 쏟아진다(흰/검 번갈아). 2초 정지 후 처음(1번)부터 반복.
   전체 주기 5.8초.
   ※ 이전 버전에서 숫자(.weapon-slash-icon)의 animation-duration이 실수로 5.4s로 남아있어
   (다른 요소들은 5.6s) 실제 컷 타이밍이 의도보다 일찍 끝나버려 텍스트 스캐터와 어긋났었다 —
   지금은 모든 요소가 동일한 5.8s를 공유한다. */
.weapon-master-title {
  position: relative;
  display: inline-block;
  overflow: visible;
  font-weight: 900 !important;
  font-size: 1.3em !important;
  letter-spacing: 0.12em;
  color: #0a0a0a !important;
  -webkit-text-stroke: 1.4px #ffffff;
  text-shadow:
    1.6px 0 0 #0a0a0a, -1.6px 0 0 #0a0a0a,
    0 1.6px 0 #0a0a0a, 0 -1.6px 0 #0a0a0a,
    1.6px 1.6px 0 #0a0a0a, -1.6px -1.6px 0 #0a0a0a,
    1.6px -1.6px 0 #0a0a0a, -1.6px 1.6px 0 #0a0a0a;
  /* 글자 자체를 조금 위로 올림 — 원형으로 도는 효과도 텍스트에 딸려서 그대로 함께 위로 이동한다 */
  transform: translateY(-18px);
}
/* 제목이 위로 올라간 만큼 원형 이펙트(숫자/참격)의 위쪽이 카드 상단에서 잘리지 않도록,
   이 병합(merit) 버튼만 overflow를 열어준다 */
#merit-weapon-master {
  overflow: visible !important;
}
/* .choiceTitle 기본 규칙이 width:100%; text-align:center; 로 이 title 박스를 버튼 전체 너비로
   늘려버리기 때문에, 이모지 위치의 기준(top:50%;left:50%)을 이 박스가 아니라 실제 글자 크기에만
   딱 맞는 내부 wm-text-wrap으로 옮긴다 */
.weapon-master-title .wm-text-wrap {
  position: relative;
  display: inline-block;
}

/* 가면라이더 디케이드 변신 효과 오마주 — 숫자 9개가 전부 사라지는 정확한 순간(t=1.55s, 숫자
   exit-end와 동일 시점)에 맞춰 실제 글자(wm-realtext)가 즉시 사라지고 그 자리에 세로로 6등분된
   사본(wm-strip, 흰색 그대로 유지 — 검은색으로 변하지 않음)이 나타나 홀수/짝수가 번갈아 좌/우로
   슬라이드하며 0.3초에 걸쳐 페이드아웃된다. 짧은 텀(0.03s) 후 글자가 다시 fade-in 되어
   완전히 복귀하는 시점부터 참격(burst)이 시작된다 */
/* inline-block으로 두면 베이스라인 정렬 기준이 바뀌면서 opacity 애니메이션 중 글자가
   위로 살짝 튀는 현상이 생기므로(이전에 wm-text에서 겪은 문제) 반드시 순수 inline 유지 */
.weapon-master-title .wm-realtext {
  animation: wm-realtext-visibility 5.8s infinite;
}
.weapon-master-title .wm-strip {
  position: absolute;
  inset: 0;
  color: #ffffff;
  -webkit-text-stroke: 0;
  text-shadow: none;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  animation-duration: 5.8s;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}
.wm-strip::before {
  content: attr(data-text);
  display: block;
  white-space: nowrap;
}
.wm-strip-1 { clip-path: inset(0 83.34% 0 0%);     --dir: -1; animation-name: wm-strip-life; }
.wm-strip-2 { clip-path: inset(0 66.67% 0 16.67%); --dir: 1;  animation-name: wm-strip-life; }
.wm-strip-3 { clip-path: inset(0 50%    0 33.33%); --dir: -1; animation-name: wm-strip-life; }
.wm-strip-4 { clip-path: inset(0 33.33% 0 50%);    --dir: 1;  animation-name: wm-strip-life; }
.wm-strip-5 { clip-path: inset(0 16.67% 0 66.67%); --dir: -1; animation-name: wm-strip-life; }
.wm-strip-6 { clip-path: inset(0 0%     0 83.34%); --dir: 1;  animation-name: wm-strip-life; }

/* 숫자 exit-end(t=1.55s=26.72%)에 정확히 맞춰 실제 글자가 사라지고, 조각들이 흩어졌다가(~1.85s)
   다시 제자리로 미끄러져 들어와 완전히 맞춰지는 순간(t=1.97s=33.97%)에야 실제 글자로 넘겨받아
   t=1.98s(34.14%)에 완전히 복귀 — 이 시점에 맞춰 참격이 시작된다. 예전에는 조각이 흩어진 채로
   숨어있다가 실제 글자가 아무 예고 없이 뿅 하고 페이드인만 하던 것을, 조각들이 되돌아와
   자연스럽게 다시 뭉치는 과정으로 바꿨다 */
@keyframes wm-realtext-visibility {
  0%, 26.72%      { opacity: 1; }
  26.90%, 33.97%  { opacity: 0; }
  34.14%, 100%    { opacity: 1; }
}
/* 전 스트립 공용 — ①흩어짐: 숫자가 사라지는 순간 즉시 등장(흰색, 0 오프셋) → 각자 --dir
   방향으로 슬라이드하며 0.3초에 걸쳐 페이드아웃(t=1.55~1.85s).
   ②재조립: 짧게 숨어있다가(t=1.88s) 흩어진 자리에서 다시 나타나 천천히 제자리로 미끄러져
   들어오고, 살짝 지나쳤다가(오버슈트) 정확히 원위치에 안착한 뒤(t=1.97s) 실제 글자에게
   자리를 넘겨준다 */
@keyframes wm-strip-life {
  0%, 26.72%  { opacity: 0; transform: translateX(0); }
  26.90%      { opacity: 1; transform: translateX(0); }
  31.90%      { opacity: 0; transform: translateX(calc(var(--dir) * 55px)); }
  32.41%      { opacity: 0; transform: translateX(calc(var(--dir) * 55px)); }
  33.10%      { opacity: 1; transform: translateX(calc(var(--dir) * 18px)); animation-timing-function: ease-out; }
  33.45%      { opacity: 1; transform: translateX(calc(var(--dir) * -4px)); }
  33.97%      { opacity: 1; transform: translateX(0); }
  34.14%      { opacity: 0; transform: translateX(0); }
  100%        { opacity: 0; transform: translateX(0); }
}

.weapon-master-title .weapon-slash-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 0.8em;
  line-height: 1;
  color: #ffffff;
  -webkit-text-stroke: 0;
  text-shadow: none;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  /* duration/iteration은 공용, name/delay는 숫자마다 달라서 wm-num-slot-N 클래스에서 개별 지정.
     주의: 반드시 wm-realtext/wm-strip/wm-burst와 동일한 5.8s를 써야 한다 — 이전에 여기만 5.4s로
     남아있어서(다른 요소는 5.6s) 숫자의 실제 컷 타이밍이 의도보다 일찍 끝나며 전체 이펙트가
     어긋났었다 */
  animation-duration: 5.8s;
  animation-timing-function: ease;
  animation-iteration-count: infinite;
}
/* 글자와의 거리(반지름)를 기존 ~42px에서 ~59px로 넓힘(약 1.4배). 등장 간격은 0.25s→0.125s로
   재차 2배 빠르게.
   주의: nth-child는 wm-realtext/wm-strip 등 앞에 다른 형제가 끼어들면 순번이 밀려 완전히 엉뚱한
   숫자에 매칭되는 버그가 있었다(숫자 3~9가 아예 안 나타나던 원인) — 그래서 순서에 안전한
   전용 클래스(wm-num-slot-N)로 지정한다 */
.wm-num-slot-1 { --dx: 59px;  --dy: 0px;   --rot: 20deg;  animation-name: wm-num-1; animation-delay: 0.000s; }
.wm-num-slot-2 { --dx: 45px;  --dy: 38px;  --rot: -30deg; animation-name: wm-num-2; animation-delay: 0.125s; }
.wm-num-slot-3 { --dx: 10px;  --dy: 57px;  --rot: 55deg;  animation-name: wm-num-3; animation-delay: 0.250s; }
.wm-num-slot-4 { --dx: -29px; --dy: 50px;  --rot: -60deg; animation-name: wm-num-4; animation-delay: 0.375s; }
.wm-num-slot-5 { --dx: -55px; --dy: 20px;  --rot: 90deg;  animation-name: wm-num-5; animation-delay: 0.500s; }
.wm-num-slot-6 { --dx: -55px; --dy: -20px; --rot: -90deg; animation-name: wm-num-6; animation-delay: 0.625s; }
.wm-num-slot-7 { --dx: -29px; --dy: -50px; --rot: 45deg;  animation-name: wm-num-7; animation-delay: 0.750s; }
.wm-num-slot-8 { --dx: 10px;  --dy: -57px; --rot: -45deg; animation-name: wm-num-8; animation-delay: 0.875s; }
.wm-num-slot-9 { --dx: 45px;  --dy: -38px; --rot: 30deg;  animation-name: wm-num-9; animation-delay: 1.000s; }

/* 숫자 1~9는 각자 delay가 달라 "9개 전부가 t=1.3s에 동시에 스윕을 시작해서 t=1.55s에 동시에
   사라진다"는 절대시간 목표를 맞추려면 퍼센트 위치가 전부 달라야 한다 — 그래서 공용 키프레임 대신
   숫자별로 keyframe을 하나씩 둔다. 팝인(자기 delay+0.1s)은 전부 동일, 이후 그 자리에서 대기하다가
   전원이 절대시각 1.3~1.55s 구간에서 동시에 반대편으로 스윕+페이드된다 */
@keyframes wm-num-1 {
  0%      { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(0deg); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  1.72%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  22.41%  { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  24.75%  { opacity: 1; transform: translate(calc(-50% - var(--dx) * 0.4), calc(-50% - var(--dy) * 0.4)) scale(1.3) rotate(var(--rot)); filter: drop-shadow(0 0 12px rgba(255,255,255,1)); }
  26.72%  { opacity: 0; transform: translate(calc(-50% - var(--dx)), calc(-50% - var(--dy))) scale(0.6) rotate(var(--rot)); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  100%    { opacity: 0; }
}
@keyframes wm-num-2 {
  0%      { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(0deg); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  1.72%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  20.26%  { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  22.59%  { opacity: 1; transform: translate(calc(-50% - var(--dx) * 0.4), calc(-50% - var(--dy) * 0.4)) scale(1.3) rotate(var(--rot)); filter: drop-shadow(0 0 12px rgba(255,255,255,1)); }
  24.57%  { opacity: 0; transform: translate(calc(-50% - var(--dx)), calc(-50% - var(--dy))) scale(0.6) rotate(var(--rot)); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  100%    { opacity: 0; }
}
@keyframes wm-num-3 {
  0%      { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(0deg); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  1.72%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  18.10%  { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  20.44%  { opacity: 1; transform: translate(calc(-50% - var(--dx) * 0.4), calc(-50% - var(--dy) * 0.4)) scale(1.3) rotate(var(--rot)); filter: drop-shadow(0 0 12px rgba(255,255,255,1)); }
  22.41%  { opacity: 0; transform: translate(calc(-50% - var(--dx)), calc(-50% - var(--dy))) scale(0.6) rotate(var(--rot)); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  100%    { opacity: 0; }
}
@keyframes wm-num-4 {
  0%      { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(0deg); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  1.72%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  15.95%  { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  18.28%  { opacity: 1; transform: translate(calc(-50% - var(--dx) * 0.4), calc(-50% - var(--dy) * 0.4)) scale(1.3) rotate(var(--rot)); filter: drop-shadow(0 0 12px rgba(255,255,255,1)); }
  20.26%  { opacity: 0; transform: translate(calc(-50% - var(--dx)), calc(-50% - var(--dy))) scale(0.6) rotate(var(--rot)); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  100%    { opacity: 0; }
}
@keyframes wm-num-5 {
  0%      { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(0deg); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  1.72%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  13.79%  { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  16.13%  { opacity: 1; transform: translate(calc(-50% - var(--dx) * 0.4), calc(-50% - var(--dy) * 0.4)) scale(1.3) rotate(var(--rot)); filter: drop-shadow(0 0 12px rgba(255,255,255,1)); }
  18.10%  { opacity: 0; transform: translate(calc(-50% - var(--dx)), calc(-50% - var(--dy))) scale(0.6) rotate(var(--rot)); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  100%    { opacity: 0; }
}
@keyframes wm-num-6 {
  0%      { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(0deg); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  1.72%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  11.64%  { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  13.97%  { opacity: 1; transform: translate(calc(-50% - var(--dx) * 0.4), calc(-50% - var(--dy) * 0.4)) scale(1.3) rotate(var(--rot)); filter: drop-shadow(0 0 12px rgba(255,255,255,1)); }
  15.95%  { opacity: 0; transform: translate(calc(-50% - var(--dx)), calc(-50% - var(--dy))) scale(0.6) rotate(var(--rot)); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  100%    { opacity: 0; }
}
@keyframes wm-num-7 {
  0%      { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(0deg); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  1.72%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  9.48%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  11.82%  { opacity: 1; transform: translate(calc(-50% - var(--dx) * 0.4), calc(-50% - var(--dy) * 0.4)) scale(1.3) rotate(var(--rot)); filter: drop-shadow(0 0 12px rgba(255,255,255,1)); }
  13.79%  { opacity: 0; transform: translate(calc(-50% - var(--dx)), calc(-50% - var(--dy))) scale(0.6) rotate(var(--rot)); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  100%    { opacity: 0; }
}
@keyframes wm-num-8 {
  0%      { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(0deg); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  1.72%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  7.33%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  10.01%  { opacity: 1; transform: translate(calc(-50% - var(--dx) * 0.4), calc(-50% - var(--dy) * 0.4)) scale(1.3) rotate(var(--rot)); filter: drop-shadow(0 0 12px rgba(255,255,255,1)); }
  12.05%  { opacity: 0; transform: translate(calc(-50% - var(--dx)), calc(-50% - var(--dy))) scale(0.6) rotate(var(--rot)); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  100%    { opacity: 0; }
}
@keyframes wm-num-9 {
  0%      { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(0deg); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  1.72%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  5.17%   { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); filter: drop-shadow(0 0 3px rgba(0,0,0,0.7)); }
  7.51%   { opacity: 1; transform: translate(calc(-50% - var(--dx) * 0.4), calc(-50% - var(--dy) * 0.4)) scale(1.3) rotate(var(--rot)); filter: drop-shadow(0 0 12px rgba(255,255,255,1)); }
  9.48%   { opacity: 0; transform: translate(calc(-50% - var(--dx)), calc(-50% - var(--dy))) scale(0.6) rotate(var(--rot)); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  100%    { opacity: 0; }
}

/* 글자가 완전히 복귀하는 t=1.98s(34.14%)부터, 훨씬 많은 참격 16개가 글자 중심을 기준으로
   방사형 16방향(22.5°씩)에 서로 0.1초 텀(1.98, 2.08, …, 3.48초)을 두고 퍼퍼퍽 쏟아지듯
   터져나간다. 흰색/검은색 다이아몬드를 번갈아 사용. 마지막 참격이 끝나는 약 3.77초 이후 2초
   정지했다가(5.8초 지점에서) 처음(숫자 1번)부터 다시 반복된다 */
.weapon-master-title .wm-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 30px;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  animation: wm-burst-life 5.8s infinite;
}
.wm-burst-w { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M50,0 L53.5,50 L50,100 L46.5,50 Z' fill='%23ffffff'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.wm-burst-b { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M50,0 L53.5,50 L50,100 L46.5,50 Z' fill='%23000000'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.wm-burst-w { filter: drop-shadow(0 0 3px rgba(0,0,0,0.85)); }
.wm-burst-b { filter: drop-shadow(0 0 3px rgba(255,255,255,0.9)); }
.wm-burst-1  { --dx: 55px;  --dy: 0px;   --rot: -90deg;   animation-delay: 1.98s; }
.wm-burst-2  { --dx: 51px;  --dy: 21px;  --rot: -67.5deg; animation-delay: 2.08s; }
.wm-burst-3  { --dx: 39px;  --dy: 39px;  --rot: -45deg;   animation-delay: 2.18s; }
.wm-burst-4  { --dx: 21px;  --dy: 51px;  --rot: -22.5deg; animation-delay: 2.28s; }
.wm-burst-5  { --dx: 0px;   --dy: 55px;  --rot: 0deg;     animation-delay: 2.38s; }
.wm-burst-6  { --dx: -21px; --dy: 51px;  --rot: 22.5deg;  animation-delay: 2.48s; }
.wm-burst-7  { --dx: -39px; --dy: 39px;  --rot: 45deg;    animation-delay: 2.58s; }
.wm-burst-8  { --dx: -51px; --dy: 21px;  --rot: 67.5deg;  animation-delay: 2.68s; }
.wm-burst-9  { --dx: -55px; --dy: 0px;   --rot: 90deg;    animation-delay: 2.78s; }
.wm-burst-10 { --dx: -51px; --dy: -21px; --rot: 112.5deg; animation-delay: 2.88s; }
.wm-burst-11 { --dx: -39px; --dy: -39px; --rot: 135deg;   animation-delay: 2.98s; }
.wm-burst-12 { --dx: -21px; --dy: -51px; --rot: 157.5deg; animation-delay: 3.08s; }
.wm-burst-13 { --dx: 0px;   --dy: -55px; --rot: 180deg;   animation-delay: 3.18s; }
.wm-burst-14 { --dx: 21px;  --dy: -51px; --rot: 202.5deg; animation-delay: 3.28s; }
.wm-burst-15 { --dx: 39px;  --dy: -39px; --rot: 225deg;   animation-delay: 3.38s; }
.wm-burst-16 { --dx: 51px;  --dy: -21px; --rot: 247.5deg; animation-delay: 3.48s; }
@keyframes wm-burst-life {
  0%    { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(var(--rot)); }
  1.12% { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.15) rotate(var(--rot)); }
  2.89% { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); }
  4.93% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.6) rotate(var(--rot)); }
  100%  { opacity: 0; }
}

/* 아뢰야식 — 존재 소거, 텍스트가 오른쪽으로 지워졌다 복원 */
.alaya-title {
  position: relative;
  display: inline-block;
  font-weight: 900 !important;
  font-size: 1.3em !important;
  letter-spacing: 0.12em;
  color: #60b8e8 !important;
  text-shadow: 0 0 8px rgba(80,160,220,0.7);
  animation: alaya-erase 3s infinite linear;
}
.alaya-title::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  z-index: -1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(100,200,255,0.45);
  pointer-events: none;
  animation: alaya-ghost-shift 3s infinite linear;
}
@keyframes alaya-erase {
  0%,55%  { opacity: 1; filter: blur(0); clip-path: inset(0 0% 0 0); }
  65%     { opacity: 0.7; filter: blur(0.5px); clip-path: inset(0 35% 0 0); }
  72%     { opacity: 0.2; filter: blur(2px); clip-path: inset(0 80% 0 0); }
  74%     { opacity: 0; clip-path: inset(0 100% 0 0); }
  75%     { opacity: 0; clip-path: inset(0 0 0 100%); filter: blur(0); }
  82%     { opacity: 1; clip-path: inset(0 0 0 0); }
  100%    { opacity: 1; }
}
@keyframes alaya-ghost-shift {
  0%,55%  { opacity: 0; transform: translateX(0); }
  65%     { opacity: 0.55; transform: translateX(6px); }
  74%     { opacity: 0; transform: translateX(14px); }
  100%    { opacity: 0; }
}

/* 색마 — 핑크-크림슨 심장박동 */
.lust-title {
  position: relative;
  display: inline-block;
  font-weight: 900 !important;
  font-size: 1.3em !important;
  letter-spacing: 0.12em;
  color: #e860a0 !important;
  text-shadow: 0 0 8px rgba(220,60,140,0.8);
  animation: lust-heartbeat 1.6s infinite ease-in-out;
}
.lust-title::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  z-index: -1;
  color: rgba(255,100,170,0.28);
  filter: blur(7px);
  pointer-events: none;
  animation: lust-aura 1.6s infinite ease-in-out;
}
@keyframes lust-heartbeat {
  0%      { transform: scale(1); filter: brightness(1); }
  10%     { transform: scale(1.07); filter: brightness(1.45) drop-shadow(0 0 9px rgba(255,80,155,0.9)); }
  20%     { transform: scale(0.97); filter: brightness(0.9); }
  32%     { transform: scale(1.04); filter: brightness(1.2) drop-shadow(0 0 5px rgba(255,80,155,0.6)); }
  45%,100%{ transform: scale(1); filter: brightness(1); }
}
@keyframes lust-aura {
  0%,100% { opacity: 0.45; transform: scale(1); }
  10%     { opacity: 1; transform: scale(1.12); }
  32%     { opacity: 0.65; transform: scale(1.06); }
  45%     { opacity: 0.35; transform: scale(1); }
}

/* 천결영체 — 천여주박과 동일 구조의 글리치 이펙트, 하늘빛 색상 */
.cheongyeol-title {
  font-weight: 900 !important;
  font-size: 1.4em !important;
  letter-spacing: 0.15em;
  position: relative;
  display: inline-block;
  -webkit-text-stroke: 0 !important;
  animation: text-blue-glitch 4s infinite linear;
}
.cheongyeol-title::before,
.cheongyeol-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  color: transparent;
  pointer-events: none;
  z-index: -1;
  -webkit-text-stroke: 0 !important;
}
.cheongyeol-title::before { animation: blue-burst 4s infinite ease-out; }
.cheongyeol-title::after  { animation: blue-burst 4s infinite ease-out 0.15s; }

@keyframes text-blue-glitch {
  0%, 30% {
    color: #64c8ff;
    text-shadow: 0 0 8px rgba(100,200,255,0.6);
    transform: none;
  }
  31% { color: #071828; transform: translateX(-12px) skewX(20deg); text-shadow: 15px 0 0 rgba(100,200,255,0.8); }
  32% { color: #64c8ff; transform: translateX(0); text-shadow: 0 0 8px rgba(100,200,255,0.6); }
  34% { color: #071828; transform: translateX(15px) skewX(-25deg); text-shadow: -20px 0 0 rgba(50,120,180,0.8); }
  35% { color: #64c8ff; transform: translateX(0); text-shadow: 0 0 8px rgba(100,200,255,0.6); }
  37% { color: transparent; transform: translateX(-5px); text-shadow: -15px 0 0 #071828, 15px 0 0 #1a4a6a; }
  38% { color: #64c8ff; transform: translateX(0); text-shadow: 0 0 8px rgba(100,200,255,0.6); }
  40% { color: #071828; transform: translateX(10px) skewX(10deg); text-shadow: -12px 0 0 rgba(0,20,50,0.5); }
  42%, 70% { color: #071828; transform: none; text-shadow: 0 0 10px rgba(0,20,50,0.9); }
  75%, 100% { color: #64c8ff; text-shadow: 0 0 8px rgba(100,200,255,0.6); transform: none; }
}

@keyframes blue-burst {
  0%, 41% {
    text-shadow:
      0 0 0 rgba(0,0,0,0),
      0 0 0 rgba(0,0,0,0),
      0 0 0 rgba(0,0,0,0),
      0 0 0 rgba(0,0,0,0),
      0 0 0 rgba(0,0,0,0),
      0 0 0 rgba(0,0,0,0),
      0 0 0 rgba(0,0,0,0),
      0 0 0 rgba(0,0,0,0);
    transform: scale(1);
  }
  42% {
    text-shadow:
      0 0 0 rgba(7,24,40,0.9),
      0 0 0 rgba(7,24,40,0.9),
      0 0 0 rgba(7,24,40,0.9),
      0 0 0 rgba(7,24,40,0.9),
      0 0 0 rgba(7,24,40,0.9),
      0 0 0 rgba(7,24,40,0.9),
      0 0 0 rgba(7,24,40,0.9),
      0 0 0 rgba(7,24,40,0.9);
    transform: scale(1);
  }
  70%, 100% {
    text-shadow:
      0 -45px 10px rgba(7,24,40,0),
      0  45px 10px rgba(7,24,40,0),
     -45px  0 10px rgba(7,24,40,0),
      45px  0 10px rgba(7,24,40,0),
     -35px -35px 10px rgba(7,24,40,0),
      35px -35px 10px rgba(7,24,40,0),
     -35px  35px 10px rgba(7,24,40,0),
      35px  35px 10px rgba(7,24,40,0);
    transform: scale(1.3);
  }
}

/* 2페이즈 — 위기 후 폭발적 각성, 오렌지-적염 서지 */
.phase2-title {
  position: relative;
  display: inline-block;
  font-weight: 900 !important;
  font-size: 1.3em !important;
  letter-spacing: 0.12em;
  color: #ff7840 !important;
  text-shadow: 0 0 7px rgba(255,120,60,0.7);
  animation: phase2-surge 4.5s infinite ease-in-out;
}
.phase2-title::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  z-index: -1;
  color: #ffcc44;
  filter: blur(5px);
  pointer-events: none;
  opacity: 0;
  animation: phase2-core-flash 4.5s infinite ease-in-out;
}
@keyframes phase2-surge {
  0%,52%  { text-shadow: 0 0 6px rgba(255,120,60,0.5); filter: brightness(1); transform: scale(1); }
  58%     { text-shadow: 0 0 4px rgba(255,120,60,0.3); filter: brightness(0.82); transform: scale(0.97); }
  68%     { text-shadow: 0 0 22px rgba(255,210,60,1), 0 0 45px rgba(255,100,30,0.8), 0 0 70px rgba(255,50,0,0.4); filter: brightness(1.65) saturate(1.6); transform: scale(1.09); }
  73%     { text-shadow: 0 0 14px rgba(255,180,60,0.9), 0 0 28px rgba(255,80,30,0.6); filter: brightness(1.3); transform: scale(1.04); }
  86%,100%{ text-shadow: 0 0 7px rgba(255,120,60,0.7); filter: brightness(1); transform: scale(1); }
}
@keyframes phase2-core-flash {
  0%,55%  { opacity: 0; }
  64%     { opacity: 0; }
  68%     { opacity: 0.85; }
  78%,100%{ opacity: 0; }
}

/* 만물의 영장 — 억눌린 시기심, 부글거리는 인간의 분노 */
.human-lord-title {
  position: relative;
  display: inline-block;
  font-weight: 900 !important;
  font-size: 1.3em !important;
  letter-spacing: 0.12em;
  color: #e03030 !important;
  text-shadow: 0 0 10px rgba(220,20,20,0.8), 0 0 25px rgba(180,0,0,0.4);
  animation: human-lord-rage 5s infinite ease-in-out;
}
.human-lord-title::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  color: #ff6666;
  filter: blur(6px);
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  animation: human-lord-aura 5s infinite ease-in-out;
}
.human-lord-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,80,80,0.5);
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
  animation: human-lord-crack 5s infinite ease-in-out;
}
@keyframes human-lord-rage {
  0%,100% { text-shadow: 0 0 10px rgba(220,20,20,0.8), 0 0 25px rgba(180,0,0,0.4); filter: brightness(1); transform: scale(1); }
  45%     { text-shadow: 0 0 8px rgba(200,10,10,0.6), 0 0 18px rgba(160,0,0,0.3); filter: brightness(0.85); transform: scale(0.98); }
  60%     { text-shadow: 0 0 6px rgba(180,0,0,0.5); filter: brightness(0.75); transform: scale(0.97); }
  65%     { text-shadow: 0 0 30px rgba(255,30,30,1), 0 0 60px rgba(220,0,0,0.9), 0 0 90px rgba(180,0,0,0.5); filter: brightness(2.0) saturate(1.8); transform: scale(1.1); }
  70%     { text-shadow: 0 0 18px rgba(255,80,80,0.9), 0 0 35px rgba(220,20,20,0.7); filter: brightness(1.4); transform: scale(1.04); }
  80%,100%{ text-shadow: 0 0 10px rgba(220,20,20,0.8), 0 0 25px rgba(180,0,0,0.4); filter: brightness(1); transform: scale(1); }
}
@keyframes human-lord-aura {
  0%,55%  { opacity: 0; }
  62%     { opacity: 0; }
  65%     { opacity: 0.9; }
  75%,100%{ opacity: 0; }
}
@keyframes human-lord-crack {
  0%,45%  { opacity: 0.15; transform: translate(0,0); }
  58%     { opacity: 0.3; transform: translate(-2px, 1px); }
  62%     { opacity: 0.05; }
  65%     { opacity: 0.8; transform: translate(3px,-2px); }
  70%     { opacity: 0; }
  100%    { opacity: 0.15; transform: translate(0,0); }
}

/* =================================================== */
/* 📱 모바일 최적화 — AKASHA / MOIRAI / LOGOS / Bond Profile */
/* =================================================== */
@media (max-width: 850px) {

  /* ── 공통: 모든 오버레이 닫기 버튼 — 손가락으로 누르기 편하게 ── */
  .ah-close-btn,
  .moirai-close-btn,
  .logos-close-btn,
  .bp-close,
  .ah-doc-close {
    top: 10px !important;
    right: 12px !important;
    font-size: 1.5rem !important;
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.65) !important;
    border-radius: 50% !important;
    width: 42px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 20 !important;
  }
  .lm-detail-close {
    top: 10px !important;
    right: 12px !important;
    font-size: 1.4rem !important;
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.65) !important;
    border-radius: 50% !important;
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 20 !important;
  }

  /* ── Bond Profile 인연 카드 ── */
  .bp-card {
    flex-direction: column !important;
    height: 92vh !important;
    width: 98vw !important;
    overflow-y: auto !important;
  }
  .bp-img-col {
    width: 100% !important;
    height: 240px !important;
    min-height: unset !important;
    flex-shrink: 0 !important;
  }
  .bp-info-col {
    padding: 20px 18px 40px !important;
    overflow: visible !important;
  }
  .bp-name { font-size: clamp(1.8rem, 6vw, 2.6rem) !important; }
  .bp-rel-bonds { grid-template-columns: repeat(2, 1fr) !important; }

  /* ── MOIRAI 오버레이 ── */
  .moirai-top-bar { padding: 12px 56px 0 16px !important; }
  .moirai-overlay-title { font-size: clamp(2rem, 7vw, 3rem) !important; }
  .moirai-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .moirai-nav-btn { font-size: 1.2rem !important; padding: 10px !important; }

  /* ── LOGOS 오버레이 ── */
  .logos-top-bar { padding: 10px 56px 0 16px !important; }
  .logos-tabs { -webkit-overflow-scrolling: touch !important; }
  .logos-tab { font-size: 0.7rem !important; padding: 6px 10px !important; min-width: 46px !important; }

  /* 요람 사건 목록 사이드바 */
  .lml-left { flex: 0 0 110px !important; padding: 8px 6px !important; }
  .lml-row { font-size: 0.7rem !important; margin-bottom: 12px !important; }
  .lml-stitle { font-size: 0.6rem !important; }

  /* LOGOS 사건 상세 패널 */
  .lm-detail-panel {
    width: min(96vw, 92vh * 1.8) !important;
    flex-direction: column !important;
  }
  .lm-detail-body {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
    overflow-y: auto !important;
  }
  .lm-detail-image-col {
    width: 100% !important; max-width: none !important; height: 200px !important;
    padding: 0 !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  }
  .lm-detail-meta {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 16px !important;
  }
  .lm-detail-content { padding: 20px 18px !important; }
  .lm-detail-title { font-size: 1.5rem !important; }
  .lm-detail-desc { font-size: 1.15rem !important; line-height: 2 !important; }

  /* LOGOS 이벤트 팝업 */
  .lm-popup { width: clamp(200px, 82vw, 300px) !important; padding: 16px 18px 14px !important; }
  .lm-popup-name { font-size: 1.2rem !important; }

  /* ── AKASHA Hub ── */
  .ah-body {
    flex-direction: column !important;
    padding: 0 14px 90px !important;
    gap: 12px !important;
    overflow-y: auto !important;
  }
  .ah-left { flex: none !important; }
  .ah-right {
    flex: none !important;
    width: 100% !important;
    flex-direction: row !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
  }
  .ah-panel { padding: 22px 14px 16px !important; flex: 1 !important; }
  .ah-sys-name { font-size: clamp(0.95rem, 3.5vw, 1.4rem) !important; }
  .ah-dashboard { min-height: 200px !important; }

  /* Records / Classified 문서 오버레이 */
  .ah-doc-header { padding: 16px 56px 12px 20px !important; }
  .ah-doc-body { padding: 16px 18px 40px !important; }
  .ahd-rec-entry { grid-template-columns: 68px 1fr auto !important; gap: 3px 10px !important; }
}

@media (max-width: 480px) {
  /* Bond Profile 초소형 화면 */
  .bp-img-col { height: 180px !important; }
  .bp-info-col { padding: 14px 12px 28px !important; }
  .bp-name { font-size: clamp(1.5rem, 6vw, 2rem) !important; }
  .bp-rel-bonds { grid-template-columns: 1fr !important; }

  /* AKASHA Hub: 초소형에서는 패널 세로 정렬 */
  .ah-right { flex-direction: column !important; }

  /* LOGOS 사이드바 더 압축 */
  .lml-left { flex: 0 0 90px !important; padding: 6px 4px !important; }
  .lml-row > span:last-child { display: none !important; }
}

/* 🌟 변환기 버튼 호버/활성화 스타일 덮어쓰기 (색상 분리 및 애니메이션 적용) */
#btnPtoV:hover:not(:disabled) {
  background: rgba(100, 200, 255, 0.25) !important;
  border-color: #88ccff !important;
  color: #fff !important;
  box-shadow: 0 0 25px rgba(100, 200, 255, 0.25), inset 0 0 10px rgba(100, 200, 255, 0.1) !important;
  transform: translateY(-3px);
}
#btnVtoP:hover:not(:disabled) {
  background: rgba(255, 100, 100, 0.25) !important;
  border-color: #ff8888 !important;
  color: #fff !important;
  box-shadow: 0 0 25px rgba(255, 100, 100, 0.25), inset 0 0 10px rgba(255, 100, 100, 0.1) !important;
  transform: translateY(-3px);
}
#btnPtoV:active:not(:disabled), #btnVtoP:active:not(:disabled) {
  transform: translateY(1px);
}
#btnPtoV:disabled, #btnVtoP:disabled {
  opacity: 0.2;
  background: transparent !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* 📱 모바일 환경에서는 변환기 패널을 상하로 나열 */
@media (max-width: 850px) {
  .exchange-panels {
    flex-direction: column !important;
    gap: 15px !important;
  }
  .exchange-panels > div {
    padding: 25px 20px !important;
  }
  .exchange-panels h4 {
    font-size: 1.25em !important;
    margin-bottom: 10px !important;
  }
  .exchange-panels button {
    padding: 16px !important;
    font-size: 1.1em !important;
  }
}

/* =================================================== */
/* 🌟 캐릭터 이미지 호버 시에만 편집/삭제 버튼 표시 */
/* =================================================== */
.status-portrait-frame .portrait-action-group {
  opacity: 0;
  pointer-events: none; /* 보이지 않을 때는 클릭 방지 */
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(-8px); /* 위에서 아래로 살짝 내려오는 애니메이션 */
  z-index: 20; /* 버튼이 이미지 라벨보다 확실히 위에 오도록 설정 */
}

/* 액자에 마우스를 올렸을 때, 이미지가 등록된 상태(hidden이 아닐 때)만 버튼 노출 */
.status-portrait-frame:hover .portrait-action-group:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* 🌟 재화 변환기: 되돌리기 버튼 효과 */
#btnPtoV_undo:hover:not(:disabled) {
  background: rgba(100, 200, 255, 0.1) !important;
  border-color: #88ccff !important;
  color: #fff !important;
}
#btnVtoP_undo:hover:not(:disabled) {
  background: rgba(255, 100, 100, 0.1) !important;
  border-color: #ff8888 !important;
  color: #fff !important;
}
#btnPtoV_undo:disabled, #btnVtoP_undo:disabled {
  opacity: 0.2;
  cursor: not-allowed !important;
}

/* ===================== 요툰 (욤 오마주) ===================== */
.effect-ashengiant {
  position: relative;
  display: inline-block;
  color: #ff4d00;
  text-shadow: 0 0 10px #ff0000, 0 0 20px #800000;
  animation: ashen-ember 3s infinite alternate ease-in-out;
}
.effect-ashengiant::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  color: transparent;
  z-index: -1;
  text-shadow: 0 0 5px #000;
  -webkit-text-stroke: 1px #ff6600;
  pointer-events: none;
  animation: ashen-dust 4s infinite linear;
}
@keyframes ashen-ember {
  0% { filter: brightness(1) contrast(1); text-shadow: 0 0 5px #ff4d00, 0 0 10px #800000; }
  100% { filter: brightness(1.5) contrast(1.2); text-shadow: 0 0 15px #ffaa00, 0 0 30px #ff0000, 0 0 45px #cc0000; }
}
@keyframes ashen-dust {
  0% { transform: translateY(0) scale(1); opacity: 0.8; filter: blur(2px); }
  50% { transform: translateY(-4px) scale(1.02); opacity: 0.4; filter: blur(4px); }
  100% { transform: translateY(-8px) scale(1.05); opacity: 0; filter: blur(6px); }
}

/* ===================== 위대한 자 (블러드본 오마주) ===================== */
.effect-greatone {
  position: relative;
  display: inline-block;
  color: #d4a6ff;
  text-shadow: 0 0 15px rgba(212, 166, 255, 0.8);
  animation: greatone-pulse 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
.effect-greatone::before, .effect-greatone::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.6;
  mix-blend-mode: screen;
}
.effect-greatone::before {
  color: transparent;
  -webkit-text-stroke: 1px #66ccff;
  transform-origin: center;
  animation: greatone-glitch 2s infinite alternate-reverse;
}
.effect-greatone::after {
  color: transparent;
  -webkit-text-stroke: 1px #ff66cc;
  transform-origin: center;
  animation: greatone-glitch 2.5s infinite alternate;
}
@keyframes greatone-pulse {
  0%, 100% { transform: scale(1); filter: hue-rotate(0deg) brightness(1); }
  50% { transform: scale(1.05); filter: hue-rotate(30deg) brightness(1.3); text-shadow: 0 0 25px rgba(255, 255, 255, 0.9); }
}
@keyframes greatone-glitch {
  0% { transform: translate(0, 0) skew(0deg); filter: blur(0); }
  20% { transform: translate(-2px, 1px) skewX(2deg); filter: blur(1px); }
  40% { transform: translate(2px, -1px) skewX(-2deg); filter: blur(0); }
  60% { transform: translate(-1px, 2px) skewY(1deg); filter: blur(1px); }
  80% { transform: translate(1px, -2px) skewY(-1deg); filter: blur(0); }
  100% { transform: translate(0, 0) skew(0deg); filter: blur(2px); }
}

/* ===================== 베히모스 (대지를 걷는 요새) ===================== */
.effect-behemoth {
  position: relative;
  display: inline-block;
  color: #c69463;
  text-shadow: 1px 1px 0 #2b1c10, 2px 2px 0 #1a1108, 0 0 8px rgba(180, 120, 60, 0.5);
  animation: behemoth-tremor 4s infinite;
}

.effect-behemoth::before {
  content: "";
  position: absolute;
  top: -40%; left: -10%;
  width: 120%; height: 180%;
  z-index: 2;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M10,0 L25,30 L15,45 L35,60 L28,100' stroke='%232b1c10' stroke-width='3' fill='none'/%3E%3Cpath d='M90,5 L75,35 L88,55 L70,75 L78,100' stroke='%231a1108' stroke-width='2.5' fill='none'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  opacity: 0;
  animation: behemoth-crack 4s infinite;
}

.effect-behemoth::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  z-index: -1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(150, 100, 50, 0.7);
  pointer-events: none;
  opacity: 0;
  animation: behemoth-dust 4s infinite;
}

@keyframes behemoth-tremor {
  0%, 88% { transform: translate(0, 0); filter: brightness(1); }
  89% { transform: translate(-2px, 1px); filter: brightness(1.15); }
  90% { transform: translate(3px, -1px); filter: brightness(0.9); }
  91% { transform: translate(-3px, 2px); filter: brightness(1.3); text-shadow: 1px 1px 0 #2b1c10, 0 0 18px rgba(220, 150, 70, 0.8); }
  92% { transform: translate(2px, -2px); filter: brightness(0.95); }
  94%, 100% { transform: translate(0, 0); filter: brightness(1); }
}

@keyframes behemoth-crack {
  0%, 88% { opacity: 0; transform: scale(1); }
  90% { opacity: 0.9; transform: scale(1.02); filter: drop-shadow(0 0 4px rgba(0,0,0,0.6)); }
  93% { opacity: 0; transform: scale(1.04); }
  100% { opacity: 0; }
}

@keyframes behemoth-dust {
  0%, 88% { opacity: 0; transform: translateY(0) scale(1); }
  90% { opacity: 0.5; transform: translateY(2px) scale(1.01); }
  95% { opacity: 0; transform: translateY(10px) scale(1.06); filter: blur(3px); }
  100% { opacity: 0; }
}

/* ===================== 레비아탄 (심연을 삼키는 자) ===================== */
.effect-leviathan {
  position: relative;
  display: inline-block;
  isolation: isolate;
  color: #5fb8c9;
  text-shadow: 0 0 8px rgba(40, 160, 190, 0.7), 0 0 18px rgba(10, 60, 90, 0.6);
  animation: leviathan-pressure 5s infinite ease-in-out;
}

.effect-leviathan::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  z-index: -1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(40, 170, 200, 0.55);
  pointer-events: none;
  filter: blur(2px);
  animation: leviathan-ripple 5s infinite ease-in-out;
}

.effect-leviathan::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  z-index: 1;
  color: #d2faff;
  pointer-events: none;
  opacity: 0;
  clip-path: inset(40% 0 40% 0);
  animation: leviathan-glow 5s infinite ease-in-out;
}

@keyframes leviathan-pressure {
  0%, 100% { transform: scaleY(1) skewX(0deg); filter: brightness(1); }
  25% { transform: scaleY(0.97) skewX(-1deg); filter: brightness(0.9); }
  50% { transform: scaleY(1.03) skewX(0.5deg); filter: brightness(1.1); text-shadow: 0 0 14px rgba(60, 200, 220, 0.9), 0 0 28px rgba(10, 80, 110, 0.7); }
  75% { transform: scaleY(0.98) skewX(-0.5deg); filter: brightness(0.95); }
}

@keyframes leviathan-ripple {
  0%, 100% { transform: translate(0, 0); opacity: 0.5; }
  30% { transform: translate(2px, 1px) scaleX(1.01); opacity: 0.3; }
  50% { transform: translate(-3px, 2px) scaleX(0.99); opacity: 0.6; }
  70% { transform: translate(2px, -1px); opacity: 0.35; }
}

@keyframes leviathan-glow {
  0%, 60%, 100% { opacity: 0; clip-path: inset(40% 0 40% 0); }
  65% { opacity: 0.8; clip-path: inset(10% 0 70% 0); text-shadow: 0 0 16px #aef6ff; }
  70% { opacity: 0; clip-path: inset(70% 0 10% 0); }
}

/* ===================== 바하무트 (멸망을 선포하는 용) ===================== */
.effect-bahamut {
  position: relative;
  display: inline-block;
  isolation: isolate;
  color: #ffd27a;
  text-shadow: 0 0 8px #ff9933, 0 0 16px #ffcc55;
  animation: bahamut-flame 2.6s infinite ease-in-out;
}

.effect-bahamut::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  z-index: -1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 160, 40, 0.6);
  pointer-events: none;
  animation: bahamut-wisp 2.6s infinite ease-in-out;
}

.effect-bahamut::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  z-index: 2;
  color: #ffffff;
  pointer-events: none;
  opacity: 0;
  animation: bahamut-judgment 5.2s infinite;
}

@keyframes bahamut-flame {
  0%, 100% { filter: brightness(1); transform: translateY(0); }
  20% { filter: brightness(1.15); transform: translateY(-1px); }
  40% { filter: brightness(0.95); transform: translateY(0px); }
  60% { filter: brightness(1.25); text-shadow: 0 0 12px #ffaa33, 0 0 24px #ffdd66; transform: translateY(-1px); }
  80% { filter: brightness(1.05); }
}

@keyframes bahamut-wisp {
  0%, 100% { opacity: 0.4; transform: translateY(0) scale(1); }
  50% { opacity: 0.7; transform: translateY(-4px) scale(1.02); filter: blur(1px); }
}

@keyframes bahamut-judgment {
  0%, 92% { opacity: 0; transform: scale(1); filter: brightness(1); }
  94% { opacity: 0.9; transform: scale(1.04); filter: brightness(1.8) drop-shadow(0 0 20px #fff5cc); text-shadow: 0 0 25px #ffffff, 0 0 45px #ffcc66; }
  97% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 0; }
}

/* 🌟 위대한 자 - [계몽] 스탯 변질 흑백/RGB 글리치 이펙트 */
.glitch-enlightenment {
  position: relative;
  display: inline-block;
  width: max-content; /* 🌟 텍스트 크기에 딱 맞추어 길게 늘어나는 띠 차단 */
  white-space: nowrap; /* 🌟 줄바꿈 방지 */
  color: #ffffff !important;
  font-weight: 900 !important;
  letter-spacing: 0.15em;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6) !important;
  animation: rgb-glitch-base 2.5s infinite linear;
}

/* 글씨가 여러 갈래로 찢어지게 만들기 위한 가상 레이어 생성 */
.glitch-enlightenment::before,
.glitch-enlightenment::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%; /* 부모(max-content) 크기를 정확히 따라감 */
  height: 100%;
  background: transparent; /* 🌟 오른쪽으로 뻗치던 검은색 배경 삭제 */
  color: #ffffff;
  overflow: hidden;
  pointer-events: none;
}

/* 붉은색과 초록색 잔상을 남기며 날카롭게 찢어지는 효과 (TV 치지직) */
.glitch-enlightenment::before {
  text-shadow: -2.5px 0 #ff0000, 2.5px 0 #00ff00;
  animation: tv-glitch-anim-1 2.5s infinite linear;
  z-index: 2;
}

/* 파란색과 자주색 잔상을 남기며 날카롭게 찢어지는 효과 (TV 치지직) */
.glitch-enlightenment::after {
  text-shadow: -2.5px 0 #0000ff, 2.5px 0 #ff00ff;
  animation: tv-glitch-anim-2 3s infinite linear;
  z-index: 1;
}

/* 본체 베이스 텍스트의 불규칙한 뒤틀림 */
@keyframes rgb-glitch-base {
  0%, 100% { transform: skewX(0deg); opacity: 1; filter: none; }
  10%, 12% { transform: skewX(0deg); opacity: 1; filter: none; }
  11% { transform: skewX(-15deg) translate(-2px, 0); filter: invert(0.2); }
  55%, 57% { transform: translate(0, 0); }
  56% { transform: translate(2px, -1px); }
  80%, 82% { transform: skewX(0deg); }
  81% { transform: skewX(10deg); }
}

/* 가상 레이어 1: 순식간에 나타나고 쪼개지며 번쩍임 */
@keyframes tv-glitch-anim-1 {
  0%, 9% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  10% { opacity: 1; clip-path: inset(10% 0 70% 0); transform: translate(-4px, 0); }
  12% { opacity: 1; clip-path: inset(80% 0 5% 0); transform: translate(4px, 0); }
  14%, 35% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  36% { opacity: 1; clip-path: inset(30% 0 50% 0); transform: translate(-3px, 0); }
  38% { opacity: 1; clip-path: inset(60% 0 10% 0); transform: translate(5px, 0); }
  40%, 75% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  76% { opacity: 1; clip-path: inset(20% 0 50% 0); transform: translate(-5px, 0); }
  78%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
}

/* 가상 레이어 2: 타이밍을 다르게 주어 엇갈려 치지직거리게 유도 */
@keyframes tv-glitch-anim-2 {
  0%, 19% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  20% { opacity: 1; clip-path: inset(20% 0 50% 0); transform: translate(5px, 0); }
  22% { opacity: 1; clip-path: inset(70% 0 10% 0); transform: translate(-4px, 0); }
  24%, 55% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  56% { opacity: 1; clip-path: inset(40% 0 30% 0); transform: translate(3px, 0); }
  58% { opacity: 1; clip-path: inset(10% 0 80% 0); transform: translate(-5px, 0); }
  60%, 85% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  86% { opacity: 1; clip-path: inset(50% 0 20% 0); transform: translate(4px, 0); }
  88%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
}

/* 🌟 위대한 자: 스탯창의 숫자 999 대체 스팬 기본 스타일 */
.glitch-num-span {
  display: inline-block;
  width: 62px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  font-size: 1.15em;
  font-family: monospace;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}
.glitch-num-span.hidden {
  display: none !important;
}

/* 🌟 위대한 자: 스탯창의 숫자 999 단독 텍스트 (시스템 에러 스타일의 디지털 폰트) */
.glitch-enlightenment-num {
  position: relative;
  display: flex;
  justify-content: center; 
  align-items: center; 
  
  width: 146px; 
  height: 32px;
  margin: 0;
  padding-top: 2px;
  
  font-size: 1.25em; /* 간격이 좁아져 답답해 보일 수 있으므로 글자 크기를 아주 살짝 더 키움 */
  font-family: 'Courier New', Consolas, 'Lucida Console', monospace; 
  font-weight: 400 !important; 
  color: transparent !important; 
  background: transparent !important;
  border: none !important;
  box-sizing: border-box;
  white-space: nowrap;
  letter-spacing: 0.05em; /* 🌟 글자 사이 간격을 좁게 조절 */
}

.glitch-enlightenment-num.hidden {
  display: none !important;
}

/* Base 텍스트 (메인 화이트 텍스트 영역 + 무채색 떨림) */
.glitch-enlightenment-num::before {
  content: "38927"; /* 🌟 숫자가 80%를 차지하는 문자열 조합 */
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  display: flex; justify-content: center; align-items: center;
  padding-top: 2px; 
  color: #ffffff;
  pointer-events: none;
  animation: monochrome-glitch-main 0.3s infinite linear;
}

/* 찢어지는 가로 잔상 (흑백 잔상 + 가로 클리핑) */
.glitch-enlightenment-num::after {
  content: "38927";
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  display: flex; justify-content: center; align-items: center;
  padding-top: 2px; 
  color: transparent;
  pointer-events: none;
  mix-blend-mode: screen; 
  animation: monochrome-glitch-slice 0.3s infinite linear;
}

/* 본체 문자열 변경 및 배경 떨림 (색상 완전히 흑백으로) */
@keyframes monochrome-glitch-main {
  0% { content: "38927"; text-shadow: 0 0 8px rgba(255,255,255,0.8); transform: translate(0, 0); }
  16% { content: "7X419"; text-shadow: -2px 0 #555, 2px 0 #aaa; transform: translate(-1px, 0); }
  33% { content: "08234"; text-shadow: 0 0 8px rgba(255,255,255,0.8); transform: translate(1px, 0); }
  50% { content: "91$04"; text-shadow: 2px 0 #888, -2px 0 #ccc; transform: translate(-1px, 0); }
  66% { content: "28401"; text-shadow: 0 0 8px rgba(255,255,255,0.8); transform: translate(1px, 0); }
  83% { content: "561M3"; text-shadow: -3px 0 #aaa, 3px 0 #555; transform: translate(-1px, 0); }
  100% { content: "19830"; text-shadow: 0 0 8px rgba(255,255,255,0.8); transform: translate(0, 0); }
}

/* 가로로 얇게 잘라 좌우로 어긋나게 찢기 (흑백/회색 잔상) */
@keyframes monochrome-glitch-slice {
  0% { content: "38927"; clip-path: inset(10% 0 70% 0); transform: translate(-6px, 0); text-shadow: -4px 0 #888, 4px 0 #ccc, 0 0 5px #fff; }
  16% { content: "7X419"; clip-path: inset(60% 0 10% 0); transform: translate(7px, 0); text-shadow: 4px 0 #ccc, -4px 0 #555, 0 0 5px #fff; }
  33% { content: "08234"; clip-path: inset(30% 0 50% 0); transform: translate(-5px, 0); text-shadow: -3px 0 #aaa, 3px 0 #888, 0 0 5px #fff; }
  50% { content: "91$04"; clip-path: inset(80% 0 5% 0); transform: translate(8px, 0); text-shadow: 3px 0 #666, -3px 0 #ddd, 0 0 5px #fff; }
  66% { content: "28401"; clip-path: inset(20% 0 60% 0); transform: translate(-6px, 0); text-shadow: -4px 0 #999, 2px 0 #bbb, 0 0 5px #fff; }
  83% { content: "561M3"; clip-path: inset(50% 0 30% 0); transform: translate(6px, 0); text-shadow: 2px 0 #ccc, -4px 0 #777, 0 0 5px #fff; }
  100% { content: "19830"; clip-path: inset(15% 0 75% 0); transform: translate(-4px, 0); text-shadow: -3px 0 #aaa, 4px 0 #eee, 0 0 5px #fff; }
}

/* ===================================================
   원소 선택 그리드 버튼
=================================================== */
.element-grid-btns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto 50px auto;
}
@media (max-width: 700px) {
  .element-grid-btns { grid-template-columns: repeat(2, 1fr); }
}
.element-grid-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 12px 18px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e0e0e0;
  cursor: pointer;
  font-family: 'HeirofLight', 'Noto Serif KR', serif;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  overflow: hidden;
}
.element-grid-btn img {
  display: none;
}
.element-grid-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-3px);
}
.elem-icon   { font-size: 1.8em; text-shadow: 0 0 10px currentColor; }
.elem-name   { font-size: 1.4em; font-weight: bold; letter-spacing: 0.05em; font-family: "HeirofLight", "Noto Serif KR", serif !important; }
.elem-sub    { font-size: 0.95em; color: #777; letter-spacing: 0.08em; font-family: "HeirofLight", "Noto Serif KR", serif !important; }
.elem-picked-count {
  font-size: 0.78em;
  color: #ffda66;
  min-height: 1em;
  letter-spacing: 0.04em;
}

/* ===================================================
   원소 마법 모달 전용 레이아웃 및 1:1 이미지 처리
=================================================== */
/* 🌟 모달 컨테이너 100% 꽉 채우기 오버라이드 */
.element-modal-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  padding: 0 !important;
}

.element-modal-wrap {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}

.element-modal-card {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  border-radius: 0 !important;
  padding: 60px 4vw !important;
  flex-direction: row !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

/* 🌟 좌측 원소 타이틀 고정 영역 */
.element-modal-header-side {
  flex: 0 0 250px; /* 좌측 영역 너비도 약간 축소 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px dashed rgba(255,255,255,0.15);
  padding-right: 40px;
}
.element-modal-icon-disp {
  font-size: 4em; /* 🌟 아이콘 크기 대폭 축소 */
  margin-bottom: 15px;
  line-height: 1;
  text-shadow: 0 0 15px currentColor;
}
.element-modal-title-disp {
  margin-bottom: 15px !important;
  padding-bottom: 15px !important; /* 🌟 선과 글자 사이의 간격 추가 */
  border: none !important;
  font-size: 1.8em !important; /* 🌟 타이틀 텍스트 크기 대폭 축소 */
  text-align: center;
  width: 100%;
  position: relative; /* 가로선 덮어쓰기를 위한 설정 */
}

/* 🌟 글자 밑의 길게 튀어나오던 그라데이션 선의 길이를 짧고 얇게 강제 수정 */
.element-modal-title-disp::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px !important; /* 🌟 가로선 길이 대폭 축소 */
  height: 1px !important; /* 🌟 가로선 두께 얇게 조절 */
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.6;
}

.element-modal-sub-disp {
  color: #aaa;
  font-style: italic;
  font-size: 0.9em; 
  margin: 0;
  text-align: center;
  word-break: keep-all;
  line-height: 1.5;
}

/* 🌟 우측 리스트 컨테이너 */
.element-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 30px 40px 40px !important;
  margin: 0 !important;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 40px; 
}

/* 좌측 서클 라벨, 우측 4열 카드 분할 */
.element-tier-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 30px;
  padding-bottom: 35px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.element-tier-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.element-tier-label {
  flex: 0 0 80px; 
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid rgba(255,255,255,0.1);
  padding-right: 20px;
}

.element-tier-label span {
  font-family: "Georgia", "HeirofLight", "Noto Serif KR", serif;
  font-size: 1.3em; /* 서클 글자 크기도 아주 약간 축소하여 밸런스 맞춤 */
  font-weight: bold;
  color: #e8e8e8; /* 🌟 서클 텍스트 색상을 탁한 회색에서 밝고 깔끔한 은백색으로 변경 */
  letter-spacing: 0.08em;
  writing-mode: horizontal-tb; 
  text-align: center;
  text-shadow: 0 0 10px rgba(0,0,0,0.9);
  word-break: keep-all; 
}

.element-tier-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr) !important; /* 🌟 완벽한 4열 그리드 */
  gap: 15px;
}

/* 🌟 모달 내 마법 버튼 크기 및 1:1 이미지 비율 강제 고정 */
.element-tier-grid button.choice {
  width: 100% !important;
  max-width: none !important;
  min-height: auto !important;
  padding: 18px 14px 22px 14px !important; /* 버튼 내부 여백 축소 */
  justify-content: flex-start !important;
}

/* 카드 내부 제목 글자 크기 축소 */
.element-tier-grid button.choice .choiceTitle {
  font-size: 1em !important; 
  margin-bottom: 8px !important;
}

/* 카드 내부 설명 글자 크기 축소 */
.element-tier-grid button.choice .choiceComment {
  font-size: 0.85em !important; 
  line-height: 1.5 !important;
}

.element-tier-grid .choiceImage {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important; /* 🌟 이미지가 찌그러지지 않고 정사각형 유지 */
  object-fit: cover !important;
  border-radius: 8px !important;
  margin-bottom: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 15px rgba(0,0,0,0.6);
}

/* 📱 모바일 및 태블릿 반응형 (1100px 이하) */
@media (max-width: 1100px) {
  .element-modal-card {
    flex-direction: column !important;
    padding: 60px 20px !important;
  }
  .element-modal-header-side {
    flex: none !important;
    border-right: none !important;
    border-bottom: 1px dashed rgba(255,255,255,0.15) !important;
    padding-right: 0 !important;
    padding-bottom: 30px !important;
    margin-bottom: 20px !important;
  }
  .element-list-container {
    padding: 10px 10px 40px 10px !important;
  }
  .element-tier-row {
    flex-direction: column;
    gap: 15px;
  }
  .element-tier-label {
    flex: none;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-right: 0;
    padding-bottom: 10px;
    justify-content: flex-start;
  }
  .element-tier-label span {
    writing-mode: horizontal-tb; /* 모바일에서는 가로로 눕힘 */
    letter-spacing: 0.1em;
    font-size: 1.4em;
  }
  .element-tier-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* 태블릿 2열 */
  }
}
@media (max-width: 600px) {
  .element-tier-grid {
    grid-template-columns: 1fr !important; /* 폰에서는 1열 */
  }
}

/* 🌟 세력 리스트 버튼 전용 스타일 (정렬 문제 및 호버 어두워짐 효과) */
button.faction-list-btn {
  display: flex !important;
  flex-direction: row !important; /* 텍스트와 화살표를 가로로 나란히 배치 */
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  transform: none !important;
  padding: 24px 40px !important;
  min-height: auto !important;
  height: auto !important;
  transition: background 0.2s ease, text-shadow 0.2s ease !important;
}

/* 마우스 호버 시 배경을 어둡게 처리하여 선택 가능함을 직관적으로 표시 */
button.faction-list-btn:hover {
  background: rgba(0, 0, 0, 0.4) !important;
}

/* 선택된(체크된) 세력 리스트는 약간 밝은 회색 테두리와 배경 유지 */
button.faction-list-btn.faction-selected {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* 세력 이름 타이틀 디자인 */
button.faction-list-btn .faction-row-name {
  text-align: center !important;
  font-size: 1.4em !important;
  font-weight: bold !important;
  letter-spacing: 0.05em !important;
  flex: 1 !important; /* 텍스트가 중앙에 위치하도록 여백을 밀어냄 */
  margin: 0 !important;
}

/* 우측 화살표 디자인 */
button.faction-list-btn .faction-row-chevron {
  font-size: 1.2em !important;
  color: rgba(255, 255, 255, 0.3) !important;
  flex-shrink: 0 !important;
  transition: color 0.2s ease, transform 0.2s ease !important;
}

/* 호버 시 우측 화살표가 하얗게 빛나며 약간 이동함 */
button.faction-list-btn:hover .faction-row-chevron {
  color: #fff !important;
  transform: translateX(5px) !important;
}

/* === Class Renewal & New Carousel UI === */
:root {
  --panel2: #1a1814;
  --gold2:  #f0d080;
  --muted:  #7a6e58;
}

.class-header { text-align: center; margin-bottom: 36px; }
.header-rune  {
  background: none; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: rgba(180, 150, 60, 0.35); margin-bottom: 8px; width: 44px; height: 44px; border-radius: 999px; transition: 0.3s;
}
.header-rune.active, .header-rune.has-unlocked { color: var(--gold2); text-shadow: 0 0 18px rgba(240, 208, 128, .85), 0 0 36px rgba(240, 208, 128, .4); }
.header-rune.has-unlocked { animation: header-rune-pulse 2s ease-in-out infinite; }
@keyframes header-rune-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); text-shadow: 0 0 25px var(--gold2); } }

.carousel-wrap { display: flex; align-items: center; gap: 16px; margin: 40px auto 0; max-width: 1400px; }
.carousel-arrow {
  background: none; border: 1px solid #2e2820; color: var(--muted); font-size: 2rem; width: 44px; height: 100px; border-radius: 8px; cursor: pointer; flex-shrink: 0; transition: color .2s, border-color .2s; outline: none;
}
.carousel-arrow:hover { color: #c9a84c; border-color: #c9a84c; transform: none; }
.carousel-stage { flex: 1; display: flex; align-items: center; gap: 14px; overflow: hidden; }

/* 양옆 카드 */
.card-side {
  flex: 0 0 220px; background: rgba(17,16,15,0.8); border: 1px solid #2e2820; border-radius: 10px; padding: 28px 20px; cursor: pointer; opacity: .4; transition: opacity .2s, border-color .2s; overflow: hidden; text-align: left;
}
.card-side:hover { opacity: .7; }
.side-card-title { font-family: var(--font-kr); font-size: 1.15rem; margin-bottom: 8px; }
.side-card-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.5; overflow: hidden; max-height: 4.5em; word-break: keep-all; }

/* 중앙 카드 */
.card-active {
  position: relative; overflow: hidden; flex: 1; min-width: 0; background: rgba(17,16,15,0.95); border: 1px solid #c9a84c; border-radius: 10px; cursor: default; transition: border-color .3s, box-shadow .3s; padding: 0;
}
.card-active-inner { padding: 48px 40px; position: relative; z-index: 3; }
.card-tier { font-family: "HeirofLight", "Noto Serif KR", serif !important; font-size: 0.9rem; color: var(--muted); letter-spacing: .15em; margin-bottom: 8px; font-weight: bold; }
.card-title { font-family: "HeirofLight", "Noto Serif KR", serif !important; font-weight: bold; font-size: 3.2rem; color: var(--gold2); margin: 0 0 12px 0; text-shadow: 0 0 20px rgba(201,168,76,.3); }
.card-desc { font-size: 1.15rem; color: var(--muted); line-height: 1.7; min-height: 80px; margin-bottom: 28px; word-break: keep-all; }
.btn-open-modal {
  display: inline-block; background: none; border: 1px solid #c9a84c; color: #c9a84c; font-family: 'HeirofLight', 'Noto Serif KR', serif; font-size: 1.05rem; padding: 12px 26px; border-radius: 6px; cursor: pointer; letter-spacing: .1em; transition: background .2s, color .2s; outline: none;
}
.btn-open-modal:hover { background: rgba(201,168,76,.12); }

@keyframes active-from-right { from { opacity:0; transform: translateX(60px); } to { opacity:1; transform: translateX(0); } }
@keyframes active-from-left { from { opacity:0; transform: translateX(-60px); } to { opacity:1; transform: translateX(0); } }

/* ===== 모달창 UI ===== */
.modal { position: fixed; inset: 0; z-index: 2147483647; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .25s; pointer-events: none; }
.modal.show { opacity: 1; pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(4px); }
.modal-shell {
  position: relative; z-index: 1; background: #11100f; width: 100vw; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
}

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid #2e2820; flex-shrink: 0; }
.modal-title-wrap { display: flex; align-items: center; gap: 10px; font-family: var(--font-kr); font-size: 1rem; color: var(--gold2); }
.modal-rune { color: #c9a84c; font-size: 1.2em; }
.modal-title-sep { color: #2e2820; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; padding: 4px 8px; transition: color .2s; outline: none; }
.modal-close:hover { color: #c9a84c; transform: scale(1.1); }

.modal-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px 1fr; }
.modal-left { border-right: 1px solid #2e2820; padding: 20px 14px; overflow-y: auto; background: rgba(0,0,0,0.2); }
.tree-label { font-size: 0.85rem; color: var(--muted); letter-spacing: .12em; margin-bottom: 18px; font-weight: bold; text-align: center; border-bottom: 1px solid #2e2820; padding-bottom: 10px; }
.tree-list { display: flex; flex-direction: column; gap: 6px; }
.tree-item {
  padding: 10px 12px; border-radius: 7px; border: 1px solid transparent; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .15s, border-color .15s; color: var(--muted); font-size: 1rem;
}
.tree-item.tier-2 { margin-left: 16px; }
.tree-item.tier-3 { margin-left: 32px; }
.tree-item:hover { background: rgba(201,168,76,.08); color: #e0d4c0; }
.tree-item.selected { border-color: var(--item-color, #c9a84c); color: var(--item-color, #c9a84c); background: rgba(201,168,76,.06); font-weight: bold; }
.tree-item.unlocked { color: var(--item-color, #c9a84c); }
.tree-item.locked { opacity: .4; pointer-events: none; }
.tree-tier { font-size: 0.75rem; color: var(--muted); background: var(--panel2); border-radius: 4px; padding: 2px 6px; flex-shrink: 0; }

/* 🌟 우측 모달 레이아웃 정돈 */
.modal-right { padding: 30px 40px; overflow-y: auto; display: flex; flex-direction: column; position: relative; } 
#classDetailWrap { display: flex; flex-direction: column; gap: 15px; width: 100%; height: 100%; } /* 🌟 박스들 사이의 간격을 확실하게 띄워줌 */
.detail-empty { color: var(--muted); font-size: 1.05rem; margin: auto; text-align: center; }

/* 헤더 타이틀 중앙 정렬 */
.detail-header { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 10px; }
.detail-tier-badge { display: inline-block; font-size: 0.85rem; letter-spacing: .1em; color: var(--muted); background: var(--panel2); border-radius: 4px; padding: 4px 10px; font-weight: bold; }
.detail-name { font-family: var(--font-kr); font-weight: 600; font-size: 2.2rem; color: var(--item-color, var(--gold2)); text-shadow: 0 0 20px color-mix(in srgb, var(--item-color, #c9a84c) 40%, transparent); margin: 0; }
.detail-desc { font-size: 1.05rem; color: #ccc; line-height: 1.75; word-break: keep-all; margin: 0; max-width: 800px; }

.req-badge-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 5px 0; }
.req-badge-wrap span { font-size: 0.8rem; padding: 4px 12px; border-radius: 20px; border: 1px solid; background: rgba(0,0,0,0.5); }
.reqStat { border-color: #c9a84c; color: #c9a84c; }
.reqCond { border-color: #88aaff; color: #88aaff; }

/* 해금 섹션 박스 중앙 정렬 및 디자인 수정 */
.unlock-section { background: rgba(20, 18, 15, 0.8); border: 1px solid #2e2820; border-radius: 10px; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 15px; text-align: center; max-width: 900px; margin: 0 auto; width: 100%; }
.unlock-msg { font-size: 0.95rem; color: var(--muted); line-height: 1.6; margin: 0; }
.unlock-msg strong { color: #e0d4c0; }
.btn-unlock { background: none; border: 1px solid var(--item-color, #c9a84c); color: var(--item-color, #c9a84c); font-family: 'HeirofLight', 'Noto Serif KR', serif; font-size: 1rem; font-weight: bold; padding: 10px 30px; border-radius: 6px; cursor: pointer; transition: all .2s ease; outline: none; }
.btn-unlock:hover:not(:disabled) { background: var(--item-color, #c9a84c); color: #000; box-shadow: 0 0 15px var(--item-color, #c9a84c); }
.btn-unlock:disabled { opacity: .4; cursor: not-allowed; }
.btn-unlock.refund-mode { border-color: #ff8888; color: #ff8888; }
.unlock-section.refund-mode { border-color: rgba(255,136,136,.3); background: rgba(50, 0, 0, 0.2); }
.btn-unlock.refund-mode:hover:not(:disabled) { background: #ff8888; color: #000; box-shadow: 0 0 15px #ff8888; }

/* 🌟 성흔 컨버터 박스를 깔끔한 가로바로 변경 */
.converter-area { background: rgba(0,0,0,0.4); border: 1px solid #2e2820; border-radius: 8px; padding: 12px 24px; display: flex; flex-direction: row; justify-content: space-between; align-items: center; max-width: 900px; margin: 0 auto; width: 100%; }
.converter-row { display: flex; align-items: center; gap: 15px; }
.stigma-name-label { font-size: 1rem; color: var(--item-color, #c9a84c); font-weight: bold; }
.stigma-limit { font-size: 0.9rem; color: #ffcc66; font-weight: bold; margin-left: 10px; border-left: 1px solid #444; padding-left: 15px; }
.coin-label { font-size: 0.95rem; color: var(--muted); }
.coin-val { font-family: 'Cinzel', serif; font-size: 1.5rem; color: var(--item-color, var(--gold2)); min-width: 24px; font-weight: bold; }
.btn-sm { font-family: 'HeirofLight', 'Noto Serif KR', serif; font-size: 0.9rem; font-weight: bold; padding: 8px 16px; border-radius: 5px; cursor: pointer; border: 1px solid; background: none; transition: background .15s; outline: none; }
.btn-sm:disabled { opacity: .35; cursor: not-allowed; }
.btn-extract { border-color: #c9a84c; color: #c9a84c; }
.btn-extract:hover:not(:disabled) { background: rgba(201,168,76,.1); }
.btn-refund { border-color: #ff8888; color: #ff8888; }
.btn-refund:hover:not(:disabled) { background: rgba(255,136,136,.1); }

/* 🌟 성흔 캔버스 및 클릭 버그 수정 */
.stigma-section { flex: 1; display: flex; flex-direction: column; min-height: 700px; max-width: 1100px; margin: 0 auto; width: 100%; } 
.stigma-tree-container { position: relative; overflow: hidden; flex: 1; border: 1px solid #2e2820; border-radius: 10px; background: rgba(10, 8, 5, 0.8); padding: 0; box-shadow: inset 0 0 50px rgba(0,0,0,1); }
.hc-stigma-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; z-index: 50; pointer-events: auto !important; } /* 🌟 캔버스 Z-index 초강화 및 클릭 판정 강제 활성화 */
.stigma-tree { display: none; } 

/* 팝업 UI */
.stigma-popup-detail { position: absolute; background: rgba(17,16,15,0.95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--item-color, #c9a84c); border-radius: 10px; padding: 16px 20px; width: 260px; z-index: 100; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,1); transition: opacity .15s; pointer-events: none; }
.stigma-popup-detail.hidden { display: none !important; }
.stigma-popup-detail.show { opacity: 1; pointer-events: auto; }
.popup-name { font-family: var(--font-kr); font-size: 1.15rem; color: var(--item-color, var(--gold2)); font-weight: bold; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px; }
.popup-cost { font-size: 0.85rem; color: #ffcc66; font-weight: bold; }
.popup-desc { font-size: 0.95rem; color: #e0d4c0; line-height: 1.6; word-break: keep-all; }
.btn-stigma-action { background: rgba(255,255,255,0.05); border: 1px solid var(--item-color, #c9a84c); color: var(--item-color, #c9a84c); font-family: 'HeirofLight', 'Noto Serif KR', serif; font-weight: bold; font-size: 0.95rem; padding: 10px 0; border-radius: 5px; cursor: pointer; width: 100%; transition: all .2s; outline: none; margin-top: 5px; }
.btn-stigma-action:hover:not(:disabled) { background: var(--item-color, #c9a84c); color: #000; box-shadow: 0 0 10px var(--item-color, #c9a84c); }
.btn-stigma-action:disabled { opacity: .4; cursor: not-allowed; }
.btn-stigma-action.refund-mode { background: rgba(255,50,50,0.1); border-color: #ff8888; color: #ff8888; }
.btn-stigma-action.refund-mode:hover:not(:disabled) { background: #ff8888; color: #000; box-shadow: 0 0 10px #ff8888; }

/* ===== 히든 클래스 모달/연출 ===== */
.hidden-reveal { position: fixed; inset: 0; z-index: 2147483647; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .6s; pointer-events: none; }
.hidden-reveal.show { opacity: 1; pointer-events: all; }
.hc-backdrop { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,.85) 0%, rgba(0,0,0,.97) 100%); backdrop-filter: blur(8px); }
.hc-shell { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; animation: hc-emerge 0.4s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes hc-emerge { from { transform: translateY(24px) scale(.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.hc-rune { font-size: 4rem; animation: hc-pulse 2.5s ease-in-out infinite; }
@keyframes hc-pulse { 0%,100% { text-shadow: 0 0 20px currentColor, 0 0 60px currentColor; transform: scale(1); } 50% { text-shadow: 0 0 40px currentColor, 0 0 120px currentColor; transform: scale(1.08); } }
.hc-title { font-family: "HeirofLight", "Noto Serif KR", serif !important; font-weight: bold; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: .12em; animation: hc-flicker 3s ease-in-out infinite; margin: 0; }
@keyframes hc-flicker { 0%,100% { opacity: 1; } 92% { opacity: 1; } 93% { opacity: .4; } 94% { opacity: 1; } 96% { opacity: .6; } 97% { opacity: 1; } }
.hc-sub { font-family: "HeirofLight", "Noto Serif KR", serif !important; font-size: .9rem; color: var(--muted); letter-spacing: .2em; font-weight: bold; }
.hc-desc { max-width: 480px; font-size: .95rem; color: #e0d4c0; line-height: 1.8; border: 1px solid; border-radius: 10px; padding: 18px 24px; background: rgba(0,0,0,.4); opacity: 0; animation: hc-fadein 0.4s 0.2s forwards; word-break: keep-all; margin: 0; }
.hc-condition { font-size: .85rem; color: #c9a84c; font-weight: bold; letter-spacing: .1em; opacity: 0; animation: hc-fadein 0.4s 0.3s forwards; }
@keyframes hc-fadein { to { opacity: 1; } }
.hc-close { background: none; border: 1px solid #c9a84c; color: #c9a84c; font-family: 'HeirofLight', 'Noto Serif KR', serif; font-weight: bold; font-size: 1rem; padding: 10px 28px; border-radius: 6px; cursor: pointer; letter-spacing: .12em; opacity: 0; animation: hc-fadein 0.4s 0.4s forwards; transition: background .2s, color .2s; outline: none; }
.hc-close:hover { background: rgba(201,168,76,.15); color: #fff; }

.hc-detail-modal { position: fixed; inset: 0; z-index: 2147483647; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s; pointer-events: none; }
.hc-detail-modal.show { opacity: 1; pointer-events: auto; }
.hc-detail-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.88); backdrop-filter: blur(6px); }
.hc-detail-shell { position: relative; z-index: 1; background: #11100f; border: none; border-radius: 0; width: 100vw; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; animation: hc-modal-in .4s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes hc-modal-in { from { transform: scale(.95) translateY(16px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.hc-detail-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid #2e2820; flex-shrink: 0; }
.hc-detail-title-wrap { display: flex; align-items: center; gap: 12px; }
.hc-detail-rune { font-size: 1.6rem; }
.hc-detail-name { font-family: var(--font-kr); font-size: 1.3rem; letter-spacing: .08em; font-weight: bold; color: var(--item-color, #c9a84c); text-shadow: 0 0 10px color-mix(in srgb, var(--item-color, #c9a84c) 50%, transparent); }
.hc-detail-close { background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; padding: 4px 8px; transition: color .2s; outline: none; }
.hc-detail-close:hover { color: #c9a84c; transform: scale(1.1); }
.hc-detail-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px 1fr; }
.hc-detail-left { border-right: 1px solid #2e2820; padding: 30px 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; background: rgba(0,0,0,0.2); }
.hc-detail-badge { display: inline-block; font-size: .75rem; font-weight: bold; letter-spacing: .12em; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--item-color, #c9a84c); color: var(--item-color, #c9a84c); width: fit-content; margin: 0 auto; }
.hc-detail-desc-text { font-size: 1rem; color: #e0d4c0; line-height: 1.8; word-break: keep-all; margin: 0; text-align: center; }
.hc-detail-cond-box { background: var(--panel2); border: 1px solid #2e2820; border-radius: 8px; padding: 14px 16px; margin-top: auto; text-align: center; }
.hc-detail-cond-label { font-size: .75rem; color: var(--muted); font-weight: bold; letter-spacing: .1em; margin-bottom: 8px; }
.hc-detail-cond-text { font-size: .9rem; color: #c9a84c; line-height: 1.6; font-weight: bold; }
.hc-detail-right { position: relative; overflow: hidden; background: #080706; box-shadow: inset 0 0 50px rgba(0,0,0,1); }
.hc-stigma-popup { position: absolute; background: rgba(17,16,15,0.95); backdrop-filter: blur(8px); border: 1px solid; border-radius: 10px; padding: 16px 20px; width: 260px; z-index: 100; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,1); transition: opacity .15s; pointer-events: none; }
.hc-stigma-popup.show { opacity: 1; pointer-events: auto; }

/* 체인 오버레이 */
.chain-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 16px; border-radius: 10px; pointer-events: none; z-index: 5; background: rgba(0,0,0,.5); }
.chain-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.9; filter: drop-shadow(0 0 2px rgba(0,0,0,0.5)); animation: chain-breath 4s ease-in-out infinite; }
@keyframes chain-breath { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.02); opacity: 1; } }
.chain-hint { font-size: .8rem; color: #c9a84c; font-weight: bold; letter-spacing: .1em; text-align: center; text-shadow: 0 0 5px rgba(0,0,0,1); animation: chain-hint-pulse 2s ease-in-out infinite; position: absolute; bottom: 30px; width: 100%; }
@keyframes chain-hint-pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

/* 반응형 */
@media (max-width: 820px) {
  .modal-body, .hc-detail-body { grid-template-columns: 1fr; }
  .modal-left, .hc-detail-left { border-right: none; border-bottom: 1px solid #2e2820; max-height: 200px; }
  .stigma-popup-detail, .hc-stigma-popup { position: fixed !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important; width: 85vw !important; max-width: 320px !important; z-index: 999999 !important; }
}

.oparts-scanner-line {
      position: absolute; left: 0; width: 100%; height: 4px; /* 두께 증가 */
      z-index: 2000; transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
      background: currentColor; /* 선 자체가 색을 띠게 함 */
      box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor; /* 발광 강화 */
    }
    .oparts-welcome-container {
      position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
      z-index: 1999; opacity: 0; transition: opacity 0.3s ease;
      font-size: 1.5rem; font-weight: bold; letter-spacing: 0.1em; text-align: center;
    }
    @keyframes scanner-shrink {
      to { width: 0; left: 50%; }
    }

/* =================================================== */
/* 메아 리 스 변신 연출 전용                            */
/* =================================================== */
@keyframes card-blackout {
  from { filter: brightness(1); }
  to { filter: brightness(0); }
}

@keyframes card-shatter {
  0%   { filter: brightness(0); transform: none; }
  8%   { filter: brightness(3) contrast(4); transform: translate(-5px, 2px) rotate(-1.5deg); }
  16%  { filter: brightness(0); transform: translate(6px, -3px); }
  24%  { filter: brightness(4) saturate(0); transform: translate(-4px, 5px) rotate(1deg); }
  32%  { filter: brightness(0); transform: translate(5px, -2px); }
  42%  { filter: brightness(5) contrast(6); transform: translate(-6px, 3px) skew(-2deg); }
  52%  { filter: brightness(0); transform: none; }
  62%  { filter: brightness(3) contrast(3); transform: translate(3px, -2px); }
  78%  { filter: brightness(1.5); transform: translate(-1px, 1px); }
  100% { filter: brightness(0); transform: none; }
}

@keyframes card-mearis-reveal {
  0%   { filter: brightness(0) saturate(0); }
  18%  { filter: brightness(0.06) saturate(0) contrast(6); }
  40%  { filter: brightness(0.35) saturate(0.2) contrast(2.5); }
  62%  { filter: brightness(1.2) saturate(1.5) contrast(1.3); }
  80%  { filter: brightness(0.88) saturate(1.1) contrast(1.05); }
  100% { filter: brightness(1) saturate(1) contrast(1); }
}

.card-blackout {
  animation: card-blackout 0.4s ease forwards;
}

.card-shatter {
  animation: card-shatter 0.55s ease forwards;
}

.card-mearis-reveal {
  animation: card-mearis-reveal 0.8s ease-out forwards;
}

/* ===== 로딩 스크린 ===== */
#loadingScreen {
  position: fixed;
  inset: 0;
  background: #111;
  z-index: 9999999;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  color: #fff;
  font-family: 'Noto Serif KR', serif;
  transition: opacity 0.5s ease;
}

#loadingLabel {
  font-size: 0.95em;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 16px;
  margin-left: 48px;
  margin-bottom: 16px;
  position: absolute;
  bottom: 120px;
  left: 48px;
  text-transform: uppercase;
}

#loadingTrack {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.07);
}

#loadingBar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, rgba(255,255,255,0.0), rgba(255,255,255,0.6), #fff);
  box-shadow: 0 0 12px 2px rgba(255,255,255,0.6);
  transition: width 0.1s linear;
}

#loadingCube {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #fff;
  box-shadow: 0 0 10px 4px rgba(255,255,255,0.9), 0 0 24px 8px rgba(255,255,255,0.4);
  transition: left 0.1s linear;
}

#loadingText {
  font-size: 0.78em;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  position: absolute;
  bottom: 80px;
  left: 48px;
}

/* ========================== 끝 ========================== */
