/* 시계탑에 흐른 피(시계피) wiki 페이지 한글 — 공용 모양.
   배치·색은 공식 위키(pivot 스킨)를 따르고, 양피지 배경 등 장식 이미지는 PG+ 배포본(/pocket-grimoire/guide/img/)을 읽는다. */
:root {
    --wiki-maroon: #5C1F22;
    --wiki-border: #BDA89A;
    --good: #3297F4;
    --evil: #8C0E12;
}
/* 제목 글꼴: 국민대학교 성곡 세리프 (눈누 배포, jsDelivr). 이 글꼴을 못 받으면 기본 명조로 보인다. */
@font-face {
    font-family: "KookminUniversitySunggokSerif";
    src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/2607101542@kmu80sungkokserif/kmu80sungkokserif/KMU80SungkokSerif.woff2") format("woff2");
    font-weight: 500;
    font-display: swap;
}
/* 이야기풍 문장 글꼴(캐릭터 플레이버 문구, 에디션 줄거리): 산하엽 Diphylleia (눈누 배포, jsDelivr) */
@font-face {
    font-family: "Sanhayeop";
    src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_JAMO@1.0/Diphylleia-Regular.woff2") format("woff2");
    font-weight: normal;
    font-display: swap;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: "Noto Sans KR", sans-serif;
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-height: 1.6;
    color: #222;
    background: #2b1633 url("/pocket-grimoire/guide/img/background.webp") center / cover fixed;
}
.tab-bar {
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    text-align: center;
}
.tab-bar a {
    color: #e9d9b5;
    font-family: "KookminUniversitySunggokSerif", serif;
    font-size: 18px;
    text-decoration: none;
}
.tab-bar small { font-family: "Noto Sans KR", sans-serif; font-size: 12px; opacity: 0.8; }
.page {
    background: #efe6d6 url("/pocket-grimoire/guide/img/content-background.webp") center / cover;
    padding: 16px 16px 32px;
    min-height: calc(100vh - 45px);
    color: var(--wiki-maroon);
    max-width: 960px;
    margin: 0 auto;
}
h1.title {
    font-family: "KookminUniversitySunggokSerif", serif;
    font-weight: normal;
    font-size: 36px;
    color: var(--wiki-maroon);
    margin: 0.4em 0 0;
    line-height: 1.2;
}
h2 {
    font-family: "KookminUniversitySunggokSerif", serif;
    font-weight: normal;
    font-size: 21px;
    color: var(--wiki-maroon);
    margin: 1.2em 0 0.4em;
    border-bottom: 1px solid rgba(92, 31, 34, 0.25);
    padding-bottom: 0.15em;
}
a.role, span.role { font-weight: bold; text-decoration: none; }
.role--good { color: var(--good); }
.role--evil { color: var(--evil); }
.role--traveller { color: #7d2182; }
.role--fabled { color: #c9971c; }
.role--loric { color: #3f8a36; }
.credit {
    margin-top: 2.5em;
    padding-top: 1em;
    border-top: 1px solid rgba(92, 31, 34, 0.25);
    font-size: 13px;
    color: #6d5a4f;
}
.credit a { color: var(--wiki-maroon); }
.notfound { text-align: center; padding: 3em 1em; }
/* 두 칸 배치 페이지(에디션)는 더 넓게 */
.page.page--wide { max-width: 1200px; }

/* 위쪽 이동 막대: 메인으로 · 돌아갈 페이지 / 이전·다음 */
.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    font-size: 14px;
    margin-bottom: 0.5em;
}
.crumbs a { color: var(--wiki-maroon); text-decoration: none; font-weight: bold; }
.crumbs__steps { display: flex; gap: 12px; margin-left: auto; }
.crumbs__steps a { font-weight: normal; }
.lead { font-size: 15px; color: #222; margin: 0.6em 0 1em; }

/* 캐릭터 이름 호버창 — 공식 위키 [data-role] 값 그대로 (폭 300px, 흰 바탕 95%, 둥근 모서리 10px, #BDA89A 테두리, 0.15초 동안 27px 아래로) */
[data-ability] { position: relative; display: inline-block; }
[data-ability]:not([data-ability=""])::before {
    content: attr(data-ability);
    position: absolute;
    opacity: 0;
    transition: all 0.15s ease;
    left: 50%;
    margin-left: -150px;
    padding: 10px;
    text-align: center;
    color: #5C1F22;
    width: 300px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    font-weight: normal;
    font-size: 14px;
    line-height: 1.5;
    border: 1px #BDA89A solid;
    z-index: 9999;
    pointer-events: none;
}
[data-ability]:hover::before { opacity: 1; margin-top: 27px; }

/* 위키 목차 상자 (#toc) — 에디션·유형 페이지 공용 */
#toc {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--wiki-border);
    padding: 0.6em 1em 0.7em;
    margin: 0.2em 0 1.4em;
    font-size: 13.3px;
}
#toc .toctitle { font-family: "KookminUniversitySunggokSerif", serif; font-size: 15px; color: #000; text-align: center; margin-bottom: 0.3em; }
#toc ol { list-style: none; margin: 0; padding: 0; }
#toc li { margin: 0.15em 0; }
#toc a { color: #2a5aa0; text-decoration: none; }
#toc .tocnumber { color: #222; margin-right: 0.4em; }
/* 위키 본문 문단 (소개글·줄거리·게임 방식) */
.wiki-text { color: var(--wiki-maroon); font-size: 15px; }
.wiki-text p { margin: 0 0 1em; }

/* 캐릭터 아이콘 + 이름 격자 */
.grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
}
.grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 2px 6px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
}
.grid a:hover, .grid a:focus-visible { background: rgba(255, 255, 255, 0.55); }
.grid img { width: 64px; height: 64px; object-fit: contain; }
/* 넓은 화면: 위키처럼 한 줄 6칸 안팎, 아이콘 크게 */
@media (min-width: 900px) {
    .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px 8px; }
    .grid a { font-size: 15px; }
    .grid img { width: 96px; height: 96px; margin-bottom: 10px; }
}

/* 메인의 판·유형 타일 (위키 메인 모양) */
.tiles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px 8px;
}
.tiles a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #2a5aa0;
    font-size: 16px;
    text-align: center;
}
.tiles a:hover, .tiles a:focus-visible { background: rgba(255, 255, 255, 0.55); }
.tiles img { width: 120px; height: 120px; object-fit: contain; margin-bottom: 6px; }

/* ── 왼쪽 메뉴 + 넓은 화면 배치 (공식 위키 pivot 스킨) ──
   위키 값: 메뉴는 화면 폭 1/6(large-2), 보라 배경 위 흰 글씨 14px, 묶음 제목은 굵게 + 위아래 장식선(divider.png).
   본문 양피지는 메뉴 오른쪽을 꽉 채우고 위에서 조금 떨어져 시작한다. 좁은 화면은 위쪽 막대를 그대로 쓴다. */
.sidebar { display: none; }
.menu-toggle, .menu-overlay { display: none; }
/* 좁은 화면: 햄버거 버튼 + 밀려 들어오는 메뉴 (위키 off-canvas 값: 폭 15.625rem, 500ms, 본문 위 막 rgba(255,255,255,.2)) */
@media (max-width: 1023.98px) {
    html, body { overflow-x: hidden; }
    .tab-bar { position: relative; padding-left: 52px; padding-right: 52px; }
    .menu-toggle {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 45px;
        height: 45px;
        padding: 0;
        border: 0;
        background: none;
        cursor: pointer;
    }
    .menu-toggle span::after {
        content: "";
        display: block;
        position: absolute;
        top: 50%;
        left: 14px;
        width: 16px;
        height: 0;
        margin-top: -8px;
        box-shadow: 0 0 0 1px #fff, 0 7px 0 1px #fff, 0 14px 0 1px #fff;
    }
    .menu-toggle:hover span::after, .menu-toggle:focus-visible span::after { box-shadow: 0 0 0 1px #b3b3b3, 0 7px 0 1px #b3b3b3, 0 14px 0 1px #b3b3b3; }
    .sidebar {
        display: block;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 15.625rem;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1003;
        padding: 16px 12px 32px;
        color: #fff;
        background: #2b1633 url("/pocket-grimoire/guide/img/background.webp") center / cover;
        transform: translate3d(-100%, 0, 0);
        visibility: hidden;
        transition: transform 500ms ease, visibility 0s linear 500ms;
    }
    .tab-bar, .page { transition: transform 500ms ease; }
    .menu-open .sidebar { transform: none; visibility: visible; transition: transform 500ms ease; }
    .menu-open .tab-bar, .menu-open .page { transform: translate3d(15.625rem, 0, 0); }
    .menu-open .menu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1002;
        cursor: pointer;
        background: rgba(255, 255, 255, 0.2);
        box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
        -webkit-tap-highlight-color: transparent;
    }
}
@media (min-width: 1024px) {
    body { display: grid; grid-template-columns: minmax(200px, 16.6667%) minmax(0, 1fr); align-items: start; }
    .tab-bar { display: none; }
    .sidebar { display: block; grid-column: 1; grid-row: 1; padding: 16px 12px 32px; color: #fff; }
    .page, .page.page--wide { grid-column: 2; grid-row: 1; max-width: none; width: 100%; margin: 36px 0 0; padding: 24px 24px 40px; min-height: calc(100vh - 36px); }
}
.sidebar__logo { display: block; text-align: center; margin: 4px 0 14px; }
.sidebar__logo img { width: 80%; max-width: 200px; height: auto; }
.sidebar__search input {
    width: 100%;
    font: inherit;
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #222;
}
.sidebar__label {
    text-align: center;
    font-family: "KookminUniversitySunggokSerif", serif;
    font-weight: bold;
    font-size: 18px;
    color: #fff;
    margin-top: 6px;
}
.sidebar__label::before, .sidebar__label::after {
    content: " ";
    display: block;
    height: 10px;
    padding: 10px;
    background: url("img/divider.png") center / contain no-repeat;
}
.sidebar ul { list-style: none; margin: 0; padding: 0 6px; }
.sidebar li { margin: 0; }
.sidebar ul a { display: block; color: #fff; font-size: 14px; line-height: 1.6; text-decoration: none; }
.sidebar ul a:hover, .sidebar ul a:focus-visible { text-decoration: underline; }
.sidebar ul a[aria-current="page"] { font-weight: bold; }

