:root {
  --bg: #120b09;
  --panel: rgba(22, 13, 10, 0.72);
  --gold: #d9b766;
  --gold-soft: #f3d991;
  --red: #8f1f1f;
  --text: #f8ead0;
  --muted: #c9ad86;
  --line: rgba(217, 183, 102, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Serif KR", "Nanum Myeongjo", "Malgun Gothic", serif;
  background:
    linear-gradient(rgba(18, 9, 7, 0.50), rgba(18, 9, 7, 0.86)),
    radial-gradient(circle at 50% 20%, rgba(160, 42, 42, 0.35), transparent 36%),
    linear-gradient(135deg, #21100c 0%, #120b09 45%, #090606 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(8, 5, 4, 0.36), rgba(8, 5, 4, 0.72)),
    url("../images/bg/main-bg.webp") center/cover no-repeat;
  opacity: 0.38;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 18%, rgba(217, 183, 102, 0.10), transparent 20%),
    radial-gradient(circle at 78% 12%, rgba(216, 111, 122, 0.10), transparent 22%),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: auto, auto, 80px 80px, 80px 80px;
  z-index: -1;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(11, 7, 6, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 183, 102, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 183, 102, 0.22), rgba(143, 31, 31, 0.18));
  color: var(--gold-soft);
  font-weight: 700;
  box-shadow: 0 0 18px rgba(217, 183, 102, 0.16);
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.brand-title strong {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  text-shadow: 0 0 16px rgba(217, 183, 102, 0.35);
}

.brand-title span {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #ead4ad;
  font-size: 0.95rem;
  transition: 160ms ease;
}

.nav a:hover {
  border-color: rgba(217, 183, 102, 0.45);
  background: rgba(217, 183, 102, 0.08);
  color: #fff1c8;
}

.hero {
  min-height: 78vh;
  display: grid;
  place-items: center;
  padding: 72px 20px 56px;
}

.hero-panel {
  width: min(980px, 100%);
  padding: clamp(30px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(25, 14, 11, 0.78), rgba(53, 19, 17, 0.56));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(10px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.logo-main {
  margin: 0;
  font-size: clamp(3.2rem, 10vw, 8.4rem);
  letter-spacing: 0.12em;
  line-height: 0.95;
  color: #ffe6a6;
  text-shadow:
    0 2px 0 #7c3c1f,
    0 0 26px rgba(217, 183, 102, 0.38),
    0 0 52px rgba(143, 31, 31, 0.52);
}

.logo-sub {
  margin: 18px 0 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: #f3d991;
  letter-spacing: 0.08em;
}

.quote {
  max-width: 760px;
  margin: 32px auto 0;
  padding: 20px 24px;
  border-top: 1px solid rgba(217, 183, 102, 0.28);
  border-bottom: 1px solid rgba(217, 183, 102, 0.28);
  color: #ead8b8;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 126px;
  padding: 13px 18px;
  border: 1px solid rgba(217, 183, 102, 0.42);
  border-radius: 999px;
  background: rgba(21, 10, 8, 0.64);
  color: #ffe6a6;
  transition: 160ms ease;
}

.btn.primary {
  background: linear-gradient(135deg, #8f1f1f, #b0702e);
  border-color: rgba(255, 230, 166, 0.50);
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

main {
  padding: 0 20px 80px;
}

.section {
  width: min(1120px, 100%);
  margin: 0 auto 26px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.section h2 {
  margin: 0 0 18px;
  color: #ffe6a6;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  letter-spacing: 0.06em;
}

.section p {
  margin: 0 0 14px;
  color: #ead8b8;
  line-height: 1.9;
  font-size: 1.02rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.menu-card {
  min-height: 160px;
  padding: 22px;
  border: 1px solid rgba(217, 183, 102, 0.28);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(20, 10, 8, 0.82), rgba(82, 28, 24, 0.32));
  transition: 160ms ease;
}

.menu-card:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 183, 102, 0.58);
  background: linear-gradient(145deg, rgba(40, 16, 12, 0.86), rgba(130, 43, 38, 0.38));
}

.menu-card strong {
  display: block;
  margin-bottom: 10px;
  color: #ffe6a6;
  font-size: 1.22rem;
}

.menu-card span {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.94rem;
}

.site-footer {
  padding: 32px 20px 48px;
  text-align: center;
  color: #a78f6c;
  border-top: 1px solid rgba(217, 183, 102, 0.18);
  background: rgba(8, 5, 4, 0.66);
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .nav {
    justify-content: flex-start;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .logo-main {
    letter-spacing: 0.06em;
  }
}

.map-preview {
  margin-top: 26px;
  border: 1px solid rgba(217, 183, 102, 0.28);
  border-radius: 24px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.22);
  overflow-x: auto;
}

.map-placeholder {
  position: relative;
  min-width: 820px;
  min-height: 460px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(217, 183, 102, 0.32);
  background:
    radial-gradient(circle at 38% 38%, rgba(143, 31, 31, 0.30), transparent 24%),
    radial-gradient(circle at 68% 48%, rgba(217, 183, 102, 0.18), transparent 22%),
    linear-gradient(145deg, rgba(55, 33, 18, 0.92), rgba(21, 13, 9, 0.96));
}

.map-placeholder::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(217, 183, 102, 0.20);
  border-radius: 16px;
  pointer-events: none;
}

.map-title {
  position: absolute;
  top: 30px;
  left: 34px;
  color: #ffe6a6;
  font-size: 1.55rem;
  letter-spacing: 0.12em;
  text-shadow: 0 0 18px rgba(217, 183, 102, 0.35);
}

.map-subtitle {
  position: absolute;
  top: 72px;
  left: 36px;
  color: #c9ad86;
  font-size: 0.95rem;
}

.map-line {
  position: absolute;
  background: rgba(136, 173, 190, 0.34);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(136, 173, 190, 0.18);
}

.map-line.horizontal {
  height: 8px;
  transform: rotate(-8deg);
}

.map-line.horizontal.one {
  width: 620px;
  left: 120px;
  top: 190px;
}

.map-line.horizontal.two {
  width: 520px;
  left: 190px;
  top: 305px;
  transform: rotate(7deg);
}

.map-line.vertical {
  width: 8px;
  height: 230px;
  background: rgba(105, 144, 121, 0.34);
}

.map-line.vertical.one {
  left: 310px;
  top: 145px;
  transform: rotate(16deg);
}

.map-line.vertical.two {
  left: 590px;
  top: 165px;
  transform: rotate(-12deg);
}

.map-dot {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 230, 166, 0.42);
  border-radius: 999px;
  background: rgba(17, 9, 7, 0.76);
  color: #ffe6a6;
  font-size: 0.94rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.map-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9b766;
  box-shadow: 0 0 14px rgba(217, 183, 102, 0.72);
}

.dot-1 {
  left: 300px;
  top: 205px;
}

.dot-2 {
  left: 390px;
  top: 255px;
}

.dot-3 {
  left: 450px;
  top: 150px;
}

.dot-4 {
  left: 455px;
  top: 335px;
}

.dot-5 {
  left: 190px;
  top: 330px;
}

.dot-6 {
  left: 630px;
  top: 355px;
}

.legend {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.legend-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid rgba(217, 183, 102, 0.24);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
}

.legend-badge {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  color: #130b08;
}

.grade-a {
  background: #ffe6a6;
}

.grade-b {
  background: #d9b766;
}

.grade-c {
  background: #b98252;
}

.legend-item strong {
  display: block;
  margin-bottom: 6px;
  color: #ffe6a6;
  font-size: 1.05rem;
}

.legend-item p {
  margin: 0;
  color: #c9ad86;
  line-height: 1.7;
}

.faction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.faction-card {
  border: 1px solid rgba(217, 183, 102, 0.26);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(17, 9, 7, 0.82), rgba(58, 25, 19, 0.42));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.faction-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid rgba(217, 183, 102, 0.18);
  background: rgba(0, 0, 0, 0.18);
}

.faction-seal {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid rgba(255, 230, 166, 0.38);
  color: #ffe6a6;
  font-size: 1.55rem;
  font-weight: 700;
  background: rgba(143, 31, 31, 0.32);
  box-shadow: inset 0 0 18px rgba(217, 183, 102, 0.10);
}

.faction-head h3 {
  margin: 0 0 6px;
  color: #ffe6a6;
  font-size: 1.28rem;
}

.faction-head p {
  margin: 0;
  color: #c9ad86;
  font-size: 0.94rem;
  line-height: 1.5;
}

.faction-body {
  padding: 20px;
}

.faction-body p {
  margin-bottom: 16px;
}

.faction-body dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.faction-body dt {
  color: #f3d991;
  font-weight: 700;
}

.faction-body dd {
  margin: 2px 0 0;
  color: #d8c09b;
  line-height: 1.65;
}

.faction-wei .faction-seal {
  background: linear-gradient(145deg, rgba(94, 42, 42, 0.74), rgba(30, 20, 18, 0.80));
}

.faction-shu .faction-seal {
  background: linear-gradient(145deg, rgba(42, 94, 58, 0.62), rgba(30, 20, 18, 0.80));
}

.faction-wu .faction-seal {
  background: linear-gradient(145deg, rgba(42, 70, 110, 0.66), rgba(30, 20, 18, 0.80));
}

.faction-dong .faction-seal {
  background: linear-gradient(145deg, rgba(120, 35, 35, 0.76), rgba(30, 20, 18, 0.80));
}

.faction-yuan .faction-seal,
.faction-yuanshu .faction-seal {
  background: linear-gradient(145deg, rgba(132, 103, 42, 0.72), rgba(30, 20, 18, 0.80));
}

.faction-jing .faction-seal,
.faction-yi .faction-seal {
  background: linear-gradient(145deg, rgba(62, 92, 84, 0.66), rgba(30, 20, 18, 0.80));
}

.faction-liang .faction-seal {
  background: linear-gradient(145deg, rgba(116, 74, 40, 0.72), rgba(30, 20, 18, 0.80));
}

.faction-etc .faction-seal {
  background: linear-gradient(145deg, rgba(82, 72, 72, 0.76), rgba(30, 20, 18, 0.80));
}

@media (max-width: 820px) {
  .faction-grid {
    grid-template-columns: 1fr;
  }

  .faction-head {
    align-items: flex-start;
  }
}

.notice {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(217, 183, 102, 0.28);
  border-radius: 16px;
  background: rgba(143, 31, 31, 0.18);
  color: #f3d991 !important;
}

.svg-map-wrap {
  margin-top: 24px;
  border: 1px solid rgba(217, 183, 102, 0.28);
  border-radius: 24px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.svg-map-object {
  width: 100%;
  height: 760px;
  display: block;
  border: 0;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
}

@media (max-width: 860px) {
  .svg-map-object {
    height: 620px;
  }
}

@media (max-width: 560px) {
  .svg-map-object {
    height: 520px;
  }
}

.character-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 22px 0 24px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 183, 102, 0.24);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
}

.character-toolbar label {
  color: #ffe6a6;
  font-weight: 700;
}

.character-toolbar select {
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 183, 102, 0.34);
  border-radius: 12px;
  background: rgba(18, 10, 8, 0.92);
  color: #f8ead0;
  font-family: inherit;
}

.character-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.character-card {
  border: 1px solid rgba(217, 183, 102, 0.26);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(17, 9, 7, 0.82), rgba(58, 25, 19, 0.42));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.character-image-wrap {
  position: relative;
  min-height: 300px;
  background:
    radial-gradient(circle at 50% 35%, rgba(217, 183, 102, 0.12), transparent 26%),
    linear-gradient(145deg, rgba(48, 25, 20, 0.95), rgba(12, 7, 6, 0.95));
  border-bottom: 1px solid rgba(217, 183, 102, 0.20);
}

.character-image {
  width: 100%;
  height: 300px;
  display: block;
  object-fit: cover;
}

.character-image-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 230, 166, 0.72);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.character-info {
  padding: 20px;
}

.character-info h3 {
  margin: 0 0 8px;
  color: #ffe6a6;
  font-size: 1.25rem;
}

.character-meta {
  margin-bottom: 12px !important;
  color: #d9b766 !important;
  font-size: 0.94rem !important;
}

.character-code {
  margin-top: 14px !important;
  color: #a98e62 !important;
  font-size: 0.88rem !important;
}

.character-info p {
  color: #d8c09b;
  line-height: 1.75;
}

@media (max-width: 1000px) {
  .character-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .character-list {
    grid-template-columns: 1fr;
  }

  .character-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .character-toolbar select {
    width: 100%;
  }
}