:root {
  --bg: #07080d;
  --panel: #0f1119;
  --panel-2: #141722;
  --ink: #f3efe5;
  --muted: #9a9ca8;
  --line: rgba(218, 205, 173, 0.18);
  --gold: #d8b56e;
  --gold-soft: #8e7549;
  --blood: #a73843;
  --moon: #b9c8e8;
  --shadow: 0 28px 70px rgba(0,0,0,.42);
  --side: 118px;
  --top: 76px;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 74% 9%, rgba(98, 112, 155, .11), transparent 26%),
    radial-gradient(circle at 12% 42%, rgba(117, 36, 48, .08), transparent 24%),
    var(--bg);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}
body.dialog-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
::selection { color: #08080b; background: var(--gold); }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 1200;
  background: rgba(255,255,255,.03);
}
.page-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blood), var(--gold));
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--top);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 13, .72);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 260px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(216,181,110,.48);
  transform: rotate(45deg);
  color: var(--gold);
  font-size: 20px;
}
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand strong { display: block; font-family: Georgia, serif; letter-spacing: .16em; font-size: 14px; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.topnav { display: flex; align-items: center; gap: 30px; color: #c5c4c7; font-size: 13px; }
.topnav a { position: relative; padding: 26px 0; }
.topnav a::after {
  content: "";
  position: absolute;
  left: 50%; right: 50%; bottom: 17px;
  height: 1px;
  background: var(--gold);
  transition: .25s ease;
}
.topnav a:hover::after, .topnav a.active::after { left: 0; right: 0; }
.topnav a.active { color: #fff; }
.mobile-menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); background: transparent; }
.mobile-menu-button span { display: block; width: 18px; height: 1px; margin: 5px auto; background: #fff; }

.side-rail {
  position: fixed;
  left: 0;
  top: var(--top);
  bottom: 0;
  z-index: 900;
  width: var(--side);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 14px 22px;
  border-right: 1px solid var(--line);
  background: rgba(7, 8, 13, .76);
  backdrop-filter: blur(14px);
}
.rail-crown { color: var(--gold); font-size: 27px; margin-bottom: 30px; }
.side-rail nav { width: 100%; display: grid; gap: 8px; }
.side-rail a {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  color: #777b87;
  font-size: 11px;
  border-left: 1px solid transparent;
  transition: .25s ease;
}
.side-rail a span { font-family: Georgia, serif; color: #50525b; font-size: 9px; }
.side-rail a:hover, .side-rail a.active { color: var(--ink); border-left-color: var(--gold); background: linear-gradient(90deg, rgba(216,181,110,.08), transparent); }
.side-rail a.active span { color: var(--gold); }
.rail-status { margin-top: auto; color: #555966; font-size: 8px; letter-spacing: .13em; writing-mode: vertical-rl; }
.rail-status i { display: inline-block; width: 5px; height: 5px; margin-bottom: 8px; border-radius: 50%; background: #6ed09c; box-shadow: 0 0 10px #6ed09c; }

.mobile-menu {
  display: none;
  position: fixed;
  z-index: 950;
  top: var(--top);
  left: 0;
  right: 0;
  padding: 18px 22px 24px;
  background: rgba(8,9,14,.97);
  border-bottom: 1px solid var(--line);
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mobile-menu.open { display: grid; }
.mobile-menu a { padding: 12px; border: 1px solid var(--line); color: #c7c7ca; }

main { margin-left: var(--side); }
.hero, .section { scroll-margin-top: var(--top); }
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  align-items: center;
  gap: 80px;
  padding: calc(var(--top) + 84px) clamp(50px, 7vw, 130px) 80px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7,8,13,.98) 0%, rgba(7,8,13,.78) 46%, rgba(7,8,13,.24) 100%),
    linear-gradient(180deg, transparent 70%, var(--bg));
  z-index: -2;
}
.hero-backdrop { position: absolute; inset: 0; z-index: -3; overflow: hidden; }
.moon {
  position: absolute;
  width: min(55vw, 760px);
  aspect-ratio: 1;
  right: -7vw;
  top: 5vh;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255,255,255,.9), rgba(203,211,231,.8) 38%, rgba(91,103,139,.42) 64%, transparent 65%),
    #c8d0e0;
  filter: grayscale(.38);
  box-shadow: 0 0 130px rgba(167,181,220,.14);
  opacity: .38;
}
.moon::after {
  content: "";
  position: absolute;
  width: 92%; height: 92%;
  left: -17%; top: -7%;
  border-radius: 50%;
  background: var(--bg);
}
.orbit {
  position: absolute;
  border: 1px solid rgba(216,181,110,.14);
  border-radius: 50%;
  right: 3vw;
  top: 10vh;
  animation: spin 34s linear infinite;
}
.orbit::before, .orbit::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px rgba(216,181,110,.65); }
.orbit::before { left: 7%; top: 25%; }
.orbit::after { right: 6%; bottom: 29%; }
.orbit-a { width: 620px; height: 620px; }
.orbit-b { width: 480px; height: 480px; right: 8vw; top: 16vh; animation-direction: reverse; animation-duration: 26s; }
.orbit-c { width: 790px; height: 410px; right: -2vw; top: 18vh; transform: rotate(-18deg); animation-duration: 48s; }
@keyframes spin { to { transform: rotate(360deg); } }
.throne-silhouette {
  position: absolute;
  right: 13vw;
  bottom: 0;
  width: 250px;
  height: 430px;
  background: linear-gradient(180deg, #11131a, #05060a);
  clip-path: polygon(14% 0, 37% 15%, 50% 2%, 63% 15%, 86% 0, 82% 58%, 100% 74%, 90% 100%, 10% 100%, 0 74%, 18% 58%);
  filter: drop-shadow(0 0 45px rgba(0,0,0,.8));
  opacity: .94;
}
.hero-copy { max-width: 760px; }
.eyebrow { margin: 0 0 18px; color: var(--gold); font-family: Georgia, serif; letter-spacing: .26em; font-size: 12px; }
.hero h1 { margin: 0; line-height: .93; letter-spacing: -.055em; }
.hero h1 span { display: block; font-size: clamp(54px, 6.1vw, 112px); font-weight: 300; color: #d7d4cc; }
.hero h1 strong { display: block; font-size: clamp(66px, 7.7vw, 142px); font-weight: 900; color: #fff; text-shadow: 0 12px 44px rgba(0,0,0,.42); }
.hero-lead { margin: 34px 0 0; color: #a9aab2; font-size: clamp(15px, 1.15vw, 19px); }
.hero-actions { display: flex; gap: 12px; margin-top: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line);
  background: transparent;
  color: #e8e4db;
  cursor: pointer;
  transition: .25s ease;
}
.button.primary { border-color: var(--gold); background: var(--gold); color: #101116; font-weight: 800; }
.button.primary:hover { box-shadow: 0 10px 30px rgba(216,181,110,.18); transform: translateY(-2px); }
.button.ghost:hover { border-color: rgba(216,181,110,.6); color: var(--gold); }
.hero-stats { display: flex; gap: 42px; margin: 44px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-stats div { min-width: 82px; }
.hero-stats dt { color: #6f7280; font-size: 10px; letter-spacing: .12em; }
.hero-stats dd { margin: 3px 0 0; font-family: Georgia, serif; font-size: 25px; color: var(--ink); }
.hero-seal { justify-self: center; position: relative; width: 330px; height: 410px; display: grid; place-items: center; }
.seal-ring {
  position: absolute;
  width: 300px; height: 300px;
  border: 1px solid rgba(216,181,110,.4);
  border-radius: 50%;
  box-shadow: inset 0 0 0 14px rgba(216,181,110,.03), inset 0 0 0 15px rgba(216,181,110,.14), 0 0 50px rgba(216,181,110,.06);
}
.seal-ring::before, .seal-ring::after { content: ""; position: absolute; inset: 24px; border-radius: 50%; border: 1px dashed rgba(216,181,110,.33); }
.seal-ring::after { inset: 52px; border-style: solid; }
.seal-ring span { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); padding: 0 14px; background: var(--bg); color: var(--gold); letter-spacing: .28em; font-size: 11px; }
.seal-core { position: relative; z-index: 2; color: var(--blood); font-family: "Times New Roman", serif; font-size: 82px; font-weight: 900; line-height: .78; text-align: center; text-shadow: 0 8px 30px rgba(167,56,67,.24); }
.hero-seal p { position: absolute; bottom: 8px; margin: 0; text-align: center; color: #757986; font-family: Georgia, serif; font-size: 10px; letter-spacing: .19em; }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); color: #585b66; font-size: 9px; letter-spacing: .23em; }
.scroll-cue span { display: block; text-align: center; color: var(--gold); font-size: 20px; animation: bob 1.5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

.section { position: relative; padding: 120px clamp(42px, 6vw, 112px); border-bottom: 1px solid var(--line); }
.section::before { content: ""; position: absolute; top: 0; right: 6vw; width: 1px; height: 82px; background: linear-gradient(var(--gold), transparent); opacity: .25; }
.section-heading { display: flex; align-items: flex-start; gap: 28px; margin-bottom: 64px; }
.section-number { font-family: Georgia, serif; color: var(--gold); font-size: 66px; line-height: 1; opacity: .72; }
.section-heading p { margin: 2px 0 10px; color: var(--gold-soft); font-family: Georgia, serif; font-size: 11px; letter-spacing: .22em; }
.section-heading h2 { margin: 0; font-size: clamp(38px, 4.6vw, 76px); line-height: 1.12; letter-spacing: -.045em; }

.world-section { background: linear-gradient(180deg, rgba(14,16,24,.55), rgba(7,8,13,.8)); }
.world-grid { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(420px, 1.22fr); gap: clamp(42px, 7vw, 112px); }
.lore-panel { padding: 36px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(19,21,31,.88), rgba(10,11,17,.7)); box-shadow: var(--shadow); }
.lore-panel p { color: #b2b3ba; }
.lore-panel b { color: var(--ink); }
.lore-panel .dropcap { margin-top: 0; color: #e4dfd5; font-size: 22px; font-weight: 800; }
.lore-panel .dropcap::first-letter { float: left; margin: 3px 12px 0 0; color: var(--gold); font-family: Georgia, serif; font-size: 64px; line-height: .78; }
.lore-panel blockquote { margin: 30px 0 0; padding: 19px 0 0 22px; border-top: 1px solid var(--line); border-left: 2px solid var(--blood); color: #d5d0c8; font-family: Georgia, serif; font-size: 18px; }
.timeline { position: relative; display: grid; gap: 12px; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(var(--gold), var(--blood)); opacity: .45; }
.timeline article { position: relative; margin-left: 48px; padding: 25px 30px; border: 1px solid var(--line); background: rgba(14,16,24,.67); transition: .25s ease; }
.timeline article::before { content: ""; position: absolute; left: -38px; top: 35px; width: 12px; height: 12px; border: 2px solid var(--gold-soft); border-radius: 50%; background: var(--bg); }
.timeline article:hover { transform: translateX(5px); border-color: rgba(216,181,110,.38); }
.timeline article span { color: var(--gold-soft); font-family: Georgia, serif; font-size: 10px; letter-spacing: .16em; }
.timeline article h3 { margin: 5px 0 4px; font-size: 21px; }
.timeline article p { margin: 0; color: #8f929f; font-size: 14px; }
.timeline article.current { border-color: rgba(167,56,67,.45); }
.timeline article.current::before { border-color: var(--blood); box-shadow: 0 0 16px rgba(167,56,67,.5); }
.timeline article.unknown { border-style: dashed; }
.world-keywords { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 40px; }
.world-keywords span { padding: 7px 12px; border: 1px solid var(--line); color: #8d909b; font-size: 11px; }

.rank-section { overflow: hidden; }
.rank-section::after { content: "RANK"; position: absolute; right: -25px; bottom: -65px; color: rgba(255,255,255,.018); font-family: Georgia, serif; font-size: 260px; font-weight: 900; }
.rank-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 34px; }
.rank-intro p { margin: 0; max-width: 760px; color: #b3b4bb; font-size: 17px; }
.rank-intro span { color: #676b78; font-size: 11px; }
.rank-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.rank-card { min-height: 245px; display: flex; flex-direction: column; padding: 22px 17px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(21,24,35,.88), rgba(10,11,17,.78)); transition: .25s ease; }
.rank-card:hover { transform: translateY(-8px); border-color: var(--rank-color); box-shadow: 0 20px 50px rgba(0,0,0,.32); }
.rank-card .rank-letter { color: var(--rank-color); font-family: Georgia, serif; font-size: 62px; line-height: 1; }
.rank-card h3 { margin: 18px 0 5px; font-size: 15px; }
.rank-card p { margin: 0; color: #858894; font-size: 12px; line-height: 1.55; }
.rank-card small { margin-top: auto; padding-top: 16px; color: #5e626e; font-family: Georgia, serif; font-size: 9px; letter-spacing: .12em; }
.rank-card.sealed { border-style: dashed; background: linear-gradient(180deg, rgba(39,20,27,.66), rgba(10,11,17,.8)); }

.factions-section { background: radial-gradient(circle at 100% 0, rgba(216,181,110,.05), transparent 32%); }
.faction-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.view-switch { display: flex; gap: 8px; }
.view-switch button { padding: 8px 14px; border: 1px solid var(--line); background: transparent; color: #767985; cursor: pointer; }
.view-switch button.active { color: #0b0c11; border-color: var(--gold); background: var(--gold); }
.faction-tools p { color: #777a86; font-size: 12px; }
.faction-tools b { color: var(--ink); font-family: Georgia, serif; font-size: 18px; }
.faction-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.faction-card { position: relative; min-height: 330px; display: grid; grid-template-columns: 142px 1fr; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(21,23,33,.9), rgba(11,12,18,.78)); cursor: pointer; transition: .28s ease; }
.faction-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.faction-card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -80px; top: -80px; border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent); border-radius: 50%; opacity: .35; }
.faction-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 55%, #343642); box-shadow: var(--shadow); }
.faction-emblem { display: grid; place-items: center; border-right: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent); }
.faction-emblem span { display: grid; place-items: center; width: 90px; height: 90px; border: 1px solid color-mix(in srgb, var(--accent) 62%, transparent); border-radius: 50%; color: var(--accent); font-family: Georgia, serif; font-size: 39px; box-shadow: inset 0 0 0 9px rgba(255,255,255,.015); }
.faction-copy { position: relative; z-index: 2; padding: 28px 30px 24px; }
.faction-copy .meta { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: 10px; letter-spacing: .13em; }
.faction-copy h3 { margin: 7px 0 0; font-size: 28px; }
.faction-copy h4 { margin: 3px 0 18px; color: #8f929e; font-size: 12px; font-weight: 500; }
.faction-copy p { margin: 0; color: #9da0aa; font-size: 13px; }
.faction-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.faction-tags span { padding: 5px 8px; border: 1px solid var(--line); color: #777b87; font-size: 10px; }
.faction-card .open-record { position: absolute; right: 24px; bottom: 20px; color: var(--accent); font-family: Georgia, serif; font-size: 10px; letter-spacing: .13em; }
.faction-grid.list-view { grid-template-columns: 1fr; }
.faction-grid.list-view .faction-card { min-height: 215px; grid-template-columns: 110px 1fr; }
.faction-grid.list-view .faction-emblem span { width: 70px; height: 70px; font-size: 30px; }

.character-section { min-height: 100vh; }
.character-toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) 220px 150px; gap: 12px; }
.search-box { height: 50px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 1px solid var(--line); background: rgba(15,17,25,.8); }
.search-box span { color: var(--gold); font-size: 20px; }
.search-box input { width: 100%; color: #e4e1da; background: transparent; border: 0; outline: 0; }
.search-box input::placeholder { color: #5d606b; }
.character-toolbar select { padding: 0 14px; color: #b8b9c0; border: 1px solid var(--line); background: #0e1018; outline: 0; }
.character-summary { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 25px; color: #7e818d; font-size: 12px; }
.character-summary strong { color: var(--gold); font-family: Georgia, serif; font-size: 19px; }
.character-summary button { border: 0; background: transparent; color: #727581; cursor: pointer; }
.character-summary button:hover { color: var(--ink); }
.character-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.character-card { position: relative; aspect-ratio: .77; overflow: hidden; border: 1px solid var(--line); background: #10121a; cursor: pointer; transition: .25s ease; }
.character-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 24px 55px rgba(0,0,0,.38); }
.character-image { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 22%, #171923), #08090d 70%); }
.character-image img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: .35s ease; }
.character-card:hover img { transform: scale(1.035); }
.character-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in srgb, var(--accent) 45%, #fff); font-family: Georgia, serif; font-size: clamp(56px, 7vw, 108px); opacity: .42; }
.character-placeholder[hidden] { display: none !important; }
.character-placeholder::before, .character-placeholder::after { content: ""; position: absolute; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 50%; }
.character-placeholder::before { width: 72%; aspect-ratio: 1; }
.character-placeholder::after { width: 48%; aspect-ratio: 1; }
.character-shade { position: absolute; inset: 26% 0 0; background: linear-gradient(transparent, rgba(4,5,8,.68) 42%, rgba(4,5,8,.98)); }
.character-card-content { position: absolute; z-index: 2; inset: auto 0 0; padding: 19px 18px 17px; }
.character-card-content .card-label { color: var(--accent); font-size: 9px; letter-spacing: .13em; }
.character-card-content h3 { margin: 5px 0 1px; font-size: 23px; line-height: 1.15; }
.character-card-content p { margin: 0; color: #a0a2aa; font-size: 11px; }
.character-card-content .card-tags { display: flex; gap: 6px; margin-top: 10px; }
.character-card-content .card-tags span { padding: 3px 6px; border: 1px solid rgba(255,255,255,.12); color: #7e818c; font-size: 8px; }
.character-index { position: absolute; z-index: 3; top: 12px; left: 12px; padding: 4px 7px; color: #0b0c10; background: var(--accent); font-family: Georgia, serif; font-size: 9px; font-weight: 800; }
.character-status { position: absolute; z-index: 3; top: 13px; right: 13px; width: 7px; height: 7px; border-radius: 50%; background: #71d5a0; box-shadow: 0 0 9px #71d5a0; }
.load-more { display: flex; margin: 30px auto 0; }
.empty-state { grid-column: 1/-1; padding: 80px 30px; border: 1px dashed var(--line); color: #6e717d; text-align: center; }

.mode-section { background: linear-gradient(180deg, rgba(8,9,14,.68), rgba(20,14,18,.56)); }
.mode-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(280px,.55fr); gap: 24px; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.mode-cards article { min-height: 245px; padding: 30px; border: 1px solid var(--line); background: rgba(15,17,25,.74); }
.mode-cards article span { color: var(--gold); font-family: Georgia, serif; font-size: 36px; }
.mode-cards article h3 { margin: 15px 0 10px; font-size: 22px; }
.mode-cards article p { margin: 0; color: #9699a4; font-size: 13px; }
.vault-card { position: relative; overflow: hidden; padding: 34px; border: 1px solid rgba(167,56,67,.46); background: radial-gradient(circle at 50% 22%, rgba(167,56,67,.12), transparent 38%), #0e0f16; }
.vault-card::before { content: ""; position: absolute; inset: 14px; border: 1px dashed rgba(167,56,67,.2); pointer-events: none; }
.vault-card > * { position: relative; z-index: 2; }
.vault-card > p { color: var(--blood); font-family: Georgia, serif; font-size: 10px; letter-spacing: .18em; }
.vault-card h3 { margin: 3px 0 10px; font-size: 30px; }
.vault-lock { margin: 25px 0; color: var(--blood); font-size: 76px; line-height: 1; text-align: center; }
.vault-card ul { margin: 0; padding-left: 18px; color: #8d909b; font-size: 12px; }
.vault-card button { width: 100%; height: 44px; margin-top: 28px; border: 1px solid rgba(167,56,67,.32); background: rgba(167,56,67,.07); color: #6d4047; }

footer { margin-left: var(--side); min-height: 180px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 48px clamp(42px, 6vw, 112px); background: #05060a; }
footer strong { font-family: Georgia, serif; letter-spacing: .18em; }
footer p { margin: 6px 0 0; color: #5e616c; font-size: 11px; }
footer a { color: var(--gold); font-size: 11px; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

.character-dialog, .faction-dialog {
  position: relative;
  width: min(1140px, calc(100vw - 48px));
  max-height: calc(100vh - 54px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  border: 1px solid rgba(216,181,110,.33);
  background: #0d0f16;
  box-shadow: 0 40px 120px rgba(0,0,0,.76);
}
.character-dialog::backdrop, .faction-dialog::backdrop { background: rgba(2,3,6,.82); backdrop-filter: blur(12px); }
.dialog-close {
  position: absolute;
  z-index: 20;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(8,9,14,.82);
  color: #d5d1c8;
  font-family: Arial, sans-serif;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
}
.dialog-close::before {
  content: "×";
  display: block;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-1px);
}
.character-detail { display: grid; grid-template-columns: minmax(300px, .88fr) minmax(400px, 1.12fr); min-height: 690px; }
.detail-portrait { position: relative; min-height: 650px; overflow: hidden; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 24%, #171923), #07080d 68%); }
.detail-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.detail-portrait .character-placeholder { font-size: 150px; }
.detail-portrait::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, #0d0f16); }
.detail-portrait-label { position: absolute; z-index: 3; left: 28px; bottom: 25px; color: var(--accent); font-family: Georgia, serif; font-size: 10px; letter-spacing: .18em; }
.detail-copy { padding: 58px 54px 52px; }
.detail-copy .detail-kicker { color: var(--accent); font-family: Georgia, serif; font-size: 11px; letter-spacing: .18em; }
.detail-copy h2 { margin: 7px 0 2px; font-size: clamp(44px, 5vw, 72px); line-height: 1; }
.detail-copy .detail-role { color: #9699a4; font-size: 14px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 36px; }
.detail-badges span { padding: 7px 10px; border: 1px solid var(--line); color: #b6b7bd; font-size: 11px; }
.detail-copy section { margin-top: 28px; }
.detail-copy section h3 { margin: 0 0 9px; color: var(--accent); font-family: Georgia, serif; font-size: 11px; letter-spacing: .16em; }
.detail-copy section p { margin: 0; color: #a8aab3; font-size: 14px; }
.detail-relations { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-relations span { padding: 5px 8px; border: 1px solid var(--line); color: #848793; font-size: 10px; }

.faction-detail { --accent: var(--gold); }
.faction-detail-head { position: relative; overflow: hidden; padding: 62px 70px 48px; border-bottom: 1px solid var(--line); background: linear-gradient(125deg, color-mix(in srgb, var(--accent) 14%, #11131b), #0b0c12); }
.faction-detail-head::after { content: attr(data-symbol); position: absolute; right: 58px; top: -24px; color: color-mix(in srgb, var(--accent) 13%, transparent); font-family: Georgia, serif; font-size: 190px; }
.faction-detail-head p { margin: 0; color: var(--accent); font-family: Georgia, serif; font-size: 11px; letter-spacing: .17em; }
.faction-detail-head h2 { margin: 5px 0 0; font-size: 54px; }
.faction-detail-head h3 { margin: 4px 0 0; color: #91949f; font-size: 14px; font-weight: 500; }
.faction-detail-body { display: grid; grid-template-columns: 1.2fr .8fr; gap: 42px; padding: 48px 70px 60px; }
.faction-detail-body h4 { margin: 0 0 12px; color: var(--accent); font-family: Georgia, serif; font-size: 11px; letter-spacing: .15em; }
.faction-detail-body p { margin: 0; color: #a2a4ae; font-size: 14px; }
.relation-list, .member-list { display: grid; gap: 9px; }
.relation-list div, .member-list button { padding: 12px 14px; border: 1px solid var(--line); background: rgba(255,255,255,.015); color: #a7a9b2; text-align: left; font-size: 12px; }
.member-list button { cursor: pointer; }
.member-list button:hover { border-color: var(--accent); color: var(--ink); }

@media (max-width: 1250px) {
  :root { --side: 92px; }
  .hero { grid-template-columns: 1fr .72fr; gap: 30px; padding-left: 6vw; padding-right: 6vw; }
  .hero-seal { transform: scale(.87); }
  .character-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .rank-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 980px) {
  :root { --side: 0px; --top: 68px; }
  .side-rail, .topnav { display: none; }
  .mobile-menu-button { display: block; }
  .topbar { padding: 0 20px; }
  .brand { min-width: 0; }
  main, footer { margin-left: 0; }
  .hero { grid-template-columns: 1fr; padding: calc(var(--top) + 70px) 7vw 90px; }
  .hero-seal { position: absolute; right: 4vw; top: 20vh; opacity: .32; }
  .hero-copy { position: relative; z-index: 4; }
  .world-grid { grid-template-columns: 1fr; }
  .faction-grid { grid-template-columns: 1fr; }
  .mode-layout { grid-template-columns: 1fr; }
  .character-detail { grid-template-columns: .8fr 1.2fr; }
}

@media (max-width: 720px) {
  .brand strong { font-size: 12px; }
  .brand small { display: none; }
  .hero { min-height: 760px; padding-left: 22px; padding-right: 22px; }
  .hero h1 span { font-size: 46px; }
  .hero h1 strong { font-size: 58px; }
  .hero-lead br { display: none; }
  .hero-stats { gap: 22px; }
  .hero-seal { right: -100px; top: 190px; transform: scale(.7); }
  .section { padding: 90px 20px; }
  .section-heading { gap: 16px; margin-bottom: 44px; }
  .section-number { font-size: 48px; }
  .section-heading h2 { font-size: 38px; }
  .rank-intro { display: block; }
  .rank-intro span { display: block; margin-top: 9px; }
  .rank-grid { grid-template-columns: repeat(2, 1fr); }
  .faction-card { grid-template-columns: 86px 1fr; min-height: 300px; }
  .faction-emblem span { width: 58px; height: 58px; font-size: 25px; }
  .faction-copy { padding: 22px 20px 22px; }
  .faction-copy h3 { font-size: 23px; }
  .character-toolbar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1/-1; }
  .character-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .character-card-content { padding: 15px 13px 13px; }
  .character-card-content h3 { font-size: 19px; }
  .mode-cards { grid-template-columns: 1fr; }
  .character-dialog, .faction-dialog { width: calc(100vw - 18px); max-height: calc(100vh - 18px); }
  .character-detail { grid-template-columns: 1fr; }
  .detail-portrait { min-height: 460px; }
  .detail-copy { padding: 38px 24px 42px; }
  .faction-detail-head { padding: 48px 28px 35px; }
  .faction-detail-head h2 { font-size: 38px; }
  .faction-detail-head::after { right: 8px; font-size: 130px; }
  .faction-detail-body { grid-template-columns: 1fr; padding: 34px 28px 45px; }
  footer { padding: 40px 22px; flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero h1 span { font-size: 39px; }
  .hero h1 strong { font-size: 49px; }
  .hero-actions { flex-direction: column; }
  .hero-stats { gap: 16px; }
  .hero-stats dd { font-size: 21px; }
  .character-grid { grid-template-columns: 1fr 1fr; }
  .character-toolbar { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .character-card-content p, .character-card-content .card-tags { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   V2 — 중앙 타이포그래피형 메인 화면
   첫 화면만 참고 사이트 구조에서 벗어나도록 새로 설계했습니다.
   ========================================================= */
.hero--centered {
  min-height: 100svh;
  display: grid;
  place-items: center;
  grid-template-columns: 1fr;
  padding: calc(var(--top) + 64px) 7vw 92px;
  isolation: isolate;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(216,181,110,.055), transparent 26%),
    radial-gradient(circle at 50% 120%, rgba(72,78,96,.08), transparent 45%),
    linear-gradient(180deg, #090a10 0%, #0a0b11 55%, #08090e 100%);
}
.hero--centered::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    repeating-linear-gradient(112deg, transparent 0 105px, rgba(255,255,255,.006) 106px, transparent 107px 214px);
  opacity: .55;
}
.hero-minimal-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
.hero-hairline {
  position: absolute;
  top: 48%;
  width: min(24vw, 360px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216,181,110,.16));
}
.hero-hairline--left { left: 0; }
.hero-hairline--right { right: 0; transform: scaleX(-1); }
.hero-horizon {
  position: absolute;
  left: 12vw;
  right: 12vw;
  bottom: 13vh;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.055), transparent);
}
.hero-center {
  position: relative;
  z-index: 2;
  width: min(1120px, 92vw);
  margin: 0 auto;
}
.hero--centered .eyebrow {
  margin: 0 0 27px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(9px, .72vw, 12px);
  letter-spacing: .42em;
  font-weight: 700;
}
.hero--centered h1 {
  margin: 0;
  display: grid;
  justify-items: center;
  line-height: .9;
  letter-spacing: -.06em;
}
.hero--centered h1 span,
.hero--centered h1 strong {
  display: block;
  width: max-content;
  max-width: 100%;
}
.hero--centered h1 span {
  color: #d7d3c8;
  font-size: clamp(54px, 7.1vw, 126px);
  font-weight: 300;
}
.hero--centered h1 strong {
  margin-top: 8px;
  color: #f6f5f1;
  font-size: clamp(66px, 8.5vw, 154px);
  font-weight: 900;
  text-shadow: 0 18px 60px rgba(0,0,0,.45);
}
.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: min(360px, 70vw);
  margin: 36px auto 27px;
  color: rgba(216,181,110,.65);
}
.hero-divider i {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(216,181,110,.28));
}
.hero-divider i:last-child { transform: scaleX(-1); }
.hero-divider b { font-size: 7px; font-weight: 400; }
.hero--centered .hero-lead {
  margin: 0;
  color: #9a9ca6;
  font-size: clamp(14px, 1.02vw, 18px);
  line-height: 1.95;
  letter-spacing: -.015em;
}
.hero-actions--center {
  justify-content: center;
  margin-top: 32px;
}
.hero-actions--center .button {
  min-width: 132px;
}
.scroll-cue--center {
  left: 50%;
  right: auto;
  bottom: 28px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #5c5e68;
  font-size: 8px;
  letter-spacing: .28em;
  text-decoration: none;
}
.scroll-cue--center b {
  color: var(--gold);
  font-size: 14px;
  font-weight: 400;
  animation: centeredCue 1.8s ease-in-out infinite;
}
@keyframes centeredCue {
  0%,100% { transform: translateY(0); opacity: .45; }
  50% { transform: translateY(5px); opacity: 1; }
}

@media (max-width: 760px) {
  .hero--centered {
    min-height: 100svh;
    padding: calc(var(--top) + 58px) 22px 90px;
  }
  .hero--centered h1 span { font-size: clamp(42px, 14vw, 66px); }
  .hero--centered h1 strong { font-size: clamp(50px, 16.5vw, 78px); }
  .hero--centered .eyebrow { letter-spacing: .27em; }
  .hero-divider { margin-top: 28px; margin-bottom: 22px; }
  .hero--centered .hero-lead br { display: none; }
  .hero-hairline { display: none; }
}

/* =========================================================
   V3 — 세계관 전환 / 등급 개체 주석 / 세력 단일 보기 / 모드 명령어
   ========================================================= */

/* 세계관: 오른쪽 시대를 누르면 왼쪽 기록이 교체됩니다. */
.lore-panel { transition: opacity .18s ease, transform .18s ease; }
.lore-panel.switching { opacity: .22; transform: translateY(4px); }
.era-story { display: grid; gap: 14px; }
.era-story p { margin: 0; color: #b2b3ba; line-height: 1.85; }
.timeline { align-content: start; }
.timeline-era {
  appearance: none;
  position: relative;
  width: calc(100% - 48px);
  margin-left: 48px;
  padding: 25px 30px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(14,16,24,.67);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.timeline-era::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 35px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--gold-soft);
  border-radius: 50%;
  background: var(--bg);
  transition: .22s ease;
}
.timeline-era:hover,
.timeline-era:focus-visible { transform: translateX(5px); border-color: rgba(216,181,110,.38); outline: 0; }
.timeline-era.active { border-color: rgba(216,181,110,.52); background: linear-gradient(90deg, rgba(216,181,110,.055), rgba(14,16,24,.7)); }
.timeline-era.active::before { border-color: var(--gold); box-shadow: 0 0 16px rgba(216,181,110,.36); }
.timeline-era span { color: var(--gold-soft); font-family: Georgia, serif; font-size: 10px; letter-spacing: .16em; }
.timeline-era h3 { margin: 5px 0 4px; font-size: 21px; }
.timeline-era p { margin: 0; color: #8f929f; font-size: 14px; }
.lore-panel .world-keywords { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.glossary-chip {
  appearance: none;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: #8d909b;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
  transition: .18s ease;
}
.glossary-chip:hover,
.glossary-chip:focus-visible { color: var(--gold); border-color: rgba(216,181,110,.45); outline: 0; }
.glossary-popover {
  position: fixed;
  z-index: 160;
  width: min(360px, calc(100vw - 24px));
  padding: 22px 24px 24px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(6px);
  border: 1px solid rgba(216,181,110,.32);
  background: rgba(12,14,20,.98);
  box-shadow: 0 22px 70px rgba(0,0,0,.58);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.glossary-popover.open { visibility: visible; opacity: 1; transform: translateY(0); }
.glossary-popover > button {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #777b86;
  font-size: 20px;
  cursor: pointer;
}
.glossary-popover > p:first-of-type { margin: 0 35px 4px 0; color: var(--gold); font-family: Georgia, serif; font-size: 9px; letter-spacing: .17em; }
.glossary-popover h3 { margin: 0 0 10px; font-size: 21px; }
.glossary-popover > p:last-of-type { margin: 0; color: #9fa2ac; font-size: 12px; line-height: 1.75; }

/* 등급: 카드 자체는 정적, 개체 이름만 클릭됩니다. */
.rank-card { min-height: 285px; }
.rank-card:hover { transform: none; box-shadow: none; border-color: var(--line); }
.rank-card.sealed:hover { border-color: var(--line); }
.rank-beasts { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.075); }
.rank-beasts-label { display: block; margin-bottom: 6px; color: var(--rank-color); font-family: Georgia, serif; font-size: 9px; letter-spacing: .16em; }
.rank-beast-links { display: flex; flex-wrap: wrap; gap: 2px 10px; min-height: 22px; }
.rank-beast-link {
  appearance: none;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: #aaaeb8;
  font: inherit;
  font-size: 11px;
  line-height: 1.8;
  cursor: pointer;
  transition: .15s ease;
}
.rank-beast-link:hover,
.rank-beast-link:focus-visible { color: var(--rank-color); border-bottom-color: var(--rank-color); outline: 0; }
.rank-beast-empty { color: #555965; font-size: 10px; }
.rank-card small { margin-top: auto; }
.beast-detail .detail-kicker { color: var(--accent); }
.beast-portrait { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, #141720), #07080d 70%); }

/* 세력: 보기 전환 UI 삭제. 카드 한 종류만 유지합니다. */
.factions-section .faction-grid { margin-top: 0; }
.faction-grid.list-view { grid-template-columns: repeat(2, minmax(0,1fr)); }
.faction-grid.list-view .faction-card { min-height: 330px; grid-template-columns: 142px 1fr; }
.faction-grid.list-view .faction-emblem span { width: 90px; height: 90px; font-size: 39px; }

/* 모드: 실제 시작 모드 + 명령어 안내 */
.mode-section { background: linear-gradient(180deg, rgba(8,9,14,.72), rgba(13,15,23,.78)); }
.mode-intro { max-width: 880px; margin: -28px 0 52px; color: #9295a1; font-size: 14px; line-height: 1.8; }
.mode-group + .mode-group { margin-top: 58px; }
.mode-group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.mode-group-head > span { color: var(--gold); font-family: Georgia, serif; font-size: 9px; letter-spacing: .18em; }
.mode-group-head h3 { margin: 0; font-size: 24px; }
.mode-group-head p { margin: 0 0 0 auto; color: #656a77; font-size: 10px; }
.start-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.start-mode-card {
  position: relative;
  min-height: 235px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(21,23,33,.9), rgba(10,11,17,.78));
}
.start-mode-card .mode-index { position: absolute; right: 24px; top: 19px; color: rgba(216,181,110,.16); font-family: Georgia, serif; font-size: 44px; }
.command-token,
.command-name {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.command-token { padding: 0 0 5px; border-bottom: 1px solid rgba(216,181,110,.34); font-size: 13px; }
.start-mode-card h4 { margin: 20px 0 9px; font-size: 25px; }
.start-mode-card p { max-width: 620px; margin: 0; color: #9396a0; font-size: 13px; line-height: 1.75; }
.copy-command {
  position: absolute;
  left: 30px;
  bottom: 25px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #707480;
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: .14em;
  cursor: pointer;
}
.copy-command:hover { color: var(--gold); }
.command-table { overflow: hidden; border: 1px solid var(--line); background: rgba(15,17,25,.68); }
.command-row { display: grid; grid-template-columns: 180px minmax(0,1fr) 64px; min-height: 62px; align-items: center; border-top: 1px solid var(--line); }
.command-row:first-child { border-top: 0; }
.command-row > * { padding: 16px 18px; }
.command-head { min-height: 48px; color: #6f7380; font-size: 10px; letter-spacing: .08em; }
.command-name { text-align: left; font-size: 12px; }
.command-row > span:nth-child(2) { color: #9ca0aa; font-size: 12px; }
.command-copy-icon { height: 100%; border: 0; border-left: 1px solid var(--line); background: transparent; color: #6f7380; cursor: pointer; }
.command-copy-icon:hover { color: var(--gold); background: rgba(216,181,110,.035); }
.copy-toast {
  position: fixed;
  z-index: 180;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  padding: 10px 16px;
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(216,181,110,.35);
  background: #0d0f16;
  color: #d8d2c5;
  font-size: 11px;
  transition: .18s ease;
}
.copy-toast.show { opacity: 1; transform: translate(-50%, 0); }


#characterDialog .detail-copy--v71:focus { outline: 1px solid rgba(216,181,110,.35); outline-offset: -1px; }
@media (max-width: 980px) {
  .timeline-era { width: calc(100% - 42px); margin-left: 42px; }
  .timeline-era::before { left: -34px; }
}

@media (max-width: 720px) {
  .rank-card { min-height: 270px; }
  .start-mode-grid { grid-template-columns: 1fr; }
  .mode-group-head { align-items: flex-start; flex-wrap: wrap; }
  .mode-group-head p { width: 100%; margin-left: 0; }
  .command-row { grid-template-columns: 108px minmax(0,1fr) 48px; }
  .command-row > * { padding: 13px 11px; }
  .command-head { font-size: 9px; }
}

@media (max-width: 480px) {
  .timeline::before { left: 10px; }
  .timeline-era { width: calc(100% - 30px); margin-left: 30px; padding: 20px 18px; }
  .timeline-era::before { left: -26px; width: 10px; height: 10px; }
  .rank-grid { grid-template-columns: 1fr; }
  .rank-card { min-height: 250px; }
  .command-row { grid-template-columns: 96px minmax(0,1fr) 42px; }
  .command-row > span:nth-child(2) { font-size: 11px; }
}

/* =========================================================
   V5 — 캐릭터 이미지 코드 3글자 통일 · 이미지 오버레이 수정
   ========================================================= */

/* 상단/좌측 메뉴 대응 */
.topnav { gap: clamp(14px, 1.5vw, 26px); }
.side-rail nav { overflow-y: auto; scrollbar-width: none; }
.side-rail nav::-webkit-scrollbar { display: none; }

.section-deck {
  max-width: 920px;
  margin: -28px 0 40px;
  color: #818590;
  font-size: 13px;
  line-height: 1.9;
}

/* 지역은 세력 카드 문법을 공유하되 지리 기록처럼 조금 더 차갑게 */
.regions-section {
  background:
    radial-gradient(circle at 0 10%, rgba(96,114,150,.06), transparent 30%),
    linear-gradient(180deg, rgba(9,10,16,.55), rgba(8,9,14,.2));
}
.region-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.region-card {
  background:
    linear-gradient(145deg, rgba(18,21,31,.94), rgba(10,11,17,.82));
}
.region-card .faction-emblem {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent);
}
.region-card .open-record { color: #737d90; }
.region-card:hover .open-record { color: var(--accent); }
.member-empty { margin: 10px 0 0; color: #626672; font-size: 11px; }

/* 등장인물: 드롭다운 제거, 소속 버튼을 한 번에 펼쳐 보입니다. */
.character-toolbar--chips {
  display: block;
  margin-bottom: 0;
}
.character-toolbar--chips .search-box {
  width: 100%;
  min-height: 54px;
  margin-bottom: 14px;
}
.character-group-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.character-group-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(13,15,22,.72);
  color: #8b8f9b;
  font-size: 11px;
  cursor: pointer;
  transition: .18s ease;
}
.character-group-chip b {
  color: #5d616d;
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 400;
}
.character-group-chip:hover,
.character-group-chip:focus-visible {
  color: var(--ink);
  border-color: rgba(216,181,110,.36);
  outline: 0;
}
.character-group-chip.active {
  color: #0b0c10;
  border-color: var(--gold);
  background: var(--gold);
}
.character-group-chip.active b { color: rgba(11,12,16,.66); }
.character-summary { margin-top: 14px; }

/* 일정: 레퍼런스의 컬러 배지형 리스트가 아니라, 기록철/연감 형태로 재해석 */
.schedule-section {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(9,10,16,.3), rgba(14,13,17,.72)),
    radial-gradient(circle at 95% 15%, rgba(216,181,110,.05), transparent 26%);
}
.schedule-section::after {
  content: "ANNUAL";
  position: absolute;
  right: -18px;
  top: 170px;
  color: rgba(216,181,110,.018);
  font-family: Georgia, serif;
  font-size: clamp(110px, 14vw, 260px);
  letter-spacing: -.05em;
  pointer-events: none;
}
.schedule-intro {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin: -28px 0 38px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.schedule-intro p {
  max-width: 850px;
  margin: 0;
  color: #8b8e99;
  font-size: 13px;
  line-height: 1.85;
}
.schedule-intro span {
  flex: none;
  color: var(--gold-soft);
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: .17em;
}
.schedule-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.schedule-card {
  --event-color: #8b8f98;
  position: relative;
  min-height: 190px;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(19,21,30,.9), rgba(10,11,17,.76));
  transition: border-color .18s ease, transform .18s ease;
}
.schedule-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--event-color);
  opacity: .82;
}
.schedule-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--event-color) 45%, rgba(218,205,173,.18));
}
.schedule-card--resource { --event-color: #71a99c; }
.schedule-card--threat { --event-color: #b14d55; }
.schedule-card--festival { --event-color: #d1ad61; }
.schedule-card--power { --event-color: #7588bd; }
.schedule-card--peace { --event-color: #6e9872; }
.schedule-month {
  position: absolute;
  right: 16px;
  bottom: -23px;
  color: color-mix(in srgb, var(--event-color) 9%, transparent);
  font-family: Georgia, serif;
  font-size: 104px;
  line-height: 1;
  pointer-events: none;
}
.schedule-date {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 25px 17px 22px 22px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--event-color) 6%, transparent), transparent);
}
.schedule-date span {
  color: #d5d0c5;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 13px;
  line-height: 1.45;
}
.schedule-date small {
  color: var(--event-color);
  font-family: Georgia, serif;
  font-size: 10px;
  letter-spacing: .15em;
}
.schedule-copy {
  position: relative;
  z-index: 1;
  padding: 25px 28px 24px;
}
.schedule-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: #777b86;
  font-size: 9px;
  letter-spacing: .08em;
}
.schedule-meta span:first-child { color: var(--event-color); font-weight: 700; }
.schedule-meta i { width: 14px; height: 1px; background: var(--line); }
.schedule-copy h3 {
  margin: 0 0 9px;
  font-size: 23px;
  letter-spacing: -.02em;
}
.schedule-copy p {
  max-width: 620px;
  margin: 0;
  color: #9295a0;
  font-size: 12px;
  line-height: 1.75;
}


/* V8 · 마수 현장 기록 — 인물 대표 대사와 같은 기록 인용 형식 */
#beastDialog .beast-field-note {
  position: relative;
  margin: 36px 0 2px;
  padding: 20px 23px 20px 27px;
  border-top: 1px solid rgba(216,181,110,.18);
  border-bottom: 1px solid rgba(216,181,110,.18);
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 75%);
  color: #e3ded4;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 16px;
  line-height: 1.82;
  font-style: italic;
  white-space: pre-line;
}

@media (max-width: 1180px) {
  .topnav { gap: 14px; font-size: 12px; }
  .region-grid, .schedule-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .section-deck { margin-top: -18px; }
  .character-group-filters { gap: 6px; }
  .character-group-chip { min-height: 34px; padding: 0 11px; font-size: 10px; }
  .schedule-intro { display: block; }
  .schedule-intro span { display: block; margin-top: 12px; }
  .schedule-card { grid-template-columns: 82px minmax(0, 1fr); min-height: 175px; }
  .schedule-date { padding: 21px 12px 18px 16px; }
  .schedule-copy { padding: 21px 18px 20px; }
  .schedule-copy h3 { font-size: 20px; }
  .schedule-month { font-size: 82px; }
}

/* =========================================================
   V7.2 — V5 인물 팝업 유지 + 오른쪽 기록 스크롤 강화
   - 왼쪽 이미지는 고정 영역 + object-fit: cover
   - 오른쪽만 내용이 길 때 스크롤
   - 대표 대사를 개요보다 먼저 노출
   ========================================================= */
#characterDialog {
  width: min(1260px, calc(100vw - 48px));
  height: min(800px, calc(100vh - 54px));
  max-height: calc(100vh - 54px);
  overflow: hidden;
}
#characterDialogContent {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#characterDialog .character-detail--v71 {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(390px, .93fr) minmax(600px, 1.27fr);
}
#characterDialog .character-detail--v71 .detail-portrait {
  height: 100%;
  min-height: 0;
}
#characterDialog .character-detail--v71 .detail-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
#characterDialog .detail-copy--v71 {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(216,181,110,.44) rgba(255,255,255,.025);
  padding: 54px 58px 72px;
}
#characterDialog .detail-copy--v71::-webkit-scrollbar { width: 8px; }
#characterDialog .detail-copy--v71::-webkit-scrollbar-track { background: rgba(255,255,255,.02); }
#characterDialog .detail-copy--v71::-webkit-scrollbar-thumb { background: rgba(216,181,110,.38); border: 2px solid #0d0f16; border-radius: 99px; }
#characterDialog .detail-copy--v71::-webkit-scrollbar-thumb:hover { background: rgba(216,181,110,.58); }
#characterDialog .detail-meta {
  margin: 11px 0 0;
  color: #a1a4ae;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 12px;
  letter-spacing: .065em;
}
#characterDialog .detail-copy--v71 .detail-role { margin: 8px 0 0; }
#characterDialog .detail-quote {
  position: relative;
  margin: 30px 0 32px;
  padding: 20px 23px 20px 27px;
  border-top: 1px solid rgba(216,181,110,.18);
  border-bottom: 1px solid rgba(216,181,110,.18);
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 75%);
  color: #e3ded4;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 16px;
  line-height: 1.82;
  font-style: italic;
}
#characterDialog .detail-copy--v71 section {
  margin-top: 26px;
  padding-top: 1px;
}
#characterDialog .detail-copy--v71 section h3 {
  margin-bottom: 10px;
}
#characterDialog .detail-copy--v71 section p {
  line-height: 1.86;
  white-space: pre-line;
}
#characterDialog .detail-affiliation p { color: #c6c3bb; }
#characterDialog .detail-keywords .detail-badges {
  margin: 0;
}

@media (max-width: 980px) {
  #characterDialog .character-detail--v71 {
    grid-template-columns: minmax(300px, .8fr) minmax(480px, 1.2fr);
  }
  #characterDialog .detail-copy--v71 { padding: 46px 40px 48px; }
}

@media (max-width: 720px) {
  #characterDialog {
    width: calc(100vw - 18px);
    height: auto;
    max-height: calc(100vh - 18px);
    overflow: auto;
  }
  #characterDialogContent {
    height: auto;
    overflow: visible;
  }
  #characterDialog .character-detail--v71 {
    height: auto;
    grid-template-columns: 1fr;
  }
  #characterDialog .character-detail--v71 .detail-portrait {
    height: auto;
    min-height: 460px;
  }
  #characterDialog .detail-copy--v71 {
    height: auto;
    overflow: visible;
    padding: 38px 24px 44px;
  }
  #characterDialog .detail-quote {
    margin: 24px 0 28px;
    font-size: 15px;
  }
}

/* =========================================================
   V9.1 — V8 기준 복귀 + PC 시대 연표 정리 + 모바일 통합 상세창
   ========================================================= */

/* PC 시대 연표: 원은 움직이지 않고, 선 중심을 원 중심에 정확히 맞춘다. */
@media (min-width: 721px) {
  .timeline::before { left: 18px; }
  .timeline-era {
    width: calc(100% - 48px);
    margin-left: 48px;
    transition: border-color .2s ease, background .2s ease;
  }
  .timeline-era::before {
    left: -38px;
    top: 35px;
    width: 12px;
    height: 12px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  }
  .timeline-era:hover,
  .timeline-era:focus-visible {
    transform: none;
    border-color: rgba(216,181,110,.38);
  }
  .timeline-era:hover::before,
  .timeline-era:focus-visible::before,
  .timeline-era.active::before {
    border-color: var(--gold);
    box-shadow: 0 0 16px rgba(216,181,110,.48);
  }
  .timeline-date {
    position: absolute;
    left: -126px;
    top: 31px;
    width: 78px;
    color: #777b86;
    font-family: "Noto Serif KR", Georgia, serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .01em;
    text-align: right;
    white-space: nowrap;
    pointer-events: none;
  }
  .timeline-era.active .timeline-date { color: var(--gold-soft); }
}

/* 모바일 팝업 공통: 모두 인물 상세창과 같은 외곽 크기.
   dialog 자체는 스크롤하지 않고 안쪽 내용만 스크롤해서 X를 항상 고정한다. */
@media (max-width: 720px) {
  .character-dialog,
  .faction-dialog,
  .era-dialog {
    box-sizing: border-box;
    width: calc(100vw - 18px) !important;
    height: min(780px, calc(100dvh - 92px)) !important;
    max-height: calc(100dvh - 92px) !important;
    margin: auto;
    padding: 0;
    overflow: hidden !important;
  }

  .character-dialog > [id$="DialogContent"],
  .faction-dialog > [id$="DialogContent"],
  #eraDialogContent {
    box-sizing: border-box;
    width: 100%;
    height: 100% !important;
    min-height: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* X는 내용 스크롤과 분리되어 팝업 우측 상단에 계속 남는다. */
  .character-dialog > .dialog-close,
  .faction-dialog > .dialog-close,
  .era-dialog > .dialog-close {
    position: absolute !important;
    z-index: 100;
    top: 16px !important;
    right: 16px !important;
    width: 42px;
    height: 42px;
  }

  /* V7 계열 캐릭터의 모바일 overflow 규칙을 V9.1 공통 구조로 덮어쓴다. */
  #characterDialog,
  #beastDialog {
    overflow: hidden !important;
  }
  #characterDialogContent,
  #beastDialogContent {
    height: 100% !important;
    overflow-y: auto !important;
  }
  #characterDialog .character-detail--v71,
  #beastDialog .character-detail {
    height: auto !important;
    min-height: 100%;
  }
  #characterDialog .detail-copy--v71 {
    height: auto !important;
    overflow: visible !important;
  }

  /* 지역/세력도 같은 크기 안에서 내용만 움직인다. */
  #regionDialogContent,
  #factionDialogContent {
    height: 100%;
    overflow-y: auto;
  }

  /* 모바일 세계관: PC 왼쪽 장문 패널은 보이지 않고 연표만 남긴다. */
  .world-grid { grid-template-columns: 1fr; }
  #eraLorePanel { display: none !important; }
  .timeline {
    width: 100%;
    max-width: none;
  }
  .timeline::before { left: 17px; }
  .timeline-era {
    width: calc(100% - 44px);
    margin-left: 44px;
    padding: 22px 20px;
    transform: none !important;
  }
  .timeline-era::before {
    left: -35px;
    top: 30px;
    width: 12px;
    height: 12px;
  }
  .timeline-era:hover,
  .timeline-era:focus-visible { transform: none !important; }
  .timeline-date {
    display: block;
    margin: 0 0 7px;
    color: var(--gold-soft);
    font-family: "Noto Serif KR", Georgia, serif;
    font-size: 10px;
    letter-spacing: .05em;
  }

  /* 모바일 시대 배경 스토리 팝업 */
  .era-dialog-record { min-height: 100%; background: #0d0f16; }
  .era-dialog-record > header {
    padding: 54px 28px 28px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(216,181,110,.07), rgba(13,15,22,.96));
  }
  .era-dialog-record > header p {
    margin: 0 0 8px;
    color: var(--gold-soft);
    font-family: Georgia, serif;
    font-size: 10px;
    letter-spacing: .14em;
  }
  .era-dialog-record > header h2 {
    margin: 0 0 12px;
    padding-right: 54px;
    font-size: 38px;
    line-height: 1.15;
  }
  .era-dialog-record > header span {
    color: #9295a0;
    font-size: 13px;
    line-height: 1.7;
  }
  .era-dialog-body { padding: 30px 28px 44px; }
  .era-dialog-body .dropcap { margin-top: 0; }
  .era-dialog-body blockquote {
    margin: 28px 0 0;
    padding: 18px 20px;
    border-top: 1px solid rgba(216,181,110,.18);
    border-bottom: 1px solid rgba(216,181,110,.18);
    border-left: 2px solid var(--blood);
    color: #ded9ce;
    font-family: Georgia, "Noto Serif KR", serif;
    font-style: italic;
    line-height: 1.8;
  }
  .glossary-chip--static { cursor: default; }
}
