@import url('https://fonts.googleapis.com/css2?family=M+PLUS+1p:wght@700;800&family=Montserrat:wght@900&family=Noto+Serif+JP:wght@700&family=Roboto+Mono:wght@300;700&display=swap');

:root {
    --fg: #ffffff;
    --accent-cyan: #00ffff;
    --accent-magenta: #ff00ff;
    --mono: 'Roboto Mono', monospace;
    --nav-width: 320px;
    --interface-corridor: clamp(28px, 3vw, 52px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: url('img/background.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--fg);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
}

/* --- 右サイドメニュー（濃い黒透過） --- */
.right-nav {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--nav-width);
    height: 100%;
    padding: 4rem 2.5rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.016) 100%),
        linear-gradient(160deg, rgba(0, 255, 255, 0.08) 0%, rgba(255, 0, 255, 0.05) 54%, rgba(0, 0, 0, 0) 100%),
        rgba(6, 7, 10, 0.84);
    border-left: none;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: -14px 0 30px rgba(0, 0, 0, 0.2);
    -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0.92) 82%, rgba(0, 0, 0, 0.72) 90%, rgba(0, 0, 0, 0.42) 96%, rgba(0, 0, 0, 0.18) 99%, rgba(0, 0, 0, 0));
    mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0.92) 82%, rgba(0, 0, 0, 0.72) 90%, rgba(0, 0, 0, 0.42) 96%, rgba(0, 0, 0, 0.18) 99%, rgba(0, 0, 0, 0));
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    isolation: isolate;
}

.right-nav::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0) 26%),
        repeating-linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.03) 0,
            rgba(255, 255, 255, 0.03) 1px,
            rgba(255, 255, 255, 0) 1px,
            rgba(255, 255, 255, 0) 4px
        );
    opacity: 0.17;
}

.right-nav::after {
    content: "";
    position: absolute;
    left: -72px;
    top: 0;
    width: 72px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.045) 34%, rgba(255, 255, 255, 0.014) 66%, rgba(255, 255, 255, 0) 100%);
    filter: blur(18px);
    opacity: 0.36;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .right-nav {
        background: rgba(6, 7, 10, 0.9);
    }
}

.right-nav-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    height: 100%;
    padding-left: 1.3rem;
}

.mobile-nav-toggle {
    display: none;
}

.menu-section h3 {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.2rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 0.5rem;
}

.nav-links, .social-links { list-style: none; }
.nav-links li, .social-links li { margin-bottom: 1rem; }

.nav-links a, .social-links a {
    text-decoration: none;
    color: var(--fg);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1rem;
    transition: 0.3s;
    display: inline-block;
    opacity: 0.6;
    line-height: 1.22;
}

.nav-links a:hover, .nav-links a.active { color: var(--accent-magenta); opacity: 1; transform: translateX(8px); }
.social-links a:hover { color: var(--accent-cyan); opacity: 1; transform: translateX(8px); }

.system-monitor {
    margin-top: auto;
    font-family: var(--mono);
    font-size: 0.65rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
}

.observer-auth-message {
    margin-top: 0.8rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.04rem;
    max-width: 42rem;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.observer-auth-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- メインコンテンツエリア --- */
main {
    width: calc(100% - var(--nav-width) - var(--interface-corridor));
    margin-right: var(--interface-corridor);
    height: 100vh;
    position: relative;
}

main::after {
    content: "";
    position: absolute;
    top: 0;
    right: calc(-1 * var(--interface-corridor));
    width: var(--interface-corridor);
    height: 100%;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 255, 255, 0.24) 0%, rgba(0, 255, 255, 0.1) 14%, rgba(255, 0, 255, 0.14) 55%, rgba(255, 255, 255, 0.06) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.42) 48%, rgba(255, 255, 255, 0.08) 100%);
    opacity: 0.34;
}

.global-wotolog-link {
    position: absolute;
    right: 1.4rem;
    top: 1.2rem;
    z-index: 80;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1rem;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.global-wotolog-link:hover {
    color: var(--accent-cyan);
    border-color: rgba(0, 255, 255, 0.75);
    background: rgba(0, 0, 0, 0.78);
}

section { display: none; height: 100%; overflow-y: auto; position: relative; }
section.active { display: block; }

section,
.right-nav,
body {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 255, 0.75) rgba(255, 255, 255, 0.08);
}

section::-webkit-scrollbar,
.right-nav::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 10px;
}

section::-webkit-scrollbar-track,
.right-nav::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

section::-webkit-scrollbar-thumb,
.right-nav::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.9) 0%, rgba(255, 0, 255, 0.85) 100%);
    border: 2px solid rgba(0, 0, 0, 0.65);
    border-radius: 999px;
}

section::-webkit-scrollbar-thumb:hover,
.right-nav::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(0, 255, 255, 1) 0%, rgba(255, 0, 255, 1) 100%);
}

/* 左下タイトル（背景反転 exclusion） */
.bottom-left-content {
    position: absolute;
    bottom: 5rem;
    left: 5rem;
    max-width: 800px;
    animation: contentFade 0.8s ease-out;
}

h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 7vw;
    line-height: 0.85;
    color: white;
    mix-blend-mode: exclusion;
    margin-bottom: 1.5rem;
    letter-spacing: -0.2rem;
    text-transform: uppercase;
}

/* 引用バッジ（黒背景・白文字） */
.tlp-badge {
    display: inline-block;
    background: #000000;
    color: #ffffff;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
    font-family: var(--mono);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.pulse-text {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.6rem;
    line-height: 1.8;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* サブページ用スタイル（用語集） */
.inner-content {
    padding: 6rem 10% 8rem 5rem;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.58) 74%, rgba(0, 0, 0, 0.46) 100%),
        rgba(0, 0, 0, 0.52);
    min-height: 100vh;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset -28px 0 42px rgba(0, 255, 255, 0.08);
}

/* VISUAL_LOG以外の背景を再調整（VISUAL_LOG自体は既存ルールを維持） */
section:not(#visual-log) .inner-content {
    background:
        linear-gradient(rgba(255, 255, 255, 0.062) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.062) 1px, transparent 1px),
        radial-gradient(circle at 14% 12%, rgba(0, 255, 255, 0.095), transparent 44%),
        radial-gradient(circle at 88% 16%, rgba(255, 0, 255, 0.095), transparent 41%);
    background-size: 26px 26px, 26px 26px, 86vw 56vh, 78vw 62vh;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset -22px 0 34px rgba(0, 255, 255, 0.06);
}

section:not(#visual-log) .inner-content > .page-title {
    font-family: 'M PLUS 1p', sans-serif;
    font-weight: 800;
    letter-spacing: 0.08rem;
    font-size: clamp(2.2rem, 4.6vw, 4rem);
    color: #ffffff;
    margin-bottom: 1.35rem;
    padding-left: 0.28rem;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.12);
}

section:not(#visual-log) .section-intro,
.visual-log-intro {
    max-width: 62rem;
    color: rgba(255, 255, 255, 0.94);
    font-family: var(--mono);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.9;
    letter-spacing: 0.03rem;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.78), 0 0 5px rgba(0, 0, 0, 0.28);
    display: inline-block;
    padding: 0.14rem 0.38rem 0.18rem;
    margin-left: 0.08rem;
    background: linear-gradient(90deg, rgba(8, 12, 18, 0.4) 0%, rgba(8, 12, 18, 0.18) 66%, rgba(8, 12, 18, 0) 100%);
    border: none;
    box-shadow: none;
}

section:not(#visual-log) .section-intro {
    margin: 0 0 2rem;
    padding-left: 0.28rem;
}

.visual-log-intro {
    margin-bottom: 2rem;
}

section:not(#visual-log) .section-content-shell {
    max-width: min(1060px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.01) 20%, rgba(255, 255, 255, 0) 62%),
        linear-gradient(90deg, rgba(8, 10, 14, 0.78) 0%, rgba(8, 10, 14, 0.72) 70%, rgba(8, 10, 14, 0.58) 100%),
        rgba(8, 10, 14, 0.66);
    box-shadow: 0 20px 34px rgba(0, 0, 0, 0.32), inset 0 0 22px rgba(0, 255, 255, 0.04);
    backdrop-filter: blur(6px);
    padding: 1.5rem 1.65rem 1.6rem;
    margin-bottom: 1.4rem;
}

#entity-profile .section-content-shell {
    max-width: min(1180px, 100%);
    padding: 1.25rem;
}

#entity-profile .entity-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin: 0 0 0.85rem;
    padding: 0.45rem 0.2rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#entity-profile .entity-toolbar-label,
#entity-profile .entity-toolbar-meta {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.08rem;
    color: rgba(255, 255, 255, 0.66);
}

#entity-profile .entity-toolbar-label {
    color: rgba(0, 255, 255, 0.82);
}

#entity-profile .entity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

#entity-profile .entity-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.012) 30%, rgba(255, 255, 255, 0) 100%),
        rgba(9, 12, 17, 0.78);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32), inset 0 0 18px rgba(0, 255, 255, 0.04);
    padding: 0.72rem 0.72rem 0.86rem;
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

#entity-profile .entity-card:nth-child(1) {
    border-top-color: rgba(0, 255, 255, 0.72);
}

#entity-profile .entity-card:nth-child(2) {
    border-top-color: rgba(255, 0, 255, 0.72);
}

#entity-profile .entity-card:nth-child(3) {
    border-top-color: rgba(0, 255, 170, 0.72);
}

#entity-profile .entity-card:nth-child(4) {
    border-top-color: rgba(255, 180, 0, 0.72);
}

#entity-profile .entity-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0) 24%),
        repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0) 4px);
    opacity: 0.22;
}

#entity-profile .entity-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.4), 0 0 18px rgba(0, 255, 255, 0.14);
}

#entity-profile .entity-thumb {
    position: relative;
    margin: 0 0 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.46);
}

#entity-profile .entity-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(106%) contrast(106%);
    transition: transform 0.34s ease, filter 0.34s ease;
}

#entity-profile .entity-card:hover .entity-thumb img {
    transform: scale(1.04);
    filter: saturate(120%) contrast(112%);
}

#entity-profile .entity-code {
    margin: 0 0 0.32rem;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1rem;
    color: rgba(0, 255, 255, 0.88);
}

#entity-profile .entity-card h3 {
    margin: 0 0 0.44rem;
    font-family: 'M PLUS 1p', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.03rem;
    color: rgba(255, 255, 255, 0.97);
}

#entity-profile .entity-class {
    margin: 0 0 0.45rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.055rem;
    color: rgba(255, 0, 255, 0.9);
}

#entity-profile .entity-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.55rem;
}

#entity-profile .entity-tags span {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.06rem;
    padding: 0.16rem 0.34rem;
}

#entity-profile .entity-description,
#entity-profile .entity-note {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.72;
    color: rgba(255, 255, 255, 0.86);
}

#entity-profile .entity-note {
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.74);
}

#entity-profile .entity-jump-btn {
    margin-top: 0.72rem;
    border: 1px solid rgba(0, 255, 255, 0.44);
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.18), rgba(255, 0, 255, 0.11));
    color: rgba(255, 255, 255, 0.96);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    padding: 0.34rem 0.52rem;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#entity-profile .entity-jump-btn:hover {
    border-color: rgba(255, 0, 255, 0.7);
    transform: translateX(2px);
    box-shadow: 0 0 12px rgba(255, 0, 255, 0.16);
}

#index .bottom-left-content {
    /* 以前あった枠や背景を削除し、元の状態（枠なし）に戻す */
}

#logs .inner-content,
#visual-log .inner-content {
    padding-right: min(14%, 8.5rem);
}

.world-category { margin-bottom: 4rem; }
.world-category h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: var(--accent-magenta);
    border-bottom: 1px solid var(--accent-magenta);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
}

#world .world-category h3 {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.term { margin-bottom: 2.5rem; }
.term dt {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--fg);
    margin-bottom: 0.5rem;
}

#world .term dt {
    color: var(--fg);
}

#world .term dt.world-term-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    border-bottom: 1px dotted rgba(0, 255, 255, 0.45);
    transition: color 0.2s ease, border-color 0.2s ease, text-shadow 0.2s ease;
}

#world .term dt.world-term-trigger::after {
    content: "DETAIL";
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.08rem;
    color: rgba(0, 255, 255, 0.65);
    border: 1px solid rgba(0, 255, 255, 0.35);
    padding: 0.1rem 0.26rem;
}

#world .term dt.world-term-trigger:hover,
#world .term dt.world-term-trigger:focus-visible {
    color: #ffffff;
    border-bottom-color: rgba(255, 0, 255, 0.8);
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.4);
    outline: none;
}

.world-word-popup {
    position: fixed;
    width: min(31rem, calc(100vw - 1.5rem));
    max-height: min(75vh, 43rem);
    overflow-y: auto;
    padding: 0.95rem 1rem 1rem;
    border: 1px solid rgba(0, 255, 255, 0.55);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 22%, rgba(255, 255, 255, 0.01) 100%),
        rgba(8, 8, 10, 0.93);
    box-shadow: 0 26px 44px rgba(0, 0, 0, 0.58), 0 0 24px rgba(0, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

.world-word-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.world-word-popup-header h4 {
    margin: 0;
    font-family: 'Noto Serif JP', serif;
    font-size: 1.08rem;
    color: #ffffff;
}

.world-word-popup-close {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.09rem;
    padding: 0.24rem 0.38rem;
    cursor: pointer;
}

.world-word-popup-close:hover {
    border-color: rgba(255, 0, 255, 0.9);
    color: rgba(255, 0, 255, 0.96);
}

.world-word-popup-summary {
    margin: 0 0 0.7rem;
    color: rgba(0, 255, 255, 0.92);
    font-family: var(--mono);
    font-size: 0.73rem;
    line-height: 1.7;
    letter-spacing: 0.03rem;
}

.world-word-popup-detail p {
    margin: 0 0 0.55rem;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.92rem;
    line-height: 1.8;
}

.world-word-popup-links {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.world-word-link {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.06rem;
    padding: 0.28rem 0.42rem;
    cursor: pointer;
}

.world-word-link:hover {
    border-color: rgba(0, 255, 255, 0.85);
    color: rgba(0, 255, 255, 0.95);
    background: rgba(0, 255, 255, 0.08);
}

main .world-inline-term-link {
    display: inline;
    border: none;
    border-bottom: 1px dashed rgba(255, 0, 255, 0.52);
    background: linear-gradient(180deg, rgba(255, 0, 255, 0.08), rgba(0, 255, 255, 0.04));
    color: rgba(255, 255, 255, 0.95);
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    padding: 0.02rem 0.12rem;
    margin: 0 0.05rem;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

main .world-inline-term-link:hover,
main .world-inline-term-link:focus-visible {
    color: rgba(0, 255, 255, 0.98);
    border-bottom-color: rgba(0, 255, 255, 0.9);
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.14), rgba(255, 0, 255, 0.06));
    outline: none;
}

.term dd {
    margin-left: 1.5rem;
    font-size: 1rem;
    line-height: 1.8;
    color: #ccc;
}
.term dd ul { list-style: square; margin-top: 0.5rem; margin-left: 1.2rem; color: #aaa; font-size: 0.9rem; }

#four-norms .norm-item {
    margin-bottom: 2.6rem;
}

#four-norms .norms-overview {
    font-size: 1rem;
    line-height: 1.9;
    color: #cfcfcf;
    margin-bottom: 2rem;
}

#four-norms .norm-item h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.35rem;
    color: var(--accent-cyan);
    margin-bottom: 0.9rem;
}

#four-norms .norm-item p {
    font-size: 1rem;
    line-height: 1.9;
    color: #d0d0d0;
    margin-bottom: 0.6rem;
}

.page-title {
    font-family: Montserrat, sans-serif;
    font-size: clamp(2.2rem, 4.6vw, 4rem);
    margin-bottom: 3rem;
}

.page-title.magenta { color: var(--accent-magenta); }
.page-title.cyan { color: var(--accent-cyan); }

/* VISUAL_LOG: data-scrap style gallery */
.visual-log-screen {
    position: relative;
    background-color: transparent;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        radial-gradient(circle at 15% 12%, rgba(0, 255, 255, 0.1), transparent 42%),
        radial-gradient(circle at 88% 18%, rgba(255, 0, 255, 0.1), transparent 40%);
    background-size: 26px 26px, 26px 26px, 85vw 52vh, 75vw 58vh;
    border-right: 1px solid rgba(0, 255, 255, 0.22);
}

.visual-log-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.012) 20%, rgba(255, 255, 255, 0) 56%);
    z-index: 0;
}

.visual-log-screen > * {
    position: relative;
    z-index: 1;
}

.visual-log-title {
    font-family: 'M PLUS 1p', sans-serif;
    font-size: clamp(2.2rem, 4.6vw, 4rem);
    font-weight: 800;
    letter-spacing: 0.08rem;
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.visual-log-controls {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1.2rem;
    padding: 0.7rem 0 1rem;
    background: linear-gradient(180deg, rgba(14, 16, 22, 0.56) 0%, rgba(14, 16, 22, 0.3) 70%, rgba(14, 16, 22, 0) 100%);
    backdrop-filter: blur(2px);
}

.visual-log-filter-btn {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.84);
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.09rem;
    padding: 0.4rem 0.58rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.visual-log-filter-btn:hover {
    border-color: rgba(0, 255, 255, 0.82);
    color: rgba(0, 255, 255, 0.95);
}

.visual-log-filter-btn.active {
    border-color: rgba(255, 0, 255, 0.9);
    color: rgba(255, 255, 255, 0.98);
    background: linear-gradient(90deg, rgba(255, 0, 255, 0.24), rgba(0, 255, 255, 0.16));
}

.visual-log-groups {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.visual-log-character-group .visual-log-grid {
    column-count: 2;
    column-gap: 2.2rem;
}

.visual-log-character-group {
    margin-bottom: 2.8rem;
}

.visual-log-character-group.is-hidden {
    display: none;
}

.visual-log-character-title {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.35rem 0.6rem;
    border-left: 2px solid rgba(0, 255, 255, 0.78);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.14rem;
    text-transform: uppercase;
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.06), rgba(255, 0, 255, 0.04));
}

.gallery-item {
    position: relative;
    display: inline-block;
    width: 100%;
    margin: 0 0 2.2rem;
    break-inside: avoid;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
    transform-origin: center;
    cursor: zoom-in;
}

.gallery-item:nth-child(odd) {
    transform: translateY(10px) rotate(-0.4deg);
}

.gallery-item:nth-child(even) {
    transform: translateY(-6px) rotate(0.3deg);
}

.gallery-item:nth-child(3n) {
    border-top-color: rgba(0, 255, 255, 0.85);
}

.gallery-item:nth-child(4n) {
    border-right-color: rgba(255, 0, 255, 0.85);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.25s ease, filter 0.2s ease;
}

.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    mix-blend-mode: screen;
    opacity: 0.18;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.gallery-item:hover {
    animation: glitchShake 0.22s steps(2, end) 1;
}

.gallery-item:hover img {
    filter: contrast(150%) hue-rotate(10deg);
    transform: scale(1.03) skewX(-2deg);
}

.gallery-item:hover::after {
    opacity: 0.5;
}

.gallery-meta,
.gallery-stamp {
    position: absolute;
    z-index: 2;
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}

.gallery-meta {
    left: 0.7rem;
    bottom: 0.65rem;
}

.gallery-stamp {
    right: 0.7rem;
    top: 0.7rem;
    color: rgba(0, 255, 255, 0.92);
}

.visual-log-status {
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.18rem;
}

.visual-log-load-error {
    color: rgba(255, 0, 255, 0.92);
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.08rem;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.4rem 2rem;
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(4px);
    z-index: 350;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    overflow-y: auto;
}

.gallery-lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

.gallery-lightbox-frame {
    margin: 0 auto;
    max-width: min(90vw, 1200px);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-lightbox-frame img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 9rem);
    width: auto;
    border: 1px solid rgba(0, 255, 255, 0.75);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6);
}

.gallery-lightbox-frame figcaption {
    margin-top: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.11rem;
}

.gallery-lightbox-close {
    position: absolute;
    top: 1.1rem;
    right: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1rem;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
}

.gallery-lightbox-close:hover {
    border-color: rgba(255, 0, 255, 0.9);
    color: rgba(255, 0, 255, 0.95);
}

@keyframes glitchShake {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-3px, 1px); }
    40% { transform: translate(3px, -1px); }
    60% { transform: translate(-2px, 1px); }
    80% { transform: translate(2px, -1px); }
    100% { transform: translate(0, 0); }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
        background-attachment: scroll;
    }

    .right-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 3.6rem;
        overflow: hidden;
        padding: 0.7rem 1rem 0.6rem;
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        gap: 0;
        background: rgba(0, 0, 0, 0.68);
        z-index: 200;
        transition: max-height 0.3s ease, background 0.3s ease;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .right-nav.open {
        max-height: 85vh;
        background: rgba(0, 0, 0, 0.9);
    }

    .mobile-nav-toggle {
        display: inline-flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 0.15rem;
        width: 100%;
        padding: 0.4rem 0.7rem 0.45rem;
        border: 1px solid rgba(0, 255, 255, 0.24);
        background:
            linear-gradient(90deg, rgba(0, 255, 255, 0.08), rgba(255, 0, 255, 0.05)),
            rgba(255, 255, 255, 0.03);
        color: var(--fg);
        font-family: var(--mono);
        text-transform: uppercase;
    }

    .mobile-nav-toggle-label {
        font-size: 0.72rem;
        letter-spacing: 0.16rem;
        color: rgba(255, 255, 255, 0.95);
        line-height: 1.1;
    }

    .mobile-nav-toggle-state {
        font-size: 0.55rem;
        letter-spacing: 0.08rem;
        color: rgba(0, 255, 255, 0.82);
        line-height: 1;
    }

    .right-nav.open .mobile-nav-toggle-state {
        color: rgba(255, 0, 255, 0.9);
    }

    .right-nav-content {
        margin-top: 0.9rem;
        gap: 1.2rem;
        padding-left: 0;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .right-nav.open .right-nav-content {
        opacity: 1;
        pointer-events: auto;
    }

    .menu-section h3 {
        margin-bottom: 0.8rem;
    }

    .nav-links li,
    .social-links li {
        margin-bottom: 0.75rem;
    }

    .nav-links a,
    .social-links a {
        font-size: 0.9rem;
    }

    .system-monitor {
        margin-top: 0.8rem;
        padding-top: 0.8rem;
    }

    main {
        width: 100%;
        height: auto;
        padding-top: 4.4rem;
        margin-right: 0;
    }

    main::after {
        display: none;
    }

    section {
        min-height: calc(100vh - 4.4rem);
        height: auto;
    }

    .bottom-left-content {
        position: absolute;
        left: 1rem;
        right: 1rem;
        bottom: 2rem;
        max-width: 86%;
        padding: 1rem 1rem 1.2rem;
    }

    h1 {
        font-size: 3rem;
        line-height: 0.95;
        letter-spacing: -0.08rem;
    }

    .tlp-badge {
        font-size: 0.8rem;
        padding: 0.6rem 0.9rem;
        margin-bottom: 1.4rem;
    }

    .pulse-text {
        font-size: 1.15rem;
        line-height: 1.65;
    }

    .inner-content {
        padding: 2rem 1rem 3rem;
        border-right: none;
        box-shadow: none;
    }

    section:not(#visual-log) .section-intro,
    .visual-log-intro {
        font-size: 0.76rem;
        line-height: 1.7;
        letter-spacing: 0.025rem;
        margin-bottom: 1rem;
        padding-left: 0;
        padding-right: 0.16rem;
        margin-left: 0;
        display: block;
    }

    section:not(#visual-log) .section-content-shell {
        padding: 1rem 0.9rem 1.1rem;
        margin-bottom: 0.95rem;
    }

    #entity-profile .section-content-shell {
        padding: 0.7rem;
    }

    #entity-profile .entity-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.24rem;
        padding: 0.2rem 0.1rem 0.55rem;
    }

    #entity-profile .entity-toolbar-label,
    #entity-profile .entity-toolbar-meta {
        font-size: 0.52rem;
        letter-spacing: 0.05rem;
    }

    #entity-profile .entity-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    #entity-profile .entity-card {
        padding: 0.6rem 0.6rem 0.72rem;
    }

    #entity-profile .entity-jump-btn {
        width: 100%;
        font-size: 0.56rem;
        letter-spacing: 0.06rem;
    }

    #entity-profile .entity-card h3 {
        font-size: 1.02rem;
    }

    #entity-profile .entity-description,
    #entity-profile .entity-note {
        font-size: 0.83rem;
        line-height: 1.64;
    }

    .page-title {
        margin-bottom: 1.8rem;
    }

    .visual-log-controls {
        position: static;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        margin-bottom: 0.9rem;
    }

    .visual-log-filter-btn {
        flex: 0 0 auto;
        font-size: 0.58rem;
        letter-spacing: 0.06rem;
        padding: 0.34rem 0.5rem;
    }

    .visual-log-character-group .visual-log-grid {
        column-count: 1;
        column-gap: 0;
    }

    .visual-log-character-group {
        margin-bottom: 1.7rem;
    }

    .visual-log-character-title {
        font-size: 0.64rem;
        letter-spacing: 0.08rem;
        margin-bottom: 0.8rem;
    }

    .gallery-item {
        margin-bottom: 1.3rem;
        transform: none;
    }

    .gallery-item:nth-child(odd),
    .gallery-item:nth-child(even) {
        transform: none;
    }

    .visual-log-status {
        letter-spacing: 0.08rem;
        line-height: 1.8;
    }

    .gallery-lightbox {
        padding: 0.9rem;
    }

    .gallery-lightbox-frame {
        margin-top: 0;
    }

    .gallery-lightbox-frame img {
        max-height: calc(100vh - 7.5rem);
    }

    .gallery-lightbox-frame figcaption {
        font-size: 0.64rem;
        letter-spacing: 0.06rem;
        line-height: 1.6;
    }

    .world-category {
        margin-bottom: 2.2rem;
    }

    .world-category h3 {
        font-size: 1.15rem;
        margin-bottom: 1.1rem;
    }

    .term {
        margin-bottom: 1.4rem;
    }

    .term dt {
        font-size: 1.05rem;
    }

    .term dd {
        margin-left: 0;
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .world-word-popup {
        width: calc(100vw - 1rem);
        max-height: 68vh;
        padding: 0.8rem 0.75rem 0.85rem;
    }

    .world-word-popup-header h4 {
        font-size: 0.98rem;
    }

    .world-word-popup-detail p {
        font-size: 0.88rem;
        line-height: 1.7;
    }

    .term dd ul {
        margin-left: 1rem;
        font-size: 0.85rem;
    }

    #four-norms .norm-item {
        margin-bottom: 2rem;
    }

    #four-norms .norms-overview {
        font-size: 0.95rem;
        line-height: 1.8;
        margin-bottom: 1.6rem;
    }

    #four-norms .norm-item h3 {
        font-size: 1.1rem;
        line-height: 1.6;
    }

    #four-norms .norm-item p {
        font-size: 0.95rem;
        line-height: 1.8;
    }
}

@keyframes contentFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- PHILOSOPHER_ARCHIVE --- */
.philosopher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.philosopher-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(9,12,17,0.6);
    text-decoration: none;
    color: var(--fg);
    transition: 0.3s ease;
    position: relative;
    overflow: hidden;
}
.philosopher-card:hover {
    border-color: var(--accent-magenta);
    background: rgba(255,0,255,0.05);
    transform: translateY(-4px);
}
.philosopher-card.locked {
    opacity: 0.4;
    pointer-events: none;
    border-color: rgba(255,255,255,0.05);
}
.philosopher-card .card-id {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent-magenta);
    margin-bottom: 0.8rem;
    letter-spacing: 0.1em;
}
.philosopher-card h3 {
    margin-bottom: 0.2rem;
    font-size: 1.2rem;
    font-family: var(--mono);
    letter-spacing: 0.05em;
}
.philosopher-card .card-meta {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1rem;
    font-family: 'Noto Serif JP', serif;
}
.philosopher-card .card-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.philosopher-card .card-tags span {
    font-family: var(--mono);
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 2px;
}
.philosopher-card .card-desc {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.8);
    margin-top: auto;
}


.philosopher-card .card-works {
    font-size: 0.8rem;
    color: var(--accent-cyan);
    margin-bottom: 0.8rem;
    line-height: 1.4;
    font-family: 'Noto Serif JP', serif;
}


.philosopher-thumb {
    margin: -1.5rem -1.5rem 1.2rem -1.5rem;
    width: calc(100% + 3rem);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.philosopher-thumb.placeholder {
    display: grid;
    place-items: end start;
    padding: 1rem;
    background:
        linear-gradient(135deg, rgba(0, 255, 255, 0.14), rgba(255, 0, 255, 0.06)),
        radial-gradient(circle at 78% 22%, rgba(255, 0, 255, 0.22), transparent 38%),
        rgba(4, 7, 11, 0.92);
}
.philosopher-thumb.placeholder span {
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.7;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.86);
}
.philosopher-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    filter: grayscale(60%) contrast(1.1);
    transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
}
.philosopher-card:hover .philosopher-thumb img {
    opacity: 1;
    transform: scale(1.05);
    filter: grayscale(0%) contrast(1);
}

