@font-face {
  font-family: "Heir of Light";
  src: url("../fonts/heir-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Heir of Light";
  src: url("../fonts/heir-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #050611;
  --bg-soft: #090b18;
  --surface: rgba(14, 17, 34, 0.88);
  --surface-solid: #101426;
  --text: #f7f5ff;
  --muted: #b8bbcc;
  --dim: #85899f;
  --line: rgba(228, 234, 255, 0.16);
  --line-strong: rgba(228, 234, 255, 0.3);
  --cyan: #6ce8ff;
  --violet: #a58aff;
  --rose: #ff72ad;
  --amber: #ffd27a;
  --danger: #ff6868;
  --prism: linear-gradient(115deg, var(--cyan), var(--violet) 36%, var(--rose) 68%, var(--amber));
  --font: "Heir of Light", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --content: min(1480px, calc(100vw - 80px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: rgba(165, 138, 255, 0.58) var(--bg);
  scrollbar-width: thin;
}

body,
body * {
  user-select: none;
  -webkit-user-select: none;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 24%, rgba(69, 218, 255, 0.09), transparent 28%),
    radial-gradient(circle at 91% 72%, rgba(255, 79, 162, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-touch-callout: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
}

h1,
h2,
h3,
h4,
p,
dt,
dd,
strong,
small,
button,
a {
  word-break: keep-all;
  overflow-wrap: break-word;
}

input,
textarea,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--violet);
  color: white;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  border: 3px solid var(--bg);
  border-radius: 999px;
  background: rgba(165, 138, 255, 0.58);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  border: 1px solid var(--cyan);
  background: var(--bg);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.rules-hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  padding: 116px 0 86px;
  background-image:
    linear-gradient(180deg, rgba(4, 5, 14, 0.66), rgba(4, 5, 14, 0.88)),
    linear-gradient(90deg, rgba(7, 9, 22, 0.55), transparent 48%, rgba(7, 9, 22, 0.55)),
    url("../images/bg.webp");
  background-position: center;
  background-size: cover;
}

.rules-hero::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  background:
    linear-gradient(rgba(139, 222, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 222, 255, 0.07) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

.rules-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 50% 48%, rgba(91, 213, 255, 0.17), transparent 30%),
    radial-gradient(circle at 42% 58%, rgba(164, 95, 255, 0.13), transparent 34%),
    linear-gradient(180deg, transparent 76%, var(--bg));
}

.minimal-nav {
  position: absolute;
  z-index: 8;
  top: 28px;
  left: 50%;
  width: var(--content);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  transform: translateX(-50%);
}

.title-mark {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-entry {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.nav-entry span {
  color: var(--cyan);
  font-size: 1.1rem;
}

.nav-entry:hover {
  color: white;
}

.rules-prism {
  position: relative;
  width: min(1100px, calc(100vw - 64px));
  overflow: hidden;
  padding: clamp(46px, 5vw, 68px) clamp(44px, 6vw, 82px) 38px;
  border: 1px solid rgba(74, 64, 92, 0.32);
  border-radius: 6px 14px 14px 6px;
  background:
    linear-gradient(
      90deg,
      rgba(52, 42, 31, 0.1),
      transparent 8%,
      transparent 47.4%,
      rgba(63, 48, 42, 0.09) 49%,
      rgba(255, 255, 255, 0.46) 50%,
      rgba(63, 48, 42, 0.09) 51%,
      transparent 52.6%,
      transparent 92%,
      rgba(52, 42, 31, 0.1)
    ),
    linear-gradient(145deg, #fffdf7, #ece6db);
  box-shadow:
    0 42px 110px rgba(0, 0, 0, 0.56),
    0 4px 0 rgba(255, 255, 255, 0.5) inset,
    0 -2px 0 rgba(76, 56, 42, 0.08) inset;
  color: #211d29;
}

.rules-prism::before {
  position: absolute;
  z-index: 0;
  top: 22px;
  bottom: 22px;
  left: 50%;
  width: 1px;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(52, 45, 67, 0.3), transparent);
  box-shadow:
    -10px 0 22px rgba(48, 37, 26, 0.09),
    10px 0 22px rgba(255, 255, 255, 0.38);
  pointer-events: none;
}

.rules-prism::after {
  position: absolute;
  z-index: 0;
  inset: 15px;
  border: 1px solid rgba(74, 64, 92, 0.12);
  border-radius: 3px 9px 9px 3px;
  content: "";
  pointer-events: none;
}

.rules-heading {
  position: relative;
  z-index: 2;
  text-align: center;
}

.rules-heading h1 {
  width: fit-content;
  margin: 0 auto;
  background: linear-gradient(120deg, #191722 10%, #674d7c 54%, #9b536f);
  background-clip: text;
  color: transparent;
  font-size: clamp(2.9rem, 5vw, 5rem);
  letter-spacing: -0.065em;
  line-height: 1.06;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rules-grid {
  position: relative;
  z-index: 2;
  margin-top: clamp(28px, 4vw, 44px);
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(118px, auto));
  column-gap: clamp(54px, 7vw, 92px);
}

.rules-grid article {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 24px 4px;
  border-bottom: 1px solid rgba(35, 32, 44, 0.13);
  background: none;
}

.rules-grid article:nth-child(2),
.rules-grid article:nth-child(4) {
  border-bottom: 0;
}

.rules-grid article > span {
  color: #765482;
  font-size: 0.92rem;
  font-weight: 700;
}

.rules-grid article.is-danger > span {
  color: #aa506c;
}

.rules-grid h2 {
  margin: 0 0 9px;
  color: #211d29;
  font-size: clamp(1.12rem, 1.5vw, 1.3rem);
  line-height: 1.35;
}

.rules-grid p {
  margin: 0;
  color: #696372;
  font-size: clamp(0.94rem, 1.15vw, 1.02rem);
  line-height: 1.72;
}

.prism-enter {
  position: relative;
  z-index: 2;
  width: fit-content;
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(84, 61, 99, 0.38);
  color: #4e3a5a;
  font-size: 0.94rem;
}

.prism-enter span {
  color: #8f5273;
  font-size: 1.2rem;
}

.showcase {
  position: relative;
  min-height: 100svh;
  padding: 92px 0 140px;
  background:
    linear-gradient(rgba(112, 138, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 138, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 10% 20%, rgba(108, 232, 255, 0.09), transparent 24%),
    radial-gradient(circle at 90% 64%, rgba(255, 114, 173, 0.08), transparent 26%),
    var(--bg);
  background-size: 96px 96px, 96px 96px, auto, auto, auto;
}

.showcase::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  content: "";
  background: var(--prism);
}

#content,
.tab-panel {
  scroll-margin-top: 110px;
}

.showcase-tabs {
  position: sticky;
  z-index: 50;
  top: 14px;
  width: var(--content);
  margin: 0 auto 78px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(8, 11, 24, 0.9), rgba(8, 11, 24, 0.9)) padding-box,
    linear-gradient(110deg, rgba(108, 232, 255, 0.46), rgba(165, 138, 255, 0.16), rgba(255, 114, 173, 0.42)) border-box;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  clip-path: polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px);
  backdrop-filter: blur(22px);
}

.showcase-tab {
  position: relative;
  min-height: 72px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

.showcase-tab:last-child {
  border-right: 0;
}

.showcase-tab::after {
  position: absolute;
  right: 23%;
  bottom: 0;
  left: 23%;
  height: 3px;
  content: "";
  background: var(--prism);
  box-shadow: 0 0 18px rgba(108, 232, 255, 0.55);
  opacity: 0;
  transform: scaleX(0);
  transition:
    opacity 0.25s ease,
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-tab:hover {
  background: rgba(255, 255, 255, 0.035);
  color: white;
}

.showcase-tab.is-active {
  background: linear-gradient(180deg, rgba(108, 232, 255, 0.08), rgba(165, 138, 255, 0.035));
  color: white;
}

.showcase-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.showcase-body {
  width: var(--content);
  margin: 0 auto;
}

.tab-panel {
  animation: panel-in 0.42s both ease-out;
}

.panel-title {
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.panel-title h2 {
  width: fit-content;
  margin: 0;
  background: var(--prism);
  background-clip: text;
  color: transparent;
  font-size: clamp(2.7rem, 4.4vw, 4.7rem);
  letter-spacing: -0.06em;
  line-height: 1.08;
  white-space: nowrap;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.panel-title > span {
  flex: 0 0 auto;
  padding: 11px 17px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.95rem;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.world-core {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.core-card {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  padding: clamp(34px, 5vw, 66px);
  border: 1px solid transparent;
  background:
    linear-gradient(145deg, rgba(18, 23, 43, 0.94), rgba(8, 11, 24, 0.96)) padding-box,
    linear-gradient(135deg, rgba(108, 232, 255, 0.36), rgba(165, 138, 255, 0.06), rgba(255, 114, 173, 0.28)) border-box;
  clip-path: polygon(26px 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%, 0 26px);
}

.core-card::before {
  position: absolute;
  right: -30px;
  bottom: -70px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(108, 232, 255, 0.12);
  content: "";
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(18deg);
}

.core-card--accent {
  background:
    linear-gradient(145deg, rgba(31, 19, 42, 0.95), rgba(10, 10, 25, 0.97)) padding-box,
    var(--prism) border-box;
}

.core-card > span {
  display: block;
  margin-bottom: 56px;
  color: var(--cyan);
  font-size: 1rem;
  font-weight: 700;
}

.core-card--accent > span {
  color: var(--rose);
}

.core-card strong {
  position: relative;
  display: block;
  font-size: clamp(1.75rem, 2.7vw, 2.65rem);
  letter-spacing: -0.05em;
  line-height: 1.2;
}

.core-card p {
  position: relative;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.heroine-toolbar,
.catalog-tools {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.heroine-toolbar > p,
.catalog-tools > p {
  margin: 0;
  color: var(--dim);
  font-size: 1rem;
}

.heroine-toolbar > p b,
.catalog-tools > p span {
  color: white;
  font-size: 1.12rem;
}

.drag-guide {
  margin-left: auto !important;
}

.drag-guide span {
  margin-right: 8px;
  color: var(--cyan);
}

.npc-carousel {
  --npc-card-width: clamp(420px, 47vw, 720px);
  position: relative;
  isolation: isolate;
}

.npc-edge {
  position: absolute;
  z-index: 20;
  top: calc(50% - 8px);
  width: 58px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(108, 232, 255, 0.42);
  background: linear-gradient(145deg, rgba(17, 22, 43, 0.94), rgba(7, 9, 20, 0.9));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.44),
    0 0 18px rgba(108, 232, 255, 0.12);
  color: white;
  cursor: pointer;
  font-size: 2.2rem;
  line-height: 1;
  transform: translateY(-50%);
  backdrop-filter: blur(16px);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  touch-action: manipulation;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    opacity 0.18s ease;
}

.npc-edge--prev {
  left: calc(50% - var(--npc-card-width) / 2 + 16px);
}

.npc-edge--next {
  right: calc(50% - var(--npc-card-width) / 2 + 16px);
}

.npc-edge:hover:not(:disabled),
.npc-edge:focus-visible {
  border-color: var(--cyan);
  background: rgba(108, 232, 255, 0.17);
}

.npc-edge:disabled {
  pointer-events: none;
  opacity: 0.2;
}

.npc-edge span {
  font-family: Arial, sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
}

.npc-track {
  --npc-card-width: inherit;
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--npc-card-width);
  gap: clamp(18px, 2vw, 30px);
  overflow-x: auto;
  padding: 28px calc(50% - var(--npc-card-width) / 2) 44px;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: calc(50% - var(--npc-card-width) / 2);
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  touch-action: pan-x pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
}

.npc-track.is-dragging {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
}

.npc-track::-webkit-scrollbar {
  display: none;
}

.npc-card {
  position: relative;
  aspect-ratio: 1.9 / 1;
  overflow: hidden;
  padding: 0;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box,
    linear-gradient(135deg, rgba(108, 232, 255, 0.38), rgba(165, 138, 255, 0.08), rgba(255, 114, 173, 0.35)) border-box;
  color: white;
  cursor: inherit;
  opacity: 0.14;
  scroll-snap-align: center;
  filter: saturate(0.35) brightness(0.58);
  transform: scale(0.88);
  clip-path: polygon(24px 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%, 0 24px);
  transition:
    opacity 0.22s ease,
    filter 0.22s ease,
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.28s ease;
}

.npc-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, transparent 38%, rgba(4, 6, 14, 0.92) 100%),
    linear-gradient(90deg, rgba(5, 7, 15, 0.48), transparent 48%);
  pointer-events: none;
}

.npc-card.is-neighbor {
  opacity: 0.46;
  filter: saturate(0.68) brightness(0.74);
  transform: scale(0.95);
}

.npc-card.is-active {
  z-index: 2;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.46),
    0 0 40px rgba(108, 232, 255, 0.1);
  opacity: 1;
  filter: none;
  transform: scale(1);
}

.npc-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.npc-track.is-dragging .npc-card {
  transition:
    opacity 0.12s linear,
    filter 0.12s linear,
    transform 0.16s ease-out;
}

.npc-card__meta {
  position: absolute;
  z-index: 2;
  right: 30px;
  bottom: 27px;
  left: 30px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
  pointer-events: none;
}

.npc-card__meta > span:first-child {
  min-width: 0;
}

.npc-card__meta small {
  display: block;
  margin-bottom: 7px;
  color: var(--cyan);
  font-size: 0.9rem;
}

.npc-card__meta strong {
  display: block;
  font-size: clamp(1.4rem, 2.3vw, 2.2rem);
  letter-spacing: -0.04em;
  line-height: 1.12;
  white-space: nowrap;
}

.npc-card__meta strong.is-long {
  font-size: clamp(1.12rem, 1.75vw, 1.68rem);
}

.npc-card__rank {
  flex: 0 0 auto;
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.npc-card__number {
  display: none;
}

.npc-progress {
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.npc-progress button {
  width: 28px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition:
    width 0.25s ease,
    background-color 0.25s ease;
}

.npc-progress button.is-active {
  width: 58px;
  background: var(--prism);
  box-shadow: 0 0 15px rgba(108, 232, 255, 0.3);
}

.npc-detail {
  position: relative;
  overflow: hidden;
  margin-top: 48px;
  padding: clamp(36px, 5vw, 70px);
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, rgba(17, 22, 42, 0.98), rgba(8, 10, 24, 0.97)) padding-box,
    var(--prism) border-box;
  clip-path: polygon(28px 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%, 0 28px);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.36);
}

.npc-detail::before {
  position: absolute;
  top: -120px;
  right: -40px;
  width: 400px;
  height: 400px;
  border: 1px solid rgba(108, 232, 255, 0.13);
  background: linear-gradient(145deg, rgba(108, 232, 255, 0.06), rgba(255, 114, 173, 0.035));
  content: "";
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(24deg);
  pointer-events: none;
}

.npc-detail__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 34px;
}

.npc-detail__eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 1rem;
}

.npc-detail__title {
  width: fit-content;
  margin: 0;
  background: var(--prism);
  background-clip: text;
  color: transparent;
  font-size: clamp(2.6rem, 4.6vw, 4.9rem);
  letter-spacing: -0.065em;
  line-height: 1.08;
  white-space: nowrap;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.npc-detail__title.is-long {
  font-size: clamp(2rem, 3.7vw, 3.9rem);
}

.npc-detail__role {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.npc-detail__tags {
  max-width: 420px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.npc-detail__tags span {
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.9rem;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.npc-detail__facts {
  position: relative;
  z-index: 2;
  margin: 45px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.npc-detail__facts div,
.npc-detail__facts .is-wide {
  grid-column: auto;
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.npc-detail__facts dt {
  margin-bottom: 11px;
  color: var(--rose);
  font-size: 0.92rem;
  font-weight: 700;
}

.npc-detail__facts dd {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.filter-chip {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.92rem;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.filter-chip:hover {
  border-color: var(--line-strong);
  color: white;
}

.filter-chip.is-active {
  border-color: rgba(108, 232, 255, 0.58);
  background: rgba(108, 232, 255, 0.09);
  color: white;
}

.filter-chip--boss.is-active {
  border-color: rgba(255, 104, 104, 0.62);
  background: rgba(255, 104, 104, 0.09);
}

.monster-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.monster-card,
.region-card {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box,
    linear-gradient(135deg, rgba(108, 232, 255, 0.3), rgba(165, 138, 255, 0.07), rgba(255, 114, 173, 0.26)) border-box;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  content-visibility: auto;
  contain-intrinsic-size: 330px;
}

.monster-card.is-boss {
  background:
    linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box,
    linear-gradient(135deg, rgba(255, 104, 104, 0.52), rgba(255, 114, 173, 0.12), rgba(255, 210, 122, 0.34)) border-box;
}

.monster-card__visual {
  position: relative;
  aspect-ratio: 1.9 / 1;
  overflow: hidden;
  background: #090b16;
}

.monster-card__visual::after,
.region-card__visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 45%, rgba(5, 7, 14, 0.35));
  pointer-events: none;
}

.monster-card img,
.region-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.monster-card__id,
.region-card__code {
  position: absolute;
  z-index: 2;
  top: 13px;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 7, 14, 0.7);
  color: white;
  font-size: 0.8rem;
  backdrop-filter: blur(10px);
}

.monster-card__id {
  left: 13px;
}

.region-card__code {
  right: 13px;
}

.monster-card__body {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
}

.monster-card__body small,
.region-card__body small {
  display: block;
  color: var(--dim);
  font-size: 0.86rem;
}

.monster-card__body h4 {
  margin: 6px 0 0;
  font-size: 1.18rem;
}

.monster-card__type {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  color: var(--cyan);
  font-size: 0.78rem;
}

.monster-card.is-boss .monster-card__type {
  color: #ff9e9e;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.region-card__visual {
  position: relative;
  aspect-ratio: 3.375 / 1;
  overflow: hidden;
  background: #090b16;
}

.region-card__body {
  padding: 22px 24px 26px;
}

.region-card__body small {
  color: var(--cyan);
}

.region-card__body h4 {
  margin: 6px 0 8px;
  font-size: 1.35rem;
}

.region-card__body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.site-footer {
  width: var(--content);
  min-height: 170px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
}

.site-footer strong {
  font-size: 1.08rem;
}

.site-footer a {
  color: var(--muted);
  font-size: 0.94rem;
}

.noscript {
  position: fixed;
  z-index: 100;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 15px 18px;
  border: 1px solid var(--danger);
  background: #17101b;
  text-align: center;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1240px) {
  :root {
    --content: min(1120px, calc(100vw - 54px));
  }

  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rules-grid article {
    min-height: 118px;
  }

  .monster-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --content: calc(100vw - 40px);
  }

  body {
    font-size: 17px;
  }

  .rules-hero {
    min-height: auto;
    padding: 120px 0 72px;
  }

  .rules-prism {
    width: calc(100vw - 38px);
    padding: 48px 34px 34px;
  }

  .rules-heading h1 {
    font-size: clamp(2.8rem, 8vw, 4.5rem);
  }

  .world-core {
    grid-template-columns: 1fr;
  }

  .core-card {
    min-height: 240px;
  }

  .npc-detail__top {
    align-items: start;
    flex-direction: column;
  }

  .npc-detail__tags {
    max-width: none;
    justify-content: flex-start;
  }

  .npc-detail__facts {
    grid-template-columns: 1fr;
  }

  .monster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  :root {
    --content: calc(100% - 28px);
  }

  .minimal-nav {
    top: 20px;
  }

  .title-mark {
    font-size: 1.02rem;
  }

  .nav-entry {
    font-size: 0.84rem;
  }

  .rules-hero {
    padding-top: 98px;
    background-position: 58% center;
  }

  .rules-prism {
    width: calc(100vw - 22px);
    padding: 36px 24px 28px;
    background:
      linear-gradient(90deg, rgba(52, 42, 31, 0.08), transparent 10%, transparent 90%, rgba(52, 42, 31, 0.08)),
      linear-gradient(145deg, #fffdf7, #ece6db);
  }

  .rules-prism::before {
    display: none;
  }

  .rules-heading h1 {
    font-size: clamp(2.55rem, 12vw, 3.8rem);
  }

  .rules-grid {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    margin-top: 28px;
  }

  .rules-grid article {
    min-height: 0;
    padding: 20px 2px;
  }

  .rules-grid article:nth-child(2) {
    border-bottom: 1px solid rgba(35, 32, 44, 0.13);
  }

  .showcase {
    padding-top: 64px;
  }

  .showcase-tabs {
    width: 100%;
    margin-bottom: 58px;
    grid-template-columns: repeat(4, minmax(132px, 1fr));
    overflow-x: auto;
    border-right: 0;
    border-left: 0;
    clip-path: none;
    scrollbar-width: none;
  }

  .showcase-tabs::-webkit-scrollbar {
    display: none;
  }

  .showcase-tab {
    min-height: 64px;
    font-size: 0.98rem;
  }

  .panel-title {
    margin-bottom: 34px;
  }

  .panel-title h2 {
    font-size: clamp(2.25rem, 10vw, 3.45rem);
  }

  .panel-title > span {
    padding: 8px 12px;
    font-size: 0.86rem;
  }

  .core-card {
    min-height: 220px;
    padding: 34px 28px;
  }

  .core-card > span {
    margin-bottom: 38px;
  }

  .heroine-toolbar {
    align-items: end;
    flex-wrap: wrap;
  }

  .drag-guide {
    order: 3;
    width: 100%;
    margin-left: 0 !important;
  }

  .npc-carousel {
    --npc-card-width: 82vw;
  }

  .npc-track {
    width: calc(100% + 28px);
    margin-inline: -14px;
  }

  .npc-edge {
    width: 46px;
    height: 60px;
    font-size: 1.75rem;
  }

  .npc-edge--prev {
    left: 5px;
  }

  .npc-edge--next {
    right: 5px;
  }

  .npc-card__meta {
    right: 18px;
    bottom: 17px;
    left: 18px;
  }

  .npc-card__meta small {
    margin-bottom: 4px;
    font-size: 0.78rem;
  }

  .npc-card__meta strong {
    font-size: 1.36rem;
  }

  .npc-card__meta strong.is-long {
    font-size: 1.08rem;
  }

  .npc-card__rank {
    font-size: 1.25rem;
  }

  .npc-detail {
    margin-top: 38px;
    padding: 32px 22px;
  }

  .npc-detail__title {
    font-size: clamp(2.35rem, 11vw, 3.8rem);
  }

  .npc-detail__title.is-long {
    font-size: clamp(1.55rem, 8vw, 2.6rem);
  }

  .npc-detail__role {
    font-size: 0.98rem;
  }

  .npc-detail__facts {
    margin-top: 32px;
  }

  .catalog-tools {
    display: block;
  }

  .catalog-tools > p {
    margin-top: 14px;
  }

  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 2px 9px;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .region-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    min-height: 145px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .rules-heading h1 {
    font-size: 2.55rem;
  }

  .rules-grid h2 {
    font-size: 1.18rem;
  }

  .rules-grid p {
    font-size: 1rem;
  }

  .monster-grid {
    grid-template-columns: 1fr;
  }

  .monster-card__body {
    padding: 18px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
