@charset "utf-8";
/* -----------------------------------------------
	* 멤버란 디자인 스타일 정의
--------------------------------------------------
	- 최초 작성일 : 2021.08.15
	- 최초 작성자 : 아보카도
	- 최종 수정일 :
	- 최종 수정자 :
--------------------------------------------------*/

:root {
  /* docs.css 로컬 전용 값 (style.css에 대응 토큰 없음) */
  --tab-count: 3;
  --transition-speed: 0.45s;
  --c-black: #111111;

  --base-delay: 0.5;
  --reveal-speed: 0.5;
  --stagger: 0.1;
}

* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

/****************************************
	기본 레이아웃 정의
****************************************/

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-sanserif);
  background: var(--bg-paper);
  color: var(--color-grey-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0s;
}

.fix-layout:has(.docs-layout) {
  max-width: none;
}
.docs-layout #intro_page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* 배경(색+이미지)을 별도 레이어(::before)로 분리해서 z-index를 낮게 준다.
   #intro_page 자기 자신의 박스에 직접 background를 주면 쌓임순서가 auto(0)라
   .frame-dark(z-index:-99)보다 위에 그려져 프레임 장식을 완전히 가려버린다 */
.docs-layout #intro_page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #000;
  background-image: url("../img/base/main_background_dark.webp");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: -100;
}

/* 링 페이지에서는 gnb(메뉴)를 일시적으로 감춘다 */
body:has(#intro_page) #header #gnb {
  display: none;
}

.bg {
  display: flex;
  width: 100%;
  height: inherit;
  background-repeat: no-repeat;
  background-attachment: fixed;
  /* 기본(모바일 제외, 1920px 미만)은 좌우 100px로 줄여서 .contexts_container가
     지나치게 눌리지 않게 한다. 1920px 이상 넓은 화면에서만 원래의 넉넉한
     좌우 300px을 되살린다 (아래 미디어쿼리). 모바일(800px 이하)은 기존대로
     0으로 별도 처리되어 있음 */
  padding: 120px 100px;
}

/* .contexts_container를 담은 .bg만 위아래 여백을 줄인다 (다른 .bg 용도는 그대로) */
.bg:has(.contexts_container) {
  padding: 64px 100px;
}

@media screen and (min-width: 1920px) {
  .bg {
    padding: 120px 300px;
  }

  .bg:has(.contexts_container) {
    padding: 64px 300px;
  }
}

.bg.dark {
  pointer-events: none;
  position: relative;
}

/* 배경 이미지를 별도 레이어(::before)로 분리해서 z-index를 따로 줄 수 있게 한다.
   .bg.dark 자체에 음수 z-index를 주면 버튼 등 자식 콘텐츠까지 통째로
   .frame-dark보다 뒤로 밀려서 클릭이 막히기 때문 (지난 버그). */
.bg.dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/base/main_background_dark.webp");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: -100;
}

.bg .flex-grow {
  flex-grow: 1;
}

.bg.dark .center {
  color: var(--color-grey-200);
}

.scroll:has(.footer) {
  flex-direction: column;
}

/****************************************
	인덱스 내부 정의
****************************************/

/* :not(.contexts_container) — notice/index.php의 2번째 스크롤 패널처럼
   .scroll 바로 아래에 .contexts_container(헤더+본문 좌우 배치)가 오는 경우,
   이 규칙의 column 강제/800px 제한이 그 레이아웃을 깨뜨리기 때문에 제외한다 */
#index_page .scroll > div:not(.contexts_container) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  max-width: 800px;
  margin: 0 auto;
}



/****************************************
	기본 타이포 정의
****************************************/

p,
span,
b,
.contexts_container li {
  color: inherit;
  font-weight: inherit;
  word-break: keep-all;
  letter-spacing: -0.2px;
}

i,
em {
  color: inherit;
  font-weight: inherit;
  font-style: italic;
  font-family: inherit;
}

p,
.contexts_container li {
  padding-top: 8px;
  font-size: 15px;
  line-height: 1.8;
  font-weight: 400;
}

b {
  font-weight: 600;
}

strong {
  color: var(--color-primary-400);
  font-weight: 800;
}

h3 {
  color: var(--color-primary-300);
  font-size: 18px;
  font-weight: 600;
  text-align: left;
  padding-bottom: 8px;
  margin-top: 10px;
  padding-left: 40px;
  width: 100%;
}

hr {
  width: 100%;
  height: 1px;
  color: var(--color-grey-0);
}

/* 공용 스타일 선언 */
.center {
  display: block;
  white-space: pre-wrap;
  overflow: hidden;
  padding-bottom: 0.5rem;
  text-align: center !important;
  color: inherit;
}

.grey {
  color: var(--color-grey-400);
}

.serif {
  font-family: var(--font-serif);
}

/* 표준 여백 선언 */
.space20 {
  padding: 10px;
  display: block;
}

.space30 {
  padding: 15px;
  display: block;
}

/* 스크롤 스냅 선언 */

.scroll_container {
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  position: relative;
}

.scroll_container .scroll {
  width: 100%;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* 컨테이너 선언 */

.pagenormal {
  min-height: 100dvh;
}

.contexts_container {
  position: relative;
  box-sizing: border-box;
  backdrop-filter: blur(4px);
  background-color: rgba(var(--rc-paper-rgb), 0.8);
  box-shadow: none;
  border: 1px solid var(--rc-line);
  border-radius: 4px;
  overflow: hidden;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
}

.contexts_container .context_header {
  width: 200px;
  background-color: var(--color-grey-850);
  top: 0;
  order: 1;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.fix-layout {
  max-width: 100% !important;
  width: 100%;
}

/* --header-h/--header-w는 JS(페이지 하단 스크립트)가 .context_header의 실제
   렌더링 크기를 재서 채워준다 (container-type:size의 cqh/cqw가 flex stretch와
   조합에서 최종 크기를 제대로 못 읽어오는 경우가 있어 JS 측정으로 대체) */
.contexts_container .context_header img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  width: var(--header-h, 850px);
  height: var(--header-w, 200px);
  object-fit: cover;
  object-position: left center;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center;
}

.contexts_container .context_text {
  padding: 80px 80px 60px 80px;
  overflow-y: scroll;
}

.context_text .paragraph:not(:last-child) {
  margin-bottom: 60px;
}

.paragraph.credits .text1 {
  padding-bottom: 4px;
}
.paragraph.credits .textindent{
  padding-bottom: 4px;
  font-size: 14px;
}

.paragraph.credits .textindent + .text1 {
  padding-top: 4px;
}

/* ===== 좁은 화면: 헤더가 위로, 가로로 길게, 회전 초기화 ===== */
@media screen and (max-width: 800px) {
  .contexts_container {
    border-radius: 0;
  }

  .contexts_container:has(.context_header) {
    flex-direction: column;
  }

  .contexts_container .context_header {
    width: 100%;
    height: 120px;
    order: -1;
  }

  .contexts_container .context_header img {
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) rotate(0deg);
  }

  .contexts_container .context_text {
    padding: 40px 24px;
  }
}

.info-container {
  max-width: 730px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.info-container .center {
  padding: 0;
}

.info-container .commu-meta p{
  font-size: 14px;
  color:var(--color-grey-600);
}

.info-container .center strong {
  color: var(--color-grey-0);
}

.info-container .small {
  line-height: 1.8;
  font-size: 10px;
  padding: 0;
  margin: 0;
    color:var(--color-grey-400);
}

#index_page .notice_logo {
  flex-grow: 0;
  flex-shrink: 0;
  max-width: 500px;
  margin-bottom: 40px;
}

/* ===== 커뮤니티 로고 등장 연출 (enter.php와 동일) =====
   1) 타이포(.logo-text path)의 fill이 fade-in
   2) 이어서 타이포의 stroke가 그려짐 (pathLength="1"로 실제 path 길이와
      무관하게 4개 path 모두 동일한 dasharray/dashoffset 값을 쓸 수 있게 함)
   3) 2가 끝난 뒤 심볼(.logo-icon)이 fade-in (2.5s 시작 → 3.5s 완료)
   4) 로고 연출이 끝나는 3.5s 시점부터 .commu-meta → .commu-limit이 차례로 등장
   enter.php는 진입 연출(#enter_stage)이 끝나는 시점에 맞춰 JS로 is-revealed를
   붙이지만, 이 페이지는 진입 연출이 없어 처음부터 .info-container에 is-revealed를
   마크업에 넣어 페이지 로드 시 바로 재생되게 한다 */
.community-logo {
  display: inline-block;
  max-width: 480px;
  width: 70vw;
}

.community-logo-svg {
  display: block;
  width: 100%;
  height: auto;
}

.community-logo .logo-text path {
  fill-opacity: 0;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.community-logo .logo-icon {
  opacity: 0;
}

.info-container.is-revealed .logo-text path {
  animation:
    logo-fill-in 1s cubic-bezier(0.250, 0.460, 0.450, 0.940) both,
    logo-stroke-draw 1.5s ease-in-out 1s both;
}

.info-container.is-revealed .logo-icon {
  animation: logo-fade-in 1s cubic-bezier(0.250, 0.460, 0.450, 0.940) 2.5s both;
}

@keyframes logo-fill-in {
  from { fill-opacity: 0; }
  to { fill-opacity: 1; }
}

@keyframes logo-stroke-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes logo-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .community-logo .logo-text path {
    fill-opacity: 1;
    stroke-dashoffset: 0;
    animation: none;
  }
  .community-logo .logo-icon {
    opacity: 1;
    animation: none;
  }
}

/* animista.net "tracking-in-expand" 애니메이션. 로고 연출이 끝나는 3.5s
   시점부터 .commu-meta가 먼저, 뒤이어 .commu-limit이 등장한다 */
.commu-meta,
.commu-limit {
  opacity: 0;
}

.info-container.is-revealed .commu-meta {
  animation: tracking-in-expand 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) 3.5s both;
  margin-bottom: 16px;
}

.info-container.is-revealed .commu-limit {
  animation: tracking-in-expand 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) 4.3s both;
}

@keyframes tracking-in-expand {
  0% {
    letter-spacing: -0.5em;
    opacity: 0;
  }
  40% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .commu-meta,
  .commu-limit {
    opacity: 1;
    animation: none;
  }
}

.image_container {
  max-width: 900px;
  width: 100%;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  padding-bottom: 20px;
}

.indent-box {
    width: 100%;
    max-width: 800px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    background-color: rgba(0, 0, 0, 0.04);
    margin: 0 auto 16px;
    border-radius: 2px;
}

.logo-box {
  margin-top: 20px;
  margin-bottom: 10px;
}

/* 컨텐츠 선언 */

.sub-tit {
  max-width: 900px;
  padding-bottom: 40px;
  width: 100%;
}

.text1 {
  font-size: 15px;
  padding: 0 0 0.6rem 0;
  text-align: left;
}

.text2 {
  font-size: 14px;
  text-align: left;
  color: var(--color-grey-500);
}

.contexts_container p {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
}

p.textindent {
  padding: 0 0 0.6rem 0;
}

.textindent>* {
  padding-left: 20px;
}

p.textindent span::before {
  content: "-";
  margin-right: 0.5ch;
  color:inherit;
}

ul p.text1 {
  padding: 0 0 0.3rem 0 !important;
}

ol li.text1 {
  margin-left: 20px;
  padding: 0 0 0.3rem 12px !important;
  list-style: decimal;
}

ul li.text1 {
  margin-left: 20px;
  padding-left: 12px !important;
  list-style: circle;
  padding-bottom: 0.3rem !important;
}

.text1 a, .text2 a {
  color: var(--color-primary-300);
  border-bottom: 1px solid var(--color-primary-300);
}

.foundation_logo {
  height: 40px;
  max-width: 260px;
}

.foundation_list,
.dash_list,
.number_list {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 0 0 calc(0.6rem) 32px;
  text-align: left;
}

.foundation_list li, ul li .foundation_list li  {
  padding-left: 4px;
  list-style-type: upper-alpha;
  font-size: inherit;
}

.notice .foundation_list li {
  font-size: inherit;
}

.foundation_list li:first-child {
	padding-top:2px;
}

.dash_list li, ul li .dash_list li {
  padding-left: 4px;
  list-style-type: circle;
  font-size: inherit;
}

.number_list li, ul li .number_list li {
  padding-left: 4px;
  list-style-type: decimal;
  font-size: inherit;
}

.contexts_container ul li ul li {
  padding-top: 4px;
}

/* ===== 각주 툴팁 =====
   사용법: <span class="tooltip" aria-label="각주로 넣을 내용">본문 텍스트</span> 각주 내용은 aria-label에 그대로 적으면 됨  */
.tooltip {
  cursor: pointer;
  border-bottom: 1px dotted var(--color-primary-400);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  font-family: inherit;
  font-size: inherit;
}

.js-tooltip {
  position: fixed;
  width: max-content;
  max-width: 320px;
  padding: 8px 12px;
  background: rgba(17, 17, 17, 0.92);
  color: var(--color-grey-0);
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  font-family: var(--font-sanserif);
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  word-break: break-all;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  z-index: 9999;
}

.js-tooltip::after {
  content: "";
  position: absolute;
  border: 6px solid transparent;
}

/* 기본: 우측 정렬, 아래쪽을 향한 화살표. 화면 밖으로 넘칠 때 js가 is-left/is-below를 붙여준다 */
.js-tooltip:not(.is-left)::after {
  right: 10px;
}
.js-tooltip.is-left::after {
  left: 10px;
}
.js-tooltip:not(.is-below)::after {
  top: 100%;
  border-top-color: rgba(17, 17, 17, 0.92);
}
.js-tooltip.is-below::after {
  bottom: 100%;
  border-bottom-color: rgba(17, 17, 17, 0.92);
}

.js-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* data-tooltip-pos="right" : 글자 오른쪽 옆, 왼쪽을 가리키는 화살표 "< [ 내용 ]".
   위 기본 화살표 규칙(:not(.is-left)/:not(.is-below))과 명시도가 같아 뒤에 둔다 */
.js-tooltip.is-right {
  transform: translateX(-4px);
}
.js-tooltip.is-right.is-visible {
  transform: none;
}
.js-tooltip.is-right::after {
  top: 50%;
  bottom: auto;
  right: 100%;
  left: auto;
  margin-top: -6px;
  border-color: transparent;
  border-right-color: rgba(17, 17, 17, 0.92);
}

@media screen and (max-width: 800px) {
  .js-tooltip {
    max-width: 200px;
    font-size: 11px;
  }

  .paragraph.credits .textindent {
    text-align: left;
  }

    .paragraph.credits .textindent>* {
        font-size: 13px;
        word-break: break-word;
        padding: 0;
        width: 100%;
        margin-left: 20px;
        display: block;
    }
}

/* footer 선언 */

.bg .footer {
  flex-grow: 0 !important;
  gap: 12px;
}

.footer {
  margin: 40px 0 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.footer > a {
  opacity: 0;
  transform: translateY(10px);
  animation: footer-fade-in 0.6s ease forwards;
  animation-delay: var(--btn-delay, 2s);
  animation-play-state: paused;
}

/* 버튼끼리 시간차를 두고 순서대로 등장 */
.footer > a:nth-child(2) {
  animation-delay: calc(var(--btn-delay, 2s) + 0.15s);
}

.footer .btn_inner {
  cursor: inherit;
  display: flex;
  background-color: transparent;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 96px;
  color: inherit;
  font-family: var(--font-mono);
  transition: gap 0.2s;
}

.btn_solid {
  padding: 8px 14px 8px 20px;
  border-radius: 40px;
  background-color: var(--color-primary-400);
  border: 1px solid var(--color-primary-400);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background-color 0.2s;
  color: var(--color-grey-0);
  font-family: var(--font-mono);
}

.btn_solid:hover {
  background-color: var(--color-primary-300);
}

.btn_text {
  padding: 6px 8px 6px 12px;
  border-bottom: 1px solid var(--color-primary-400);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background-color 0.2s;
  color: var(--color-primary-400);
}

.btn_text:hover {
  color: var(--color-primary-300);
  border-bottom: 1px solid var(--color-primary-300);
}

.btn_text img {
  filter: invert(69%) sepia(79%) saturate(7320%) hue-rotate(317deg) brightness(103%) contrast(105%);
}

.btn_solid span,
.btn_text span {
  font-family: inherit;
  color: inherit;
}

/* 스토리 소스 */

@media screen and (max-width: 800px) {
  .contexts_container {
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    border: none;
  }

  p, span,
  .contexts_container p,
  .contexts_container li {
    font-size: 14px;
  }

  .bg, .bg:has(.contexts_container) {
    padding: 0;
  }

  .scroll {
    padding: 0 40px;
  }

  .scorll:has(.contexts_container) {
    padding: 0;
  }

  .bg .footer {
    margin-bottom: 80px !important;x
    gap: 16px;
  }

}

/* 인트로 애니메이션 */
.block-reveal {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}
.block-reveal span {
  -webkit-animation: show-text calc(var(--reveal-speed, 0.5) * 1s) calc(var(--delay) * 1s) steps(1) both;
  animation: show-text calc(var(--reveal-speed, 0.5) * 1s) calc(var(--delay) * 1s) steps(1) both;
  font-size: 20px;
  overflow: hidden;
  position: relative;
  display: inline-block;
  padding: 4px 8px;
}

.block-reveal span strong {
  -webkit-animation: show-text2 calc(var(--reveal-speed, 0.5) * 1s) calc(var(--delay) * 1s) steps(1) both;
  animation: show-text2 calc(var(--reveal-speed, 0.5) * 1s) calc(var(--delay) * 1s) steps(1) both;
  display: inline-block;
  font-weight: 600;
}

.block-reveal span:after {
  content: "";
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--color);
  position: absolute;
  -webkit-animation: block-reveal calc(var(--reveal-speed, 0.5) * 1s) calc(var(--delay) * 1s) both;
  animation: block-reveal calc(var(--reveal-speed, 0.5) * 1s) calc(var(--delay) * 1s) both;
}
@-webkit-keyframes block-reveal {
  0% {
    transform: translate(-110%, 0);
  }
  45%,
  55% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(110%, 0);
  }
}
@keyframes block-reveal {
  0% {
    transform: translate(-110%, 0);
  }
  45%,
  55% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(110%, 0);
  }
}
@-webkit-keyframes show-text {
  0% {
    color: transparent;
    background-color: transparent;
  }
  50%,
  100% {
    color: var(--color-grey-200);
    background-color: var(--color-primary-300);
  }
}
@keyframes show-text {
  0% {
    color: transparent;
    background-color: transparent;
  }
  50%,
  100% {
    color: var(--color-grey-200);
    background-color: var(--color-primary-300);
  }
}

@-webkit-keyframes show-text2 {
  0% {
    color: transparent;
  }
  50%,
  100% {
    color: var(--color-grey-0);
  }
}
@keyframes show-text2 {
  0% {
    color: transparent;
  }
  50%,
  100% {
    color: var(--color-grey-0);
  }
}

/* 글자 단위 페이드인 (world/index.php 두 번째 스크롤 섹션) */
/* 실제 글자 span 분리는 JS(world/index.php)에서 처리, 여기서는 등장 연출만 담당 */

.reveal-text .char {
  display: inline-block;
  opacity: 0;
  transform: translateX(10px);
  animation: char-fade-in 0.6s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.02s);
  animation-play-state: paused;
}

.reveal-text.in-view .char {
  animation-play-state: running;
}

/* 글자 애니메이션이 다 끝난 뒤(JS가 --btn-delay로 총 소요시간을 계산) 버튼이 시간차를 두고 뒤이어 등장 */
.reveal-text.in-view ~ .footer > a {
  animation-play-state: running;
}

@keyframes char-fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes footer-fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-text .char {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .footer > a {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* 스크롤 애니메이션 */

.scroll-downs {
  position: absolute;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  margin: auto;
  width: fit-content;
  height: fit-content;
}
.mousey {
  width: 4px;
  padding: 2px 8px;
  height: 32px;
  border: 2px solid var(--color-primary-400);
  border-radius: 25px;
  opacity: 0.5;
  box-sizing: content-box;
}
/* 모바일에서는 스크롤 유도 표시를 감춘다. 좁은 화면에서는 본문이 길어져
   bottom:80px 자리가 글자 위로 올라와, 분홍 타원이 문장 한가운데를 덮는다.
   손가락으로 넘기는 화면에서는 유도 표시 자체도 굳이 필요 없다. */
@media all and (max-width: 960px) {
  /* #index_page .scroll > div:not(.contexts_container) 가 이 요소에도
     display:flex 를 걸고 있는데 특이도가 (id 1 · class 2 · element 1) 이라
     단순 .scroll-downs 로는 못 이긴다. 그 규칙보다 무겁게 잡는다.
     (world/index.php · notice/index.php 둘 다 같은 구조) */
  .scroll-downs,
  #index_page .bg.scroll > div.scroll-downs {
    display: none;
  }
}

.scroller {
  width: 4px;
  height: 8px;
  border-radius: 25%;
  background-color: var(--color-primary-400);
  animation-name: scroll;
  animation-duration: 2.6s;
  animation-timing-function: cubic-bezier(0.15, 0.41, 0.69, 0.94);
  animation-iteration-count: infinite;
  margin-top: 3px;
}
@keyframes scroll {
  0% {
    opacity: 0;
  }
  10% {
    transform: translateY(2px);
    opacity: 1;
  }
  100% {
    transform: translateY(14px);
    opacity: 0;
  }
}

/****************************************
	인트로 (world/system, sytem/intro.php) 
****************************************/

body:has(.pagenormal) {
  align-items: flex-start;
  /* #body가 width:100%라 #header와 합쳐 폭이 100%를 넘는데, justify-content가
     기본값(center)이면 넘치는 만큼 좌우로 반씩 밀려나 #header(첫 요소)가
     화면 왼쪽 밖으로 사라진다 */
  justify-content: flex-start;
}

body:has(.pagenormal) #body {
  width: 100%;
}

body:has(.contexts_container) .pagenormal {
  max-height: 100dvh;
}

body:has(#intro_page) {
  position: relative;
}

body:has(#intro_page) .docs-layout {
  position: absolute;
  inset: 0;
}

/* body justify-content:center가 그대로라 #header(width:fit-content/auto)가
   가로로도 가운데로 몰려서, 그 안의 right:0 기준 요소(#gnb_control_box 등)가
   실제 화면 우측 끝과 어긋난다. #header를 폭 100%로 넓혀서 방지 */
body:has(#intro_page) #header,
body:has(#index_page) #header {
  /* width는 아래 position:fixed 규칙의 left:0;right:0으로 이미 100%가 되므로
     여기선 생략. pointer-events:none만 유지 (콘텐츠 클릭 막힘 방지용) */
  pointer-events: none;
}
/* 위 규칙이 #header 전체를 클릭 통과 처리하면서 그 안의 메뉴(gnb)까지
   같이 막혀버렸다. 실제 메뉴 요소에만 pointer-events를 되돌려 클릭 가능하게 함 */
body:has(#intro_page) #header #gnb,
body:has(#index_page) #header #gnb,
body:has(#intro_page) #header #gnb_control_box,
body:has(#index_page) #header #gnb_control_box {
  pointer-events: auto;
}

/****************************************
	세계관/시스템 진입 링 (world/intro.php, system/index.php)
	https://codepen.io/Yugta-Bista/pen/xbEgNbL 의 ring-area만 가져와 적용.
	원본은 좌측 nav+JS로 활성 노드를 전환하는 대시보드였지만, 여기서는
	각 노드가 바로 실제 페이지(1.php, 2.php...)로 이동하는 링크이므로
	JS 없이 PHP에서 각도를 계산해 좌표(%)를 미리 박아 넣는다.
	사용법: #intro_page 안에 .ring-area > .orbital > (svg, .ring-node × N, .ring-info)
****************************************/

/* 화면 모서리에 고정되는 원형 아이콘 버튼 (뒤로가기, 바로가기 등 공용) */
.corner_btn {
  position: fixed;
  top: 64px;
  z-index: 999;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  outline: 2px solid var(--color-primary-400);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s all ease-in;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.0);
}

.corner_btn:hover {
  box-shadow: none;
}

.corner_btn.pos-tl {
  left: 56px;
}

.corner_btn.pos-tr {
  right: 56px;
}

/* filter(invert/hue-rotate 등)로 아이콘 색을 바꾸면, hover 시 완전히 다른
   filter 함수 목록으로 바뀌어 브라우저가 매끄럽게 보간하지 못하고 뚝 끊긴다.
   mask-image로 아이콘의 실루엣만 가져오고 실제 색은 background-color로
   입히면, 진짜 색상값이라 어떤 색으로도 자연스럽게 transition된다 */
.corner_btn_icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  background-color: var(--color-primary-400);
  -webkit-mask-image: var(--icon-url);
  mask-image: var(--icon-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transition: background-color 0.2s ease-in;
}

.corner_btn:hover .corner_btn_icon {
  background-color: var(--color-grey-0);
}

/* world/1~3.php는 밝은 배경이라 흰색 hover가 안 보인다 */
body:has(.pagenormal) .corner_btn:hover .corner_btn_icon {
  background-color: var(--color-grey-800);
}

/* .tooltip의 기본 밑줄 장식은 버튼에는 필요 없다 */
.corner_btn.tooltip {
  border-bottom: none;
  cursor: pointer;
}

/* 뒤로가기 화살표는 방향을 반대로 뒤집어야 한다 */
.corner_btn.intro_back_btn .corner_btn_icon {
  transform: rotate(180deg);
}

#intro_page .ring-area {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding-top: 40px;
}

/* ===== 배경 장식: 회전하는 3D 큐브 필드 =====
   .ring-area(오빗)보다 아래 z-index에 깔려 화면 정중앙에서 꽉 차게 재생된다.
   큐브 위치는 무작위 대신 PHP에서 미리 흩어놓은 고정 좌표(translate3d)를 쓴다 */
.data-cubes {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  perspective: 550px;
  pointer-events: none;
  transform: scale(2.5);
}

.cube-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateX(0deg) rotateY(0deg);
  animation: cubeRotate 20s infinite linear;
}

@keyframes cubeRotate {
  0% {
    transform: translate(-50%, -50%) rotateX(0deg) rotateY(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotateX(360deg) rotateY(360deg);
  }
}

.cube {
  position: absolute;
  width: 50px;
  height: 50px;
  transform-style: preserve-3d;
}

.cube-face {
  position: absolute;
  width: 50px;
  height: 50px;
  background-color: color-mix(in srgb, var(--cube-accent, var(--color-primary-400)) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--cube-accent, var(--color-primary-400)) 20%, transparent);
  backface-visibility: visible;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cube.secondary {
  --cube-accent: var(--color-secondary-400);
}

.cube.tertiary {
  --cube-accent: var(--color-tertiary-400);
}

.cube.white {
  --cube-accent: #ffffff;
}

.cube-face.front {
  transform: translateZ(25px);
}
.cube-face.back {
  transform: rotateY(180deg) translateZ(25px);
}
.cube-face.right {
  transform: rotateY(90deg) translateZ(25px);
}
.cube-face.left {
  transform: rotateY(-90deg) translateZ(25px);
}
.cube-face.top {
  transform: rotateX(90deg) translateZ(25px);
}
.cube-face.bottom {
  transform: rotateX(-90deg) translateZ(25px);
}

@media (prefers-reduced-motion: reduce) {
  .cube-container {
    animation: none;
  }
}

/* 링 뒤 은은한 방사형 글로우 */
#intro_page .ring-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(var(--rc-accent-rgb), 0.2) 0%, rgba(var(--rc-accent-rgb), 0.08) 45%, transparent 70%);
  pointer-events: none;
}

.orbital {
  position: relative;
  width: min(760px, 82vmin);
  height: min(760px, 82vmin);
  opacity: 0;
  animation: ring-fade-in 1s ease 0.2s forwards;
}

.orbital svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring-ticks {
  fill: none;
  stroke: rgba(var(--rc-accent-rgb), 0.2);
  stroke-width: 1;
  stroke-dasharray: 2 6.2;
  animation: ring-spin-slow 60s linear infinite;
  transform-origin: 230px 230px;
}

.ring-dashes-2 {
  fill: none;
  stroke: rgba(var(--rc-accent-rgb), 0.4);
  stroke-width: 0.8;
  stroke-dasharray: 1 4.5;
  animation: ring-spin-slow 40s linear infinite reverse;
  transform-origin: 230px 230px;
}

.ring-main {
  fill: none;
  stroke: rgba(var(--rc-accent-rgb), 0.9);
  stroke-width: 1.5;
  filter: none;
}

.ring-inner {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 0.75;
}

.ring-inner-circ-1 {
  fill: none;
  stroke: rgba(var(--rc-accent-rgb), 0.07);
  stroke-width: 0.8;
}

.ring-inner-circ-2 {
  fill: none;
  stroke: rgba(var(--rc-accent-rgb), 0.04);
  stroke-width: 0.6;
}

.ring-arc {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 80 1146;
  animation: ring-arc-spin 6s ease-in-out infinite;
  transform-origin: 230px 230px;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}

.ring-arc-color {
  fill: none;
  stroke: var(--color-primary-400);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 140 1086;
  stroke-dashoffset: -50;
  animation: ring-arc-spin-color 6s ease-in-out infinite;
  transform-origin: 230px 230px;
  filter: none;
}

.ring-tick-major {
  stroke: rgba(var(--rc-accent-rgb), 0.55);
  stroke-width: 1.5;
}

.ring-tick-minor {
  stroke: rgba(var(--rc-accent-rgb), 0.18);
  stroke-width: 0.8;
}

.crosshair line,
.crosshair circle {
  stroke: rgba(var(--rc-accent-rgb), 0.25);
  stroke-width: 0.8;
  fill: none;
}

@keyframes ring-arc-spin {
  0% { stroke-dashoffset: 0; }
  50% { stroke-dashoffset: -400; }
  100% { stroke-dashoffset: -1226; }
}

@keyframes ring-arc-spin-color {
  0% { stroke-dashoffset: -50; }
  50% { stroke-dashoffset: -500; }
  100% { stroke-dashoffset: -1276; }
}

@keyframes ring-spin-slow {
  to { transform: rotate(360deg); }
}

@keyframes ring-fade-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== 노드 (1, 2, 3 ...) : 각 페이지로 바로 이동하는 링크 ===== */
.ring-node {
  position: absolute;
  width: 21%;
  height: 21%;
  transform: translate(-50%, -50%);
  text-decoration: none;
}

.ring-node-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-grey-800);
  border: 1.5px solid rgba(var(--rc-accent-rgb), 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  position: relative;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  box-shadow: 0 0 0 6px rgba(var(--rc-accent-rgb), 0.05), inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.ring-node-inner::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--rc-accent-rgb), 0.2);
  animation: ring-spin-slow 12s linear infinite;
}

.ring-node:hover .ring-node-inner {
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 8px rgba(var(--rc-accent-rgb), 0.12), inset 0 0 20px rgba(0, 0, 0, 0.5);
  transform: scale(1.08);
}

.ring-node-label {
    font-size: clamp(10px, 1.3vmin, 12px);
    letter-spacing: 0.03em;
    color: var(--color-grey-400);
    text-align: center;
    word-break: keep-all;
    line-height: 1.1;
    transition: color 0.2s;
    font-family: var(--font-sanserif);
}

.ring-node-title {
    font-family: var(--font-mono);
    font-size: clamp(13px, 2vmin, 18px);
    font-weight: 600;
    letter-spacing: -0.08em;
    color: var(--color-grey-100);
    text-align: center;
    word-break: keep-all;
    line-height: 1;
    transition: color 0.2s;
    text-transform: uppercase;
}

.ring-node:hover .ring-node-label {
  color: rgba(var(--rc-accent-rgb), 0.7);
}

.ring-node:hover .ring-node-title {
  color: var(--color-primary-400);
}

/* ===== 중앙 타이틀 ===== */
.ring-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.ring-info-label {
  font-size: clamp(11px, 1.4vmin, 13px);
  text-transform: uppercase;
  color: var(--color-grey-500);
}

.ring-info-title {
    font-family: var(--font-mono, mono);
    font-size: clamp(32px, 8vmin, 58px);
    font-weight: 700;
    color: var(--color-primary-400);
    text-transform: uppercase;
}

/* ===== 세계관 인트로 : 가운데 시대(2부/1부) 탭 + 좌우 화살표 =====
   .ring-info 는 system/index.php · loading.php 와 같이 쓰므로 여기서는
   #intro_page 안에서만 바꾼다. */
/* 윗줄 : 라벨 / 아랫줄 : [이전] 제목 [다음] */
#intro_page .ring-era-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#intro_page .ring-era-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vmin, 20px);
}

/* 한글 제목(절멸의 도래·영광의 시대)은 다른 링 페이지 제목(SYSTEM 같은
   영문 한 단어)과 달리 고정폭 서체에 한글 글꼴이 없어 글자 사이가 벌어져
   보였다. 사이트 기본 산세리프로 쓰고, 화살표까지 안쪽 원(지름의 약 52%)에
   들어가는 크기로 줄인다 */
#intro_page .ring-era-info .ring-info-title {
  font-family: var(--font-sanserif);
  font-size: clamp(24px, 5vmin, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
}

#intro_page .ring-era[hidden],
#intro_page .ring-node[hidden] {
  display: none !important;
}

/* --- 시대 전환 애니메이션 (world/intro.php 의 스크립트가 클래스를 붙인다) ---
   1) .era-leaving : 지금 보이는 글자·노드를 잠깐 흐리게 지운다
   2) 새로 보이는 것은 누른 방향(data-era-dir)에서 밀려 들어온다.
   fill-mode 를 backwards 로만 두어서 끝난 뒤에는 원래 스타일로 돌아간다 —
   노드는 hover 때 .ring-node-inner 에 transform 을 쓰므로 both 로 두면 hover
   확대가 안 먹는다. .ring-node 자체는 위치 잡는 데 transform 을 써서
   건드리지 않고 안쪽(.ring-node-inner)만 움직인다. */
#intro_page.era-leaving .ring-era:not([hidden]),
#intro_page.era-leaving .ring-node:not([hidden]) {
  opacity: 0;
  transition: opacity 0.18s ease;
}

#intro_page[data-era-dir="next"] .ring-era:not([hidden]) {
  animation: ring-era-in-next 0.38s ease backwards;
}
#intro_page[data-era-dir="prev"] .ring-era:not([hidden]) {
  animation: ring-era-in-prev 0.38s ease backwards;
}
/* --i : 그 시대 안에서 몇 번째 노드인지(world/intro.php 가 넣는다). 하나씩
   조금씩 늦게 떠오르게 한다 */
#intro_page[data-era-dir] .ring-node:not([hidden]) .ring-node-inner {
  animation: ring-era-node-in 0.42s ease backwards;
  animation-delay: calc(var(--i, 0) * 0.05s);
}

@keyframes ring-era-in-next {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ring-era-in-prev {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ring-era-node-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #intro_page .ring-era,
  #intro_page .ring-node-inner {
    animation: none !important;
  }
}

/* .ring-info 는 링 노드 클릭을 가리지 않게 pointer-events 를 꺼 두었다.
   화살표만 다시 켠다 */
#intro_page .ring-era-btn {
  position: relative;
  pointer-events: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(28px, 4vmin, 36px);
  height: clamp(28px, 4vmin, 36px);
  padding: 0;
  border: 1px solid rgba(var(--rc-accent-rgb), 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-grey-300);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

/* style.css 의 전역 `* { color: ... }` 가 svg·path 에도 걸려서, 그냥 두면
   currentColor 가 버튼 색이 아니라 어두운 회색이 된다 */
#intro_page .ring-era-btn svg,
#intro_page .ring-era-btn svg * {
  color: inherit;
}

#intro_page .ring-era-btn svg {
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
  width: 60%;
  height: 60%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#intro_page .ring-era-btn:hover:not(:disabled),
#intro_page .ring-era-btn:focus-visible {
  border-color: var(--color-primary-400);
  color: var(--color-primary-400);
  box-shadow: none;
  outline: none;
}

/* 갈 곳이 없는 쪽 화살표는 아예 숨긴다. 자리는 그대로 두어서 제목이
   한쪽으로 쏠리지 않고 원 가운데에 머문다 */
#intro_page .ring-era-btn:disabled {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .orbital {
    opacity: 1;
    animation: none;
    transform: none;
  }
  .ring-ticks,
  .ring-dashes-2,
  .ring-arc,
  .ring-arc-color,
  .ring-node-inner::before {
    animation: none;
  }
}

/* ===== 좁은 화면: 원형 배치 대신 세로 목록으로 =====
   장식용 원/눈금/아크 SVG는 세로 목록과 어울리지 않아 감추고, 노드는 절대
   좌표(PHP가 넣어준 인라인 left/top) 대신 일반 흐름으로 순서대로 쌓는다.
   ring-info는 마크업상 노드들보다 뒤에 있어서 order로 맨 앞으로 당긴다 */
@media screen and (max-width: 800px) {
  .orbital {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    gap: 20px;
  }

  .orbital svg {
        overflow: hidden;
        transform: scale(1.5);
  }

  .ring-info {
    position: static;
    transform: none;
    order: -1;
    margin-bottom: 48px;
  }

  .ring-node {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    /* 화면 폭을 꽉 채우면 가장자리에 물려 답답하다. 좌우 여백을 남기고
       가운데 정렬한다(예전 max(400px, 92vw) 는 390px 화면에서 400px 이
       그대로 잡혀 좌우로 넘쳤다). */
    width: 100% !important;
    max-width: min(400px, 82vw);
    height: 62px !important;
    border-radius: 999px;
  }

  /* 라벨은 왼쪽, 제목은 오른쪽으로 밀어 계기판처럼 정돈한다 */
  .ring-node-inner {
    border-radius: inherit;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px 0 22px;
    box-shadow: 0 0 0 4px rgba(var(--rc-accent-rgb), 0.05), inset 0 0 20px rgba(0, 0, 0, 0.5);
  }

  /* 회전하는 점선 테두리는 원일 때나 자연스럽다. 알약 모양에서는
     타원이 빙글빙글 도는 꼴이 되므로 끈다. */
  .ring-node-inner::before {
    display: none;
  }

  .ring-node-label {
    font-size: 12px;
    letter-spacing: 0.02em;
  }

  .ring-node-title {
    font-size: 17px;
    letter-spacing: 0;
  }

  /* 오른쪽 끝 얇은 시그니처 눈금 — 누를 수 있는 줄이라는 표시 */
  .ring-node-inner::after {
    content: "";
    flex: 0 0 auto;
    width: 14px;
    height: 2px;
    background: linear-gradient(
      to right,
      var(--color-primary-400) 0 55%,
      var(--color-secondary-400) 55% 80%,
      var(--color-tertiary-400) 80% 100%
    );
    opacity: 0.85;
    transition: width 0.25s;
  }

  .ring-node:hover .ring-node-inner::after {
    width: 22px;
  }
}

/****************************************
	준비중 안내 (loading.php)
	system/index.php 의 링 UI 를 그대로 쓰고, 가운데 문구만 갈아끼운다
****************************************/

/* 다른 링 페이지는 제목이 전부 대문자 한 단어(SYSTEM·TERRE)라 uppercase 를
   걸어뒀지만, 여기는 'Loading' 을 쓴 그대로 보여준다 */
.loading-page .loading-title {
  text-transform: none;
  /* 다른 링 제목(SYSTEM 등)은 700 이지만 여기는 얇게. JetBrains Mono 가
     100~800 가변 폰트라 합성 없이 제대로 얇아진다 */
  font-weight: 300;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.loading-page .loading-dots {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* 점이 하나씩 쌓였다가 한 번에 사라진다 : (없음) → . → .. → ...
   각자 따로 깜빡이게 하면 가운데가 빈 채로 오른쪽 점만 남는 순간이 생겨
   글자에서 떨어져 나간 것처럼 보인다. 그래서 셋 다 같은 주기를 쓰고
   켜지는 시점만 다르게 하고, 꺼지는 시점은 주기 끝으로 통일한다. */
.loading-page .loading-dots i {
  font-style: normal;
  font-family: inherit;
  color: inherit;
  padding-left: 0.12em;
  opacity: 0.2;
  animation-duration: 1.6s;
  animation-timing-function: step-end;
  animation-iteration-count: infinite;
}

.loading-page .loading-dots i:nth-child(1) { animation-name: loading-dot-1; }
.loading-page .loading-dots i:nth-child(2) { animation-name: loading-dot-2; }
.loading-page .loading-dots i:nth-child(3) { animation-name: loading-dot-3; }

/* 꺼진 점도 완전히 지우지 않고 흐리게 남긴다. 투명해지면 자리는 그대로
   차지한 채 글자만 사라져서, 'Loading' 이 링 중심에서 왼쪽으로 밀린
   것처럼 보인다(작은 화면일수록 티가 난다) */
@keyframes loading-dot-1 {
  0%, 24.9%  { opacity: 0.2; }
  25%, 100%  { opacity: 1; }
}

@keyframes loading-dot-2 {
  0%, 49.9%  { opacity: 0.2; }
  50%, 100%  { opacity: 1; }
}

@keyframes loading-dot-3 {
  0%, 74.9%  { opacity: 0.2; }
  75%, 100%  { opacity: 1; }
}

/* 로그인 계기판의 '> IDENTIFY YOURSELF.' 와 같은 말투 */
.loading-page .loading-note {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.5vmin, 13px);
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--color-grey-400);
  white-space: nowrap;
}

/* 링 지름이 작아지는 좁은 화면에서는 'Loading . . .' 이 링 밖으로 삐져
   나온다. 다른 링 페이지 제목(SYSTEM·TERRE)보다 글자 수가 많아서다. */
/* 모바일에서 글자가 원 중심을 벗어나 보이던 문제.
   링 노드가 있는 인트로 페이지는 800px 이하에서 .orbital 을 세로 flex 로
   바꿔 노드를 아래로 쌓고 .ring-info 를 그 위에 세운다. 그런데 그 순간
   <svg> 가 flex 아이템이 되면서 height 가 0 으로 무너진다 — viewBox 만
   있고 width/height 속성이 없는 SVG 의 알려진 동작이다. 그래서 링이 제
   박스 밖(아래쪽)에 그려지고, 글자는 높이 0 인 박스를 기준으로 놓여
   둘이 따로 노는 것처럼 보였다.
   이 페이지에는 링 노드가 없어 그 배치 자체가 필요 없다. 데스크톱과 같은
   구조(정사각형 박스 + 그 안을 채우는 svg + 가운데 절대배치)를 쓰되
   크기만 줄인다. */
@media screen and (max-width: 800px) {
  .loading-page .orbital {
    display: block;
    width: min(340px, 76vmin);
    height: min(340px, 76vmin);
  }

  .loading-page .orbital svg {
    width: 100%;
    height: 100%;
    transform: none;
  }

  .loading-page .ring-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    order: 0;
    margin-bottom: 0;
  }
}

@media all and (max-width: 640px) {
  .loading-page .loading-title {
    /* 'Loading . . .' 은 다른 링 제목(SYSTEM)보다 길어서, 7vmin 이면
       링 테두리에 거의 닿는다. 서체가 조금만 달라져도 밖으로 나간다 */
    font-size: clamp(20px, 6.2vmin, 28px);
  }

  /* 링 지름이 180px 안팎까지 줄어드는 화면. 기본 크기로는 문구가 링에
     거의 딱 붙어서, 서체가 조금만 달라져도 밖으로 삐져나온다.
     한 단계 줄여 여유를 둔다 */
  .loading-page .loading-note {
    margin-top: 12px;
    font-size: 10px;
    letter-spacing: 0.04em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-page .loading-dots i {
    opacity: 1;
    animation: none;
  }
}

/****************************************
	타임라인 (world/timeline.php)
****************************************/

body:has(#timeline) {
  align-items: flex-start;
  /* #body가 width:100%라 #header와 합쳐 폭이 100%를 넘는데, justify-content가
     기본값(center)이면 넘치는 만큼 좌우로 반씩 밀려나 #header(첫 요소)가
     화면 왼쪽 밖으로 사라진다 */
  justify-content: flex-start;
}

body:has(#timeline) #body {
  width: 100%;
}

/* docs.css 페이지들은 각기 다른 방식으로 body의 flex 정렬을 우회하고 있어서
   (.docs-layout을 absolute로 빼거나, #body를 100%로 늘리거나) #header가
   페이지 구조마다 다르게 밀리는 문제가 반복됐다. body의 flex 정렬과 아예
   무관하도록 #header 자체를 뷰포트 기준 고정 위치로 못박아 근본적으로 해결. */
body:has(#index_page) #header,
body:has(#intro_page) #header,
body:has(#timeline) #header,
body:has(.pagenormal) #header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
}

body:has(#index_page) {
  position: relative;
  /* .docs-layout이 absolute로 빠지면서 body의 남은 flex 자식(#header)이
     align-items:center 때문에 화면 세로 중앙으로 밀리는 문제 방지.
     모바일에서 #header가 relative+height:0으로 "문서 맨 위"에 있어야
     하는데 중앙에 가 있으면 그 안의 햄버거 버튼도 같이 밀려버린다. */
  align-items: flex-start;
}

body:has(#index_page) .docs-layout {
  position: absolute;
  inset: 0;
}

#timeline {
  --tl-line: rgba(255, 255, 255, 0.16);
  --tl-gutter: 200px; /* 세기 표기가 놓이는 왼쪽 칸 */
  --tl-gap: 48px; /* 세로선과 본문 사이 */
  --tl-dot: 11px;
  --tl-point: var(--color-primary-400, var(--color-primary-400));

  width: 100%;
  padding: 0 40px 200px;
  position: relative;
}

/* position:fixed로 뷰포트에 직접 못박는다. background-attachment:fixed 방식은
   #timeline처럼 뷰포트보다 훨씬 긴 요소에 적용하면 안드로이드 Chrome/삼성
   인터넷에서 배경 자체가 아예 그려지지 않거나 스크롤 중 사라지는 버그가 있다.
   바로 아래 ::after(그라데이션 페이드)는 이미 position:fixed라 문제 없었다 */
/* 프레임 장식(tail.php 의 .frame-dark)은 이 페이지에서 위아래 페이드(::after,
   z-index 50)에 묻히지 않게 z-index 60 으로 본문 위에 올라가 있어서 본문을 덮었다.
   그래서 그림을 둘로 나눈다.
   - 오른쪽 세로 장식(위·가운데) : 화면 가운데까지 내려와 본문과 겹치므로
     이 ::before(배경, 본문 뒤)로 옮긴다
   - 위·아래 가로 막대 : .frame-dark 에 그대로 남긴다(본문 위). 그 자리는 원래
     본문이 어둡게 지워지는 띠라 덮어도 읽는 데 지장이 없고, 페이드에 묻혀
     흐려지지도 않는다
   프레임 안쪽 여백(32px, 960px 이하 20px)은 style.css 의 .frame 과 같다. */
#timeline {
  --tl-frame: 32px;
}

#timeline::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    url("../img/base/frame_right_top_dark.png"),
    url("../img/base/frame_right_middle.png"),
    url("../img/base/main_background_dark.webp");
  background-position:
    right var(--tl-frame) top var(--tl-frame),
    right var(--tl-frame) center,
    center center;
  background-size: auto, auto, cover;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: -100;
}

/* .frame-dark 에는 가로 막대 셋만 남긴다(상자가 이미 32px 안쪽이라 막대가
   그 끝에서 잘린다). 오른쪽 세로 장식은 위 ::before 로 옮겼다 */
html body:has(#timeline) .frame-dark {
  background-image:
    url("../img/base/frame_left_top.png"),
    url("../img/base/frame_left_bottom.png"),
    url("../img/base/frame_right_bottom_dark.png");
  background-position:
    left top,
    left bottom,
    right bottom;
}

/* 디자인관리자가 자동 생성하는 html.single::before 는 밝은 배경(#f2f2f2 +
   main_background.webp)을 z-index:-1 로 깔아둔다. 음수끼리는 -1 이 -100 보다
   위라, 바로 위 #timeline::before(-100)의 어두운 배경을 통째로 덮어버린다.
   #timeline::before 를 0 이상으로 올리면 이번엔 본문 글자를 가리므로,
   타임라인 페이지에 한해 밝은 레이어 쪽을 끈다(다른 페이지는 건드리지 않는다). */
html:has(#timeline)::before {
  display: none;
}

#timeline::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: linear-gradient(to bottom, #141414 0, transparent 120px, transparent calc(100% - 120px), #141414 100%);
}

@media all and (max-width: 960px) {
  #timeline {
    --tl-frame: 20px;
  }
}

/* ===== 머리말 ===== */

.tl_intro {
  max-width: 1000px;
  margin: 0 auto;
  padding: 22dvh 0 12dvh var(--tl-gutter);
}

.tl_kicker {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 13px;
  letter-spacing: 0.32em;
  color: var(--tl-point);
}

.tl_title {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-weight: 700;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: var(--color-grey-0);
}

/* ===== 세기 (1뎁스) ===== */

.tl_track {
  max-width: 1000px;
  margin: 0 auto;
}

.tl_era {
  display: grid;
  grid-template-columns: var(--tl-gutter) 1fr;
  align-items: start;
}

.tl_era_head {
  position: sticky;
  top: 18dvh;
  padding-right: 28px;
  text-align: right;
  /* sticky 상태에서도 다음 세기 블록에 밀려 겹치지 않게 */ 
  z-index: 1;
}

.tl_era_num {
  display: block;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-weight: 700;
  font-size: 60px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.5);
}

.tl_era_unit {
  display: block;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-grey-500);
}

/* ===== 년도 (2뎁스) ===== */

.tl_years {
  position: relative;
  border-left: 1px solid var(--tl-line);
  padding-left: var(--tl-gap);
}

/* 마지막 세기 아래로 세로선이 툭 끊기지 않도록 서서히 지운다 */
.tl_era:last-child .tl_years::after {
  content: "";
  position: absolute;
  left: -1px;
  bottom: 0;
  width: 1px;
  height: 140px;
  background: linear-gradient(to bottom, rgba(10, 11, 16, 0) 0%, var(--color-grey-700) 100%);
}

.tl_year {
  position: relative;
  padding: 0 0 60px;
}

.tl_era:last-child .tl_year:last-child {
  padding-bottom: 0;
}

/* 세로선 위에 얹히는 점 : 세로선 중심 = 본문 왼쪽에서 (--tl-gap + 선두께 절반) 만큼 바깥 */
.tl_year::before {
  content: "";
  position: absolute;
  top: 6px;
  left: calc(-1 * (var(--tl-gap) + 0.5px) - var(--tl-dot) / 2);
  width: var(--tl-dot);
  height: var(--tl-dot);
  border-radius: 50%;
  background-color: var(--color-grey-800);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-sizing: border-box;
}

.tl_year_num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--color-grey-0);
  padding-left: 0;
}

/* 아직 밝혀지지 않은 자릿수 */
.tl_mask {
  color: var(--color-grey-500);
  letter-spacing: 0.02em;
}

.tl_events {
  display: flex;
  flex-direction: column;
}

.tl_event {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-grey-50);
  word-break: keep-all;
}

.tl_event.secret {
  color: var(--color-grey-400);
}

.tl_event::before {
  content: "";
  position: absolute;
  top: 0.85em;
  left: 0;
  width: 9px;
  height: 1px;
  background-color: rgba(var(--rc-paper-rgb), 0.35);
}

.tl_event b {
  color: var(--color-grey-0);
  font-weight: 700;
}

/* ===== 현재 시점 (2276) ===== */

.tl_now .tl_year_num {
  color: var(--tl-point);
}

.tl_now::before {
  background-color: var(--tl-point);
  border-color: var(--tl-point);
  box-shadow: 0 0 0 5px rgba(var(--rc-accent-rgb), 0.18);
}

.tl_now .tl_event {
  color: var(--color-grey-0);
  font-weight: 700;
}

.tl_now .tl_event.secret {
  color: var(--color-primary-400);
  font-weight: 400;
}

/* ===== 2부 : END OF TERRE (world/timeline.php 의 $tl_part2) =====
   1부는 분홍, 2부는 노랑. 같은 규칙을 쓰고 --tl-point 만 바꿔 끼운다. */

.tl_part2 {
  --tl-point: rgb(255, 230, 0);
  --tl-point-soft: rgba(255, 230, 0, 0.18);
  --tl-faces-w: 96px; /* 두상 4개(겹쳐서)가 들어가는 폭 : 30 + 22 x 3 */
  --tl-month-w: 34px; /* 월만 적는다(가장 긴 것 : 12월) */
}

.tl_part_num span {
  display: block;
  /* 전역 `* { color }` 가 안쪽 span 을 칠해 버려서 윤곽선 글씨가 안 된다 */
  color: transparent;
}

.tl_part2 .tl_part_num {
  font-size: 34px;
  line-height: 1.05;
  -webkit-text-stroke: 0.6px rgba(255, 230, 0, 0.8);
}

.tl_part2 .tl_era_unit {
  color: rgba(255, 230, 0, 0.6);
}

.tl_part2 .tl_year::before {
  border-color: rgba(255, 230, 0, 0.55);
}

.tl_part2 .tl_now::before {
  box-shadow: 0 0 0 5px var(--tl-point-soft);
}

.tl_part2 .tl_event::before {
  background-color: rgba(255, 230, 0, 0.45);
}

/* 한 줄 : 월 · 두상 · 내용. 월·두상이 없는 줄도 칸 자리를 지켜 줄이 맞는다 */
.tl_rec {
  display: grid;
  grid-template-columns: var(--tl-month-w) var(--tl-faces-w) minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
  padding-top: 3px;
  padding-bottom: 3px;
}

/* style.css 의 전역 `* { color }` 가 상속을 끊어 놓아서 칸마다 색을 준다 */
.tl_rec .tl_text {
  color: var(--color-grey-50);
      margin-left: 4px;
}

.tl_now .tl_rec .tl_text {
  color: var(--color-grey-0);
}

.tl_rec .tl_text .tooltip {
  color: inherit;
}

/* 메모(공용 툴팁)의 점선 밑줄도 2부 색으로 */
.tl_part2 .tooltip {
  border-bottom-color: var(--tl-point);
}

.tl_month {
  font-family: var(--font-sanserif);
  font-size: 13px;
  line-height: 20px; /* 내용 첫 줄(14px x 1.8)과 높이를 맞춘다 */
  white-space: nowrap;
  color: var(--tl-point);
}

/* 두상 : 30px 원, 여럿이면 8px씩 겹쳐 가로로. 첫 두상도 -8px 를 받으므로
   그만큼 안쪽 여백으로 메운다(줄이 넘어가도 똑같이 맞는다) */
.tl_faces {
  display: flex;
  flex-wrap: wrap;
  row-gap: 2px;
  padding-left: 8px;
  margin-top: -2.5px; /* 30px 원을 내용 첫 줄(25px) 가운데에 */
}

.tl_face {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-left: -8px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-grey-800);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tl_face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.tl_face_none {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  color: var(--color-grey-300);
}

.tl_face:hover,
.tl_face:focus-visible {
  z-index: 2;
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--tl-point);
  outline: none;
}

.tl_face.is_on {
  z-index: 1;
  box-shadow: 0 0 0 2px var(--tl-point);
}

/* 두상 필터 */
#timeline .tl_era[hidden],
#timeline .tl_year[hidden],
#timeline .tl_event[hidden],
.tl_filterbar[hidden] {
  display: none !important;
}

/* 화면 아래 고정 표시줄. #timeline::after(위아래 그라데이션, z-index 50) 위로 */
.tl_filterbar {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 9px;
  border: 1px solid rgba(255, 230, 0, 0.45);
  border-radius: 999px;
  background: rgba(14, 14, 16, 0.94);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.tl_filter_face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-grey-800);
}

.tl_filter_face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.tl_filter_name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-grey-0);
}

.tl_filter_count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-grey-400);
}

.tl_filter_clear {
  padding: 6px 14px;
  border: 1px solid rgba(255, 230, 0, 0.6);
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  color: rgb(255, 230, 0);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tl_filter_clear:hover,
.tl_filter_clear:focus-visible {
  background: rgb(255, 230, 0);
  color: #141414;
  outline: none;
}

/* ===== 스크롤 등장 ===== */

/* 지원하지 않는 브라우저에서는 처음부터 그냥 보인다 */
@supports (animation-timeline: view()) {
  .tl_year {
    animation: tl-reveal linear both;
    animation-timeline: view();
    animation-range: entry 8% entry 62%;
  }
}

@keyframes tl-reveal {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl_year {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ===== 좁은 화면 ===== */

@media screen and (max-width: 800px) {
  #timeline {
    --tl-gutter: 0px;
    --tl-gap: 26px;
    padding: 0 20px 120px 40px;
  }

  .tl_intro {
    padding: 10dvh 0 5dvh;
  }

  .tl_title {
    font-size: 40px;
  }

  /* 세기 표기를 년도 위로 올려 가로로 눕힌다 */
  .tl_era {
    display: block;
  }

  .tl_era_head {
    position: static;
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 0 0 22px;
    text-align: left;
  }

  .tl_era_num {
    font-size: 40px;
  }

  .tl_era_unit {
    padding-top: 0;
  }

  .tl_year {
    padding-bottom: 32px;
  }

  .tl_now .tl_events {
    padding: 6px 18px 18px;
  }

  /* 2부 머리표는 한 줄로 눕힌다 */
  .tl_part_num span {
    display: inline;
  }

  .tl_part2 .tl_part_num {
    font-size: 28px;
  }

  /* 좁은 화면 : 세 칸을 나란히 두면 내용 칸이 너무 좁다.
     윗줄 [월 · 두상], 아랫줄 [내용] 으로 바꾸고, 빈 칸은 접는다 */
  .tl_rec {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "month faces"
      "text  text";
    column-gap: 8px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .tl_rec .tl_faces { grid-area: faces; margin-top: 0; }
  .tl_rec .tl_month { grid-area: month; align-self: center; }
  .tl_rec .tl_text  { grid-area: text; }

  .tl_rec .tl_faces:empty,
  .tl_rec .tl_month:empty {
    display: none;
  }

  /* 월이 없는 줄은 첫 칸을 아예 없애서 두상이 왼쪽에 붙게 */
  .tl_rec:has(.tl_month:empty) {
    grid-template-columns: 0 minmax(0, 1fr);
    column-gap: 0;
  }

  .tl_filterbar {
    bottom: 16px;
    max-width: calc(100vw - 32px);
  }
}

/****************************************
	텍스트 블록
****************************************/

.place {
  --place-seg1: 64%;
  --place-seg2: 84%;
  --place-seg3: 94%;
  width: 100%;
  text-align: left;
  padding: 20px 0 28px;
  max-width: 840px;
  margin: 0 auto;
}

.sub-tit + .place {
  padding-top: 0;
}

.place:has(+ .number_list) {
  padding-bottom: 12px;
}

.place:not(:has(.place_catch, .place_meta)):has(+ .text1) {
  padding-bottom: 12px;
}

.place:not(:has(.place_catch)) .place_meta {
  margin-top: 0;
}

.place:has(.place_meta):not(:has(.place_catch)) {
  padding-bottom: 14px;
}

.sub-tit + .place h3 {
  margin-top: 0;
}

.place + .number_list {
  padding-left: 20px;
}

/* ===== 지역명 ===== */

.place .place_name {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--color-grey-800);
  padding: 0;
}

.place .place_en {
  font-weight: 400;
  color: var(--color-grey-500);
  letter-spacing: -0.4px;
  margin-left: 8px;
}

/* ===== 장식 언더바 ===== */

.place .place_bar {
  padding: 0;
  margin: initial;
  margin-top: 8px;
  height: 2px;
  max-width: 440px;
  width: 50%;
  background: linear-gradient(
    to right,
    var(--color-primary-400) 0 var(--place-seg1),
    var(--color-secondary-400) var(--place-seg1) var(--place-seg2),
    var(--color-tertiary-400) var(--place-seg2) var(--place-seg3),
    var(--c-black) var(--place-seg3) 100%
  );
}

/* ===== 캐치프레이즈 ===== */

.place .place_catch {
  padding: 0;
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-primary-400);
  word-break: keep-all;
}

.place .place_catch_grey {
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-grey-500);
  word-break: keep-all;
}

/* ===== 메타 ===== */

.place .place_meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 8px 10px;
  margin-top: 8px;
}

.place_meta dt {
  min-width: var(--place-tag-w);
  padding: 5px 10px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-grey-900);
  text-transform: uppercase;
  background-color: var(--color-secondary-400);
}

.place_meta dd {
  font-size: 12px;
  line-height: 1;
  color: var(--color-grey-600);
  padding-top: 2px;
}

/* ===== 어두운 배경(.bg.dark) 위에서 ===== */

.bg.dark .place_name {
  color: var(--color-grey-0);
}

.bg.dark .place_en {
  color: var(--color-grey-300);
}

.bg.dark .place_catch_grey {
  color: var(--color-grey-400);
}

.bg.dark .place_meta dd {
  color: var(--color-grey-200);
}

/* ===== 좁은 화면 ===== */

@media screen and (max-width: 800px) {
  .place {
    --place-tag-w: 72px;
    padding-bottom: 20px;
  }

  .place_name {
    font-size: 21px;
  }

  .place_en {
    font-size: 15px;
  }

  .place_catch {
    font-size: 15px;
    margin-top: 18px;
  }

  .place_meta {
    gap: 6px 10px;
    margin-top: 18px;
  }
}

/****************************************
	유형표 (system/1.php 특성표 등)
	table이 아니라 div 그리드로 구성. 행마다 이름/타입/설명 3칸이 기본이며,
	타입 칸이 필요 없는 표는 .type_row에 .no-type을 추가하고 .type_type을
	마크업에서 빼면 2칸짜리로 자동 전환된다. 설명 아래 스탯 한 줄(.type_stat)도
	필요 없으면 그냥 빼면 됨.
****************************************/

.type_table {
  width: 100%;
  max-width: 840px;
  margin: 12px auto 12px;
  border: 1px solid var(--color-grey-100);
  border-radius: 4px;
  overflow: hidden;
}

.type_row {
  display: grid;
  grid-template-columns: 110px 90px 1fr;
  /* align-items:center이면 각 셀이 콘텐츠 높이만큼만 차지해 배경색이 행 전체를
     못 채운다. stretch(기본값)로 셀 자체는 행 높이를 꽉 채우고, 텍스트 중앙
     정렬은 각 셀 내부에서 flex로 처리한다 */
  align-items: stretch;
}

.type_row.no-type {
  grid-template-columns: 110px 1fr;
}

.type_row:nth-child(odd) {
  background-color: rgba(var(--rc-paper-rgb), 0.4);
}

.type_row:nth-child(even) {
  background-color: rgba(0,0,0,0.02);
}

.type_row + .type_row {
  border-top: 1px solid var(--color-grey-50);
}

.type_name {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-grey-900);
  text-align: center;
  background-color: var(--color-secondary-400);
  word-break: keep-all;
}

.grey_table .type_name {
  background-color: var(--color-grey-0);
  color: var(--color-primary-400);
}

.type_type {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary-400);
  text-align: center;
  word-break: keep-all;
}

.type_desc {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 24px 8px 16px;
}

.type_desc p {
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-grey-800);
  word-break: keep-all;
}

.type_desc b {
  color: var(--color-grey-900);
}

.type_desc .type_stat {
  margin-top: 2px;
  font-size: 13px;
  color: var(--color-grey-500);
}

@media screen and (max-width: 800px) {
  .type_row {
    grid-template-columns: 88px 76px 1fr;
  }

  .type_row.no-type {
    grid-template-columns: 88px 1fr;
  }

  .type_name,
  .type_type {
    padding: 12px 6px;
    font-size: 13px;
  }

  .type_desc {
    padding: 12px 14px 12px 4px;
  }

  .type_desc p {
    font-size: 13px;
  }

  .type_stat {
    font-size: 12px;
  }
}

/****************************************
	소속별 특수 스킬표 (system/2.php)
	바깥 틀(테두리/둥근모서리/max-width)은 .type_table을 그대로 재사용하고,
	행/셀만 새로 짠다 (가운데 칸이 노란 배지라 .type_row의 교차 배경과는 다름).
	사용법: <div class="type_table"><div class="skill_row">...
****************************************/

.skill_row {
  display: grid;
  grid-template-columns: 132px 140px 1fr;
  align-items: stretch;
  background-color: var(--color-grey-50);
}

.skill_row + .skill_row {
  border-top: 1px solid var(--color-grey-100);
}

.skill_name {
  display: flex;
  align-items: center;
  padding: 16px 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-grey-900);
  word-break: keep-all;
}

.skill_badge {
  /* 셀 전체를 꽉 채우는 사각형(행 높이/칸 너비 모두 edge-to-edge) */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  background-color: var(--color-secondary-400);
  text-align: center;
}

.skill_badge_en {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.4);
  letter-spacing: 0.02em;
}

.skill_badge_kr {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-grey-900);
}

.skill_desc {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 16px 16px 20px;
}

.skill_desc p {
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-grey-800);
  word-break: keep-all;
}

.skill_desc b {
  color: var(--color-grey-900);
}

@media screen and (max-width: 800px) {
  .skill_row {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 6px;
  }

  .skill_name {
    padding: 0;
  }

  .skill_badge {
    margin: 0;
    width: fit-content;
  }

  .skill_desc {
    padding: 0;
    font-size: 13px;
  }
}
/****************************************
	턴 진행 순서표 (system/2.php)
	8칸 그리드. 윗줄은 단계 이름, 아랫줄은 그 구간이 무엇인지(대기 / 1턴 /
	이하반복)를 칸을 합쳐 표시한다. 바깥 틀은 .type_table 을 그대로 재사용.
	사용법: <div class="type_table turn_table"><div class="turn_row turn_head">...
****************************************/

.turn_table {
  max-width: 800px;
}

.turn_row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  /* .type_row 와 같은 이유로 stretch : 셀이 행 높이를 꽉 채워야 배경색이
     칸 전체를 덮는다. 높이는 padding 이 아니라 행의 min-height 로 잡고,
     글자 중앙 정렬은 각 셀 내부 flex 가 처리한다 */
  align-items: stretch;
}

.turn_head, .turn_body {
  min-height: 42px;
}

.skill_row:nth-child(odd) {
  background-color: rgba(var(--rc-paper-rgb), 0.4);
}

.skill_row:nth-child(even) {
  background-color: rgba(0,0,0,0.02);
}

.turn_cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  word-break: keep-all;
  color: var(--color-grey-700);
  background-color: var(--color-grey-0);
}

/* ===== 윗줄 : 단계 이름 ===== */

/* 전투 바깥 단계(조우 / 정비 / 개시 / 반복 지점)는 회색 바탕 */
.turn_cell.step {
  background-color: var(--color-grey-100);
}

/* 색은 .step 뒤에 두어 회색칸에서도 글자색이 살아남게 한다 */
.turn_cell.angel {
  color: var(--color-tertiary-400);
}

.turn_cell.ally {
  color: var(--color-primary-400);
}

/* ===== 아랫줄 : 구간 표시 (칸 합침) ===== */

.turn_wait {
  grid-column: span 3;
  background-color: var(--color-grey-50);
  color: var(--color-grey-400);
  font-weight: 400;
}

.turn_main {
  grid-column: span 4;
  background-color: var(--color-secondary-400);
  color: var(--color-grey-900);
  font-size: 14px;
}

.turn_repeat {
  grid-column: span 1;
  background-color: var(--color-grey-50);
  color: var(--color-grey-400);
  font-weight: 400;
  font-size: 13px;
}

/* ===== 좁은 화면 : 8칸을 줄이지 않고 가로 스크롤 ===== */
@media screen and (max-width: 800px) {
  .turn_table {
    overflow-x: auto;
  }

  .turn_row {
    min-width: 620px;
  }

  .turn_cell {
    font-size: 12px;
  }
}
/****************************************
	포지션 카드 (system/2.php)
	.pos_card 가 공유 템플릿이고, 뒤에 붙는 포지션 클래스
	(.prydwen / .juggernaut / .vanquisher / .ambrosine)가
	--pos-color 하나만 갈아끼워 색을 바꾼다. 노란 띠처럼 글자를 어둡게
	해야 하는 경우만 --pos-title-text 를 함께 지정한다.

	행 높이는 padding 이 아니라 셀 stretch 로 채운다. 특히 '분류' 칸은
	그룹(패시브/액티브) 전체 높이를 덮어야 하므로 그리드 + stretch 로 짰다.
	사용법: <div class="pos_card prydwen"><div class="pos_title">...
****************************************/

.pos_card {
  /* 포지션별로 덮어쓰는 값 */
  --pos-color: var(--color-tertiary-400);
  --pos-title-text: var(--color-grey-0);
  /* 분류/스킬명 색은 네 포지션이 공통으로 쓴다 */
  --pos-passive: var(--color-tertiary-400);
  --pos-active: var(--color-primary-400);

  width: 100%;
  max-width: 840px;
  margin: 12px auto 28px;
  border: 1px solid var(--color-grey-100);
  border-radius: 4px;
  overflow: hidden;
}

/* ===== 포지션별 색 ===== */

.pos_card.prydwen {
  --pos-color: var(--color-tertiary-400);
}

.pos_card.juggernaut {
  --pos-color: var(--color-primary-400);
}

.pos_card.vanquisher {
  --pos-color: var(--color-secondary-400);
  /* 노란 바탕에 흰 글자는 대비가 안 나온다 */
  --pos-title-text: var(--color-grey-900);
}

.pos_card.ambrosine {
  /* style.css 토큰에 없는 색이라 값을 직접 둔다 */
  --pos-color: #5ac125;
}

/* ===== 제목 띠 ===== */

.pos_title {
  padding: 13px 16px;
  text-align: center;
  font-size: 22px;
  line-height: 1.4;
  background-color: var(--pos-color);
  color: var(--pos-title-text);
  word-break: keep-all;
}

.pos_title b {
  font-weight: 700;
}

.pos_en {
  font-weight: 400;
  padding-left: 2px;
}

/* ===== 소개문 ===== */

.pos_intro {
  padding: 18px 24px;
  background-color: rgba(var(--rc-paper-rgb), 0.4);
  text-align: center;
}

.pos_intro p {
  padding: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-grey-700);
  word-break: keep-all;
}

/* ===== 배율 두 줄 ===== */

.pos_stat {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: stretch;
  border-top: 1px solid var(--color-grey-100);
}

.pos_stat_name {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--color-grey-500);
}

.pos_stat_desc {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--color-grey-800);
  text-align: center;
  word-break: keep-all;
}

/* ===== 스킬표 ===== */

.pos_skill {
  border-top: 3px solid var(--pos-color);
}

.pos_head {
  display: grid;
  grid-template-columns: 80px 100px 1fr 80px;
  align-items: stretch;
  background-color: var(--color-grey-100);
}

.pos_head > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  font-size: 13px;
  color: var(--color-grey-600);
}

/* 분류 칸(70px)이 그룹 전체 높이를 덮도록 그리드 + stretch */
.pos_group {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: stretch;
  border-top: 1px solid var(--color-grey-100);
}

.pos_kind {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-grey-0);
  text-align: center;
  word-break: keep-all;
  background: var(--pos-active);
}

.pos_group.passive .pos_kind {
  background-color: var(--pos-passive);
}

.vanquisher .pos_group.passive .pos_kind {
  background-color: var(--pos-color);
  color: var(--color-grey-900);
}
.vanquisher .pos_group.passive .pos_sname {
  color: #7f6000;
}

.ambrosine .pos_group.passive .pos_kind {
  background-color: var(--pos-color);
}
.ambrosine .pos_group.passive .pos_sname {
  color: var(--pos-color);
}


/* 헤더의 2~4열과 폭을 맞춘다 */
.pos_item {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  align-items: stretch;
}

.pos_item:nth-child(odd) {
  background-color: rgba(var(--rc-paper-rgb), 0.4);
}

.pos_item:nth-child(even) {
  background-color: rgba(0,0,0,0.02);
}

.pos_item + .pos_item {
  border-top: 1px solid var(--color-grey-100);
}

.pos_sname {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  word-break: keep-all;
}

.pos_group.passive .pos_sname {
  color: var(--pos-passive);
}

.pos_group.active .pos_sname {
  color: var(--pos-active);
}


.pos_sdesc {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-grey-800);
  word-break: keep-all;
}

.pos_note {
  font-size: 13px;
  color: var(--color-grey-500);
}

.pos_cool {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--color-grey-600);
  text-align: center;
  word-break: keep-all;
}

/* ===== 좁은 화면 ===== */

@media screen and (max-width: 800px) {
  .pos_title {
    font-size: 16px;
  }

  .pos_intro {
    padding: 14px 16px;
  }

  .pos_intro p,
  .pos_stat_desc {
    font-size: 13px;
  }

  .pos_stat {
    grid-template-columns: 92px 1fr;
  }

  .pos_head {
    grid-template-columns: 54px 68px 1fr 62px;
  }

  .pos_group {
    grid-template-columns: 54px 1fr;
  }

  .pos_item {
    grid-template-columns: 68px 1fr 62px;
  }

  .pos_sname {
    font-size: 13px;
  }

  .pos_sdesc {
    padding: 9px 10px;
    font-size: 12px;
  }

  .pos_cool,
  .pos_kind {
    font-size: 12px;
  }
}
/****************************************
	커맨드 목록표 / 커맨드 양식표 (system/2.php)
	바깥 틀은 .type_table 을 그대로 재사용한다.
	행 높이는 padding 이 아니라 셀 stretch 로 채워, 구분 칸의 배경색이
	설명이 몇 줄이든 행 전체를 덮게 한다.
****************************************/

/* ===== 커맨드 목록 ===== */

.cmd_head,
.cmd_row {
  display: grid;
  grid-template-columns: 96px 90px 1fr;
  align-items: stretch;
}

.cmd_head {
  background-color: var(--color-grey-100);
}

.cmd_head > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  font-size: 13px;
  color: var(--color-grey-600);
}

.cmd_row {
  border-top: 1px solid var(--color-grey-100);
}

.cmd_name {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-grey-900);
  text-align: center;
  background-color: var(--color-secondary-400);
  word-break: keep-all;
}

/* 앰브로진 전용 커맨드만 다른 색 */
.cmd_row.heal .cmd_name {
  background-color: #c9e29b;
}

.cmd_cool {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  font-size: 13px;
  color: var(--color-grey-500);
  text-align: center;
}

.cmd_desc {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 16px;
}

.cmd_desc p {
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-grey-800);
  word-break: keep-all;
}

/* ===== 커맨드 양식 ===== */

.form_head,
.form_body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.form_head {
  background-color: var(--color-grey-100);
}

.form_head > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  font-size: 13px;
  color: var(--color-grey-600);
}

.form_body {
  border-top: 1px solid var(--color-grey-100);
}

.form_col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 24px;
}

.form_col + .form_col {
  border-left: 1px solid var(--color-grey-100);
}

.form_line {
  padding: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary-400);
  word-break: keep-all;
}

/* 2~3번째 줄은 한 단 들여쓴다 */
.form_sub {
  padding: 0 0 2px 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-grey-600);
  word-break: keep-all;
}

/* ===== 좁은 화면 ===== */

@media screen and (max-width: 800px) {
  .cmd_head,
  .cmd_row {
    grid-template-columns: 66px 56px 1fr;
  }

  .cmd_name {
    font-size: 13px;
  }

  .cmd_desc {
    padding: 9px 10px;
  }

  .cmd_desc p {
    font-size: 12px;
  }

  .form_col {
    padding: 14px 12px;
  }

  .form_line {
    font-size: 13px;
  }

  .form_sub {
    padding-left: 12px;
    font-size: 12px;
  }
}
/****************************************
	수위 등급표 (notice/index.php)
	등급(세로) x 항목(가로) 격자. 표 전체가 하나의 그리드라서 '기타' 칸은
	grid-row 로 5줄을 한 번에 덮는다 (rowspan 대용).
	강조 두 종류 :
	  .on  = 러너간 역극 상한  (노출2 / 성행위0 / 폭력2 / 언어2)
	  .max = 스토리 상한       (폭력4 / 언어4)
	행 높이는 padding 이 아니라 셀 stretch 로 채운다.
****************************************/

.rate_table {
  display: grid;
  grid-template-columns: 56px repeat(4, 1fr) 132px;
  align-items: stretch;
  width: 100%;
  max-width: 680px;
  margin: 20px auto 10px;
  border: 1px solid var(--color-grey-100);
  border-radius: 4px;
  overflow: hidden;
}

/* ===== 머리줄 ===== */

.rate_head {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary-400);
  text-align: center;
  background-color: var(--color-secondary-400);
  word-break: keep-all;
}

/* 좌상단 빈 칸과 '기타' 머리는 노란 띠에서 뺀다 */
.rate_head.rate_lv,
.rate_etc_head {
  background-color: var(--color-grey-100);
  color: var(--color-grey-600);
}

/* ===== 등급 숫자 ===== */

.rate_lv {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary-400);
  background-color: var(--color-grey-0);
}

/* ===== 내용 칸 ===== */

.rate_cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-grey-400);
  text-align: center;
  word-break: keep-all;
}

/* 러너간 역극 상한 */
.rate_cell.on {
  color: var(--color-primary-400);
  font-weight: 700;
  background-color: rgba(var(--rc-paper-rgb), 0.4);
}

/* 스토리 상한 */
.rate_cell.max {
  color: var(--color-grey-900);
  font-weight: 700;
  background-color: var(--color-grey-100);
}

.rate_cell .on.max {
  color: var(--color-grey-900);
    background-color: rgba(var(--rc-paper-rgb), 0.4);
}

/* ===== 기타 칸 : 5줄을 한 번에 덮는다 ===== */

.rate_etc {
  grid-column: 6;
  grid-row: 2 / span 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 8px;
  border-left: 1px solid var(--color-grey-100);
}

.rate_etc p {
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-grey-400);
  text-align: center;
  word-break: keep-all;
}

/* ===== 좁은 화면 ===== */

@media screen and (max-width: 800px) {
  .rate_table {
    grid-template-columns: 34px repeat(4, 1fr) 84px;
  }

  .rate_head,
  .rate_lv {
    font-size: 12px;
    padding: 7px 3px;
  }

  .rate_cell,
  .rate_etc p {
    font-size: 11px;
  }

  .rate_cell {
    padding: 8px 4px;
  }
}

/****************************************
	본문 페이지 네비게이션 (world/1~3.php, system/1~2.php)
	.contexts_container 외부, 우측 하단에 세로로 배치되는 타임라인풍 목록.
	각 항목의 타이틀은 world/intro.php, system/index.php 링 노드의 이름을
	그대로 쓴다. 현재 페이지 항목은 링크가 아니라 강조된 텍스트로만 표기.
	모바일(800px 이하)에서는 이 데스크톱용(.page_nav_desktop)은 숨기고,
	.context_text 맨 아래 넣어둔 .page_nav_mobile을 가로로 펼쳐 보여준다.
****************************************/

.page_nav_desktop {
  position: fixed;
  right: 40px;
  bottom: 60px;
  z-index: 10;
  width: 180px;
  display: flex;
  flex-direction: column;
}

.page_nav_desktop::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  right: 4px;
  width: 1px;
  background: var(--color-grey-200);
}

.page_nav_desktop .page_nav_item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  height: 32px;
  text-decoration: none;
}

.page_nav_mobile {
  display: none;
}

.page_nav_dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--color-grey-0);
  border: 1px solid var(--color-grey-300);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background-color 0.2s, border-color 0.2s;
}

.page_nav_label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-grey-500);
  white-space: nowrap;
  text-align: right;
  transition: color 0.2s;
}

.page_nav_item:hover .page_nav_label {
  color: var(--color-primary-400);
}

.page_nav_item:hover .page_nav_dot {
  border-color: var(--color-primary-400);
}

.page_nav_item.is-current .page_nav_dot {
  background-color: var(--color-primary-400);
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 5px rgba(var(--rc-accent-rgb), 0.14);
}

.page_nav_item.is-current .page_nav_label {
  color: var(--color-grey-900);
  font-weight: 700;
}

/* ===== 좁은 화면: context_text 맨 아래로 옮겨 가로 배치 ===== */
@media screen and (max-width: 800px) {

  .context_text .paragraph:not(:last-child) {
    margin-bottom: 28px;
  }
  .page_nav_desktop {
    display: none;
  }

  .page_nav_mobile {
    display: flex;
    flex-wrap: wrap;
        justify-content: space-between;
    align-items: center;
    gap: 8px 20px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--color-grey-200);
  }

  .page_nav_mobile .page_nav_item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
  }
  
    .corner_btn.pos-tr {
    right: 22px;
  }

  .corner_btn.pos-tl {
    left: 22px;
  }

}
