/* --- 変数定義 (Design Tokens) --- */
:root {
    /* レトロ・手書きRPG風カラースキーム */
    --clr-bg-parchment: #f4ecd8;
    /* 羊皮紙のようなオフホワイト */
    --clr-bg-dark: #1a1815;
    /* 古いインクのような黒茶 */
    --clr-primary: #8b2614;
    /* 封蝋のようなクラシックレッド */
    --clr-accent: #c49a45;
    /* くすんだ真鍮・ゴールド */
    --clr-text-main: #2b2521;
    --clr-text-light: #e4dccc;

    /* フォント設定 */
    --font-heading: 'Cormorant Garamond', 'Noto Serif JP', serif;
    --font-body: 'Noto Serif JP', serif;

    /* グラスモーフィズム (レトロ調の薄い半透明) */
    --glass-bg-light: rgba(244, 236, 216, 0.7);
    --glass-bg-dark: rgba(26, 24, 21, 0.6);
    --glass-border: rgba(196, 154, 69, 0.3);
    /* ゴールドの薄いフチ */
    --glass-blur: blur(8px);
    --glass-shadow: 0 8px 32px 0 rgba(20, 15, 10, 0.4);
}

/* --- Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--clr-text-main);
    background-color: var(--clr-bg-parchment);
    line-height: 1.8;
    overflow-x: hidden;
    scroll-behavior: smooth;
    /* 古い紙の質感テクスチャをうっすら追加 */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Navigation (Glassmorphism) --- */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.logo {
    color: var(--clr-accent);
    font-size: 1.5rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    gap: 0.8rem 1.8rem;
}

nav a {
    color: var(--clr-text-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    position: relative;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--clr-accent);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--clr-accent);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* ドロップダウン */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle::after {
    display: none;
    /* 下線アニメーション非表示 */
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    gap: 0;
    background: rgba(26, 24, 21, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    min-width: 200px;
    padding: 0.4rem 0;
    padding-top: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: flex;
}

.nav-dropdown-menu li {
    list-style: none;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.nav-dropdown-menu a::after {
    display: none;
}

.nav-dropdown-menu a:hover {
    background: rgba(196, 154, 69, 0.15);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--clr-text-light);
    /* メイン画像。背景固定にしてパララックス効果を出す */
    background-image: url('assets/hero-bg.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* レトロな暗がりのグラデーション */
    background: linear-gradient(to bottom, rgba(26, 24, 21, 0.3) 0%, rgba(26, 24, 21, 0.9) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
}

.sub-title {
    display: block;
    color: var(--clr-accent);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    letter-spacing: 0.2em;
}

.main-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

/* Button */
.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--clr-accent);
    border: 1px solid var(--clr-accent);
    color: var(--clr-bg-dark);
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.1em;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: #d4aa55;
    color: var(--clr-bg-dark);
    box-shadow: 0 0 20px rgba(196, 154, 69, 0.6);
    transform: translateY(-2px);
}

/* --- Concept Section --- */
.concept {
    padding: 6rem 0;
    background-color: var(--clr-bg-parchment);
    color: var(--clr-text-main);
    position: relative;
}

.concept-glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(139, 38, 20, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 4rem;
    border-radius: 8px;
    /* 少し角丸にしてカード感 */
    text-align: center;
    max-width: 800px;
    margin: -10rem auto 0;
    /* ヒーロー画像に少し食い込ませる */
    position: relative;
    z-index: 10;
}

.concept-glass-card h2 {
    color: var(--clr-primary);
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.concept-glass-card p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #555;
}

/* --- Animations --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1.2s ease forwards 0.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Quest Board Section --- */
.quest-board {
    padding: 6rem 0;
    background-color: var(--clr-bg-parchment);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--clr-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 4rem;
    color: var(--clr-text-main);
    font-style: italic;
    opacity: 0.8;
}

.quest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.quest-card {
    background-color: rgba(255, 255, 255, 0.4);
    /* 羊皮紙の上の少し明るい紙 */
    border: 1px solid rgba(139, 38, 20, 0.2);
    border-radius: 4px;
    padding: 2.5rem 2rem;
    box-shadow: 2px 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.quest-card::before {
    /* カードの左端に本の栞のようなアクセント */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--clr-primary);
    opacity: 0.7;
    transition: width 0.3s ease;
}

.quest-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.8);
}

.quest-card:hover::before {
    width: 6px;
}

.quest-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    font-weight: bold;
}

.quest-rank {
    letter-spacing: 0.1em;
}

.rank-s {
    color: #d32f2f;
}

.rank-a {
    color: #f57c00;
}

.rank-b {
    color: #1976d2;
}

.quest-category {
    background-color: var(--clr-bg-dark);
    color: var(--clr-text-light);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.quest-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--clr-text-main);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.quest-card:hover h3 {
    color: var(--clr-primary);
}

.quest-excerpt {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 2.5rem;
}

.quest-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(0, 0, 0, 0.2);
    padding-top: 1rem;
}

.reward {
    font-family: var(--font-heading);
    color: var(--clr-accent);
    font-weight: 600;
}

.btn-quest {
    font-size: 0.9rem;
    color: var(--clr-primary);
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.btn-quest:hover {
    color: var(--clr-bg-dark);
}

/* --- Guild Invite Section --- */
.guild-invite {
    padding: 6rem 0;
    background-color: var(--clr-bg-dark);
    color: var(--clr-text-light);
    text-align: center;
    border-top: 4px solid var(--clr-accent);
}

.guild-invite h2 {
    font-size: 2.5rem;
    color: var(--clr-accent);
    margin-bottom: 1.5rem;
}

.guild-invite p {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

/* --- Footer --- */
footer {
    background-color: #111;
    color: #666;
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
}

/* --- Quest Detail Page Styles --- */
.detail-page .glass-nav {
    background: rgba(26, 24, 21, 0.9);
}

.quest-detail-hero {
    position: relative;
    padding-top: 150px;
    padding-bottom: 80px;
    background-image: url('assets/hero-bg.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    text-align: center;
    color: var(--clr-text-light);
}

.quest-detail-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 24, 21, 0.85);
    /* 暗めのオーバーレイ */
    z-index: 1;
}

.relative {
    position: relative;
}

.z-10 {
    z-index: 10;
}

.quest-category-badge,
.quest-rank-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    margin: 0 0.5rem 2rem;
}

.quest-category-badge {
    background-color: var(--clr-bg-parchment);
    color: var(--clr-bg-dark);
}

.quest-rank-badge {
    border: 1px solid var(--clr-accent);
    color: var(--clr-accent);
}

.quest-title {
    font-size: 2.8rem;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.quest-meta {
    font-family: var(--font-heading);
    color: var(--clr-accent);
    font-size: 1.2rem;
    opacity: 0.9;
}

.quest-content-area {
    padding: 4rem 0 8rem;
    background-color: var(--clr-bg-dark);
    /* 周りは暗く */
}

.container-narrow {
    max-width: 800px;
}

.paper-scroll {
    background-color: var(--clr-bg-parchment);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
    padding: 5rem 4rem;
    border-radius: 4px;
    box-shadow: inset 0 0 50px rgba(139, 38, 20, 0.05), 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--clr-text-main);
}

.quest-section {
    margin-bottom: 4rem;
}

.section-label {
    font-size: 1.6rem;
    color: var(--clr-primary);
    border-bottom: 2px solid rgba(139, 38, 20, 0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.section-label span {
    font-size: 0.9rem;
    color: #5a5044;
    font-family: var(--font-body);
    font-weight: normal;
    letter-spacing: 0.05em;
}

.quest-section p {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #333;
}

.quest-section strong {
    font-size: 1.25rem;
    color: var(--clr-bg-dark);
    display: block;
    margin-bottom: 0.8rem;
}

.text-center {
    text-align: center;
}

.ornament-line {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(139, 38, 20, 0.5), rgba(0, 0, 0, 0));
    margin: 4rem 0;
}

.quest-action h3 {
    font-size: 1.8rem;
    color: var(--clr-primary);
    margin-bottom: 1rem;
}

.quest-action p {
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

/* --- Quest Section Layout (image + text) --- */
.p-y-main {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.quest-section-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.quest-section-image {
    flex: 0 0 280px;
}

.manga-panel {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(139, 38, 20, 0.2);
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.15);
    display: block;
}

.quest-section-text {
    flex: 1;
}

/* --- Quest Log Meta (Chronology & Contemporaries) --- */
.quest-log-meta-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.quest-log-meta-toggle-btn {
    padding: 0.3rem 0.9rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--clr-accent);
    background: transparent;
    border: 1px solid var(--clr-accent);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.quest-log-meta-toggle-btn:hover {
    background: rgba(196, 154, 69, 0.12);
}

.quest-log-meta-toggle-btn.active {
    background: var(--clr-accent);
    color: var(--clr-bg-dark);
}

.quest-log-meta {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    background: rgba(139, 38, 20, 0.03);
    border: 1px solid rgba(139, 38, 20, 0.1);
    padding: 1.5rem;
    border-radius: 4px;
}

.quest-log-meta.is-hidden {
    display: none;
}

.chronology,
.contemporaries {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* スクロールバーのスタイル */
.chronology::-webkit-scrollbar,
.contemporaries::-webkit-scrollbar {
    width: 6px;
}

.chronology::-webkit-scrollbar-track,
.contemporaries::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.chronology::-webkit-scrollbar-thumb,
.contemporaries::-webkit-scrollbar-thumb {
    background: var(--clr-accent);
    border-radius: 3px;
}

.chronology::-webkit-scrollbar-thumb:hover,
.contemporaries::-webkit-scrollbar-thumb:hover {
    background: var(--clr-primary);
}

.quest-log-meta h4 {
    font-family: var(--font-heading);
    color: var(--clr-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px dashed rgba(139, 38, 20, 0.3);
    padding-bottom: 0.3rem;
}

.quest-log-meta ul {
    list-style: none;
    padding-left: 0;
}

.quest-log-meta li {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    position: relative;
    padding-left: 1.2rem;
    line-height: 1.4;
    color: #555;
}

.quest-log-meta li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--clr-accent);
    font-size: 0.7rem;
    top: 0.1rem;
}

.chronology li b {
    color: var(--clr-primary);
    margin-right: 0.5rem;
}

@media (max-width: 680px) {
    .quest-log-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .quest-section-content {
        flex-direction: column;
    }

    .quest-section-image {
        flex: unset;
        width: 100%;
    }

    .paper-scroll {
        padding: 3rem 1.5rem;
    }

    .quest-title {
        font-size: 2rem;
    }
}

/* --- Resources Section --- */
.resources-section {
    margin-top: 2rem;
}

.resources-heading {
    font-size: 1.6rem;
    color: var(--clr-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.resources-heading span {
    font-size: 0.9rem;
    color: #5a5044;
    font-family: var(--font-body);
    font-weight: normal;
}

.resources-lead {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1.2rem;
    font-style: italic;
}

/* フィルターボタン */
.resources-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.4rem;
}

.filter-btn {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    border: 1.5px solid rgba(139, 38, 20, 0.3);
    background: transparent;
    color: var(--clr-primary);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.filter-btn:hover {
    background: rgba(139, 38, 20, 0.08);
}

.filter-btn.active {
    background: var(--clr-primary);
    color: #fff;
    border-color: var(--clr-primary);
}

/* 縦一列 */
.resources-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resource-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(139, 38, 20, 0.15);
    border-radius: 4px;
    padding: 1.4rem 1.4rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.resource-card.hidden {
    display: none;
}

.resource-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.resource-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    align-self: flex-start;
}

.badge-manga {
    background: #fde8d8;
    color: #c05010;
}

.badge-book {
    background: #dff0e8;
    color: #1a6640;
}

.badge-movie {
    background: #e8e0f8;
    color: #4a2090;
}

.badge-anime {
    background: #fef0d0;
    color: #a06010;
}

.badge-video {
    background: #dce8f8;
    color: #1040a0;
}

.resource-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--clr-bg-dark);
    line-height: 1.4;
    margin: 0;
}

.resource-desc {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.7;
    flex: 1;
}

.resource-link {
    font-size: 0.85rem;
    color: var(--clr-primary);
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
    align-self: flex-start;
}

.resource-link:hover {
    color: var(--clr-accent);
}

/* ─── Quotes Page ─────────────────────────────────────── */
.quotes-hero {
    position: relative;
    background: linear-gradient(135deg, #1a1815 0%, #2c1f1a 100%);
    padding: 8rem 0 4rem;
    text-align: center;
}

.quotes-search-area {
    padding: 3rem 0 5rem;
}

.quotes-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quotes-search-input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1.5px solid rgba(139, 38, 20, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--clr-text-main);
    outline: none;
    transition: border-color 0.2s ease;
}

.quotes-search-input:focus {
    border-color: var(--clr-primary);
}

.quotes-person-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quotes-person-btn {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    border: 1.5px solid rgba(139, 38, 20, 0.3);
    background: transparent;
    color: var(--clr-primary);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.quotes-person-btn:hover {
    background: rgba(139, 38, 20, 0.08);
}

.quotes-person-btn.active {
    background: var(--clr-primary);
    color: #fff;
    border-color: var(--clr-primary);
}

.quotes-fav-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: #555;
    cursor: pointer;
    width: fit-content;
}

.quotes-fav-toggle input {
    cursor: pointer;
    accent-color: var(--clr-primary);
}

.quotes-count {
    font-size: 0.85rem;
    color: #6e6355;
    margin-bottom: 1.5rem;
}

.quotes-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.quote-card {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(139, 38, 20, 0.15);
    border-radius: 4px;
    padding: 1.8rem 2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: box-shadow 0.3s ease;
}

.quote-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.quote-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--clr-bg-dark);
    border-left: 3px solid var(--clr-accent);
    padding-left: 1rem;
    margin: 0;
}

.quote-context {
    font-size: 0.85rem;
    color: #5a5044;
    line-height: 1.7;
}

.quote-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.4rem;
}

.quote-person-link,
.quote-person-name {
    font-size: 0.88rem;
    font-weight: bold;
    color: var(--clr-primary);
    text-decoration: none;
    letter-spacing: 0.04em;
}

.quote-person-link:hover {
    color: var(--clr-accent);
}

.quote-fav-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: transform 0.15s ease;
    line-height: 1;
}

.quote-fav-btn:hover {
    transform: scale(1.2);
}

.quote-fav-btn.is-fav {
    filter: drop-shadow(0 0 4px rgba(255, 200, 0, 0.6));
}

.quotes-empty {
    text-align: center;
    color: #6e6355;
    font-style: italic;
    padding: 3rem 0;
}

.nav-active {
    color: var(--clr-accent) !important;
}

/* ─── Quest Clear ─────────────────────────────────────── */
.quest-answer-input {
    width: 100%;
    max-width: 560px;
    padding: 0.9rem 1.1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.7;
    border: 1.5px solid rgba(139, 38, 20, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--clr-text-main);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
    display: block;
    margin: 1rem auto 0;
}

.quest-answer-input:focus {
    border-color: var(--clr-primary);
}

.quest-answer-input.input-error {
    border-color: #c00;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

.quest-clear-btn {
    margin-top: 1rem;
}

/* スタンプ */
.quest-action {
    position: relative;
}

.quest-clear-stamp {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 80px;
    height: 80px;
    border: 3px solid #2a7a2a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2a7a2a;
    opacity: 0.85;
    transform: rotate(-12deg);
    animation: stamp-in 0.3s ease;
    pointer-events: none;
}

@keyframes stamp-in {
    from {
        transform: rotate(-12deg) scale(1.6);
        opacity: 0;
    }

    to {
        transform: rotate(-12deg) scale(1);
        opacity: 0.85;
    }
}

.clear-stamp-text {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-align: center;
    line-height: 1.4;
}

.quest-cleared-msg {
    font-size: 0.82rem;
    color: #2a7a2a;
    margin-top: 0.6rem;
    font-style: italic;
}

/* トップページのクリアバッジ */
.quest-card {
    position: relative;
}

.clear-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #2a7a2a;
    color: #fff;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
}

.quest-card.is-cleared {
    border-color: rgba(42, 122, 42, 0.4);
    box-shadow: 0 0 0 1px rgba(42, 122, 42, 0.2);
}

/* ─── Timeline Page ───────────────────────────────────── */
.timeline-hero {
    position: relative;
    background: linear-gradient(135deg, #1a1815 0%, #2c1f1a 100%);
    padding: 8rem 0 4rem;
    text-align: center;
}

.timeline-section {
    padding: 2rem 0 5rem;
}

.timeline-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* カテゴリ凡例フィルター */
.tl-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tl-cat-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    border: 1.5px solid var(--cat-color);
    background: transparent;
    color: #6e6355;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    opacity: 0.45;
}

.tl-cat-btn.active {
    background: var(--cat-color);
    color: #fff;
    opacity: 1;
}

.tl-cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cat-color);
    flex-shrink: 0;
}

.tl-cat-btn.active .tl-cat-dot {
    background: rgba(255, 255, 255, 0.8);
}

.tl-order-btn {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    border: 1.5px solid var(--clr-accent);
    background: transparent;
    color: var(--clr-accent);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-left: auto;
}

.tl-order-btn:hover,
.tl-order-btn.reversed {
    background: var(--clr-accent);
    color: var(--clr-bg-dark);
}

.tl-era-nav {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(139, 38, 20, 0.2);
}

.tl-era-btn {
    flex: 1;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 0.5rem;
    border: none;
    border-right: 1px solid rgba(139, 38, 20, 0.15);
    background: rgba(255, 255, 255, 0.5);
    color: var(--clr-text-main);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    letter-spacing: 0.05em;
}

.tl-era-btn:last-child {
    border-right: none;
}

.tl-era-btn:hover {
    background: var(--clr-accent);
    color: var(--clr-bg-dark);
}

/* タイムライン本体 */
.tl-outer {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(139, 38, 20, 0.15);
    border-radius: 4px;
    padding: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.tl-canvas {
    position: relative;
}

/* 年ラベル */
.tl-year-label {
    position: absolute;
    left: 0;
    width: 52px;
    text-align: right;
    font-size: 0.78rem;
    font-family: var(--font-heading);
    color: #6e6355;
    transform: translateY(-50%);
    padding-right: 6px;
    pointer-events: none;
    font-weight: 600;
}

/* グリッド線 */
.tl-grid-line {
    position: absolute;
    height: 1px;
    background: rgba(139, 38, 20, 0.06);
    pointer-events: none;
}

.tl-grid-major {
    background: rgba(139, 38, 20, 0.18);
}

/* 人物バー */
.tl-bar {
    position: absolute;
    border-radius: 2px 2px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: filter 0.15s, box-shadow 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.tl-bar:hover {
    filter: brightness(1.15);
    z-index: 5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tl-bar-link {
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(196, 154, 69, 0.4);
}

.tl-bar-link:hover {
    box-shadow: 0 0 0 2px var(--clr-accent), 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* 国旗 */
.tl-flag {
    font-size: 9px;
    line-height: 1.2;
    flex-shrink: 0;
    padding-top: 2px;
}

/* 縦書き名前 */
.tl-name {
    writing-mode: vertical-rl;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    padding: 3px 1px;
    max-height: calc(100% - 16px);
    font-family: var(--font-body);
    letter-spacing: 0.04em;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ツールチップ */
.tl-tooltip {
    position: fixed;
    background: rgba(26, 24, 21, 0.96);
    color: var(--clr-text-light);
    padding: 0.7rem 1rem;
    border-radius: 4px;
    font-size: 0.82rem;
    pointer-events: none;
    z-index: 9999;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 180px;
    display: none;
}

.tl-tt-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--clr-accent);
}

.tl-tt-en {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 0.3rem;
    font-style: italic;
}

.tl-tt-years {
    color: #bbb;
    font-size: 0.8rem;
}

.tl-tt-cat {
    color: #aaa;
    font-size: 0.75rem;
    margin-top: 0.1rem;
}

.tl-tt-desc {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #ccc;
    margin-top: 0.4rem;
    max-width: 280px;
}

.tl-tt-hint {
    color: var(--clr-accent);
    font-size: 0.75rem;
    margin-top: 0.3rem;
    font-style: italic;
}

/* ─── Face Grid (Quest Board) ─────────────────────────── */
.face-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

.face-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.face-item:hover {
    transform: translateY(-4px);
}

.face-item img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(196, 154, 69, 0.4);
    background: rgba(139, 38, 20, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================================================
   Manga (Comic) Intro Styles
   ========================================================================== */
.intro-comic-section {
    position: relative;
    max-width: 600px;
    margin: 0 auto 30px;
    text-align: center;
    animation: fadeInUp 0.5s ease forwards;
}

.intro-comic-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 3px solid var(--rpg-border-dark);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* レトロ感を強調 */
    filter: sepia(0.4) contrast(1.1) brightness(0.95);
}

.intro-comic-img:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.comic-catchphrase {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--rpg-border-dark);
    margin-bottom: 20px;
    font-style: italic;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .comic-catchphrase {
        font-size: 1.2rem;
    }
}

/* ==========================================================================
   Skill Filter Styles (Quest Board)
   ========================================================================== */
.skill-filter-container {
    margin-bottom: 2rem;
    text-align: center;
    animation: fadeIn 0.8s ease forwards;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(139, 38, 20, 0.2);
    color: #555;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    font-family: 'Noto Serif JP', serif;
}

.skill-tag:hover {
    background: rgba(139, 38, 20, 0.1);
    border-color: var(--clr-primary);
    transform: translateY(-2px);
}

.skill-tag.active {
    background: var(--clr-primary);
    color: #fff;
    border-color: var(--clr-primary);
    box-shadow: 0 4px 10px rgba(139, 38, 20, 0.3);
}

.hide-card {
    display: none !important;
}

.face-item:hover img {
    border-color: var(--clr-accent);
    box-shadow: 0 4px 16px rgba(196, 154, 69, 0.3);
}

.face-item span {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: bold;
    color: var(--clr-text-main);
    text-align: center;
    line-height: 1.3;
}

.face-item.is-cleared img {
    border-color: #2a7a2a;
    box-shadow: 0 0 0 3px rgba(42, 122, 42, 0.25);
}

.face-item .clear-badge {
    position: absolute;
    top: -4px;
    right: -4px;
}

@media (max-width: 600px) {
    .face-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 1rem;
    }

    .face-item img {
        width: 80px;
        height: 80px;
    }
}

/* ─── LINE-style Chat UI ────────────────────────────── */
.chat-container {
    background-color: #8faada;
    /* LINE風の背景色に近いブルー */
    border-radius: 8px;
    margin-bottom: 4rem;
    /* 次のセクションへの余白 */
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.chat-header {
    background-color: #273246;
    /* レトロなヘッダーに近い色 */
    color: #fff;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: bold;
}

.chat-header .chat-back {
    margin-right: 1rem;
    font-weight: normal;
    cursor: pointer;
}

.chat-body {
    padding: 1rem;
}

.chat-date {
    text-align: center;
    margin: 1rem 0 1.5rem;
}

.chat-date span {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 0.8rem;
    padding: 0.2rem 1rem;
    border-radius: 16px;
}

.chat-message {
    display: flex;
    margin-bottom: 1.2rem;
    align-items: flex-end;
    /* 時間を下揃えにするため */
}

.chat-message.right {
    flex-direction: row-reverse;
}

.chat-avatar-wrap {
    width: 44px;
    height: 44px;
    margin-right: 0.8rem;
    flex-shrink: 0;
}

.chat-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.chat-message.right .chat-avatar-wrap {
    display: none;
    /* 自分側はアバターなし（LINE標準） */
}

.chat-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.chat-message.right .chat-bubble-wrap {
    align-items: flex-end;
}

.chat-bubble {
    position: relative;
    padding: 0.6rem 1rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-break: break-word;
}

/* 尻尾の表現 */
.chat-message.left .chat-bubble {
    background-color: #fff;
    border-top-left-radius: 2px;
}

.chat-message.right .chat-bubble {
    background-color: #85e249;
    /* LINEの緑 */
    border-top-right-radius: 2px;
}

.chat-time-out {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0.4rem;
    margin-bottom: 0.2rem;
    /* 吹き出しの下側に合わせる */
}

/* ── EXP Stats セクション ── */
.exp-stats-section {
    background: var(--clr-bg-parchment);
    padding: 6rem 0;
}

.exp-stats-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(139, 38, 20, 0.15);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.exp-total-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 2rem;
    background: var(--clr-bg-dark);
    border-radius: 8px;
    border: 1px solid var(--clr-accent);
}

.exp-total-label {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--clr-accent);
    letter-spacing: 0.1em;
}

.exp-total-value {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--clr-accent);
}

.exp-chart {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.exp-no-data {
    text-align: center;
    color: var(--clr-text-main);
    opacity: 0.7;
    padding: 2rem 0;
    font-size: 0.95rem;
}

.exp-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exp-bar-label {
    flex: 0 0 160px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--clr-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exp-bar-track {
    flex: 1;
    height: 32px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.exp-bar-fill {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.6rem;
    min-width: 50px;
}

.exp-bar-value {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .exp-bar-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
    }

    .exp-bar-label {
        flex: none;
        text-align: left;
        font-size: 0.85rem;
    }

    .exp-total-value {
        font-size: 1.8rem;
    }
}

/* ── スキル解説 ── */
.skill-analysis {
    margin-top: 2rem;
    border-top: 1px solid rgba(196, 154, 69, 0.3);
    padding-top: 2rem;
}

.analysis-heading {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--clr-primary);
    text-align: center;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.analysis-lead {
    text-align: center;
    font-size: 0.9rem;
    color: var(--clr-text-main);
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.analysis-card {
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.03);
    border-left: 3px solid var(--clr-accent);
    border-radius: 0 8px 8px 0;
}

.analysis-skill-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--clr-primary);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.analysis-skill-name {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--clr-accent);
    background: rgba(196, 154, 69, 0.12);
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    letter-spacing: 0.05em;
}

.analysis-heroes {
    font-size: 0.8rem;
    color: var(--clr-accent);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.analysis-desc {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--clr-text-main);
}

/* ── 保存済みビジョン表示 (マイページ) ── */
.saved-vision-display {
    padding: 1.5rem;
    background: rgba(196, 154, 69, 0.06);
    border: 1px solid rgba(196, 154, 69, 0.25);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.saved-vision-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--clr-accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.saved-vision-text {
    font-size: 1rem;
    color: var(--clr-text-main);
    line-height: 1.7;
    margin-bottom: 0.8rem;
    white-space: pre-wrap;
}

.saved-skill-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.saved-skill-tag {
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--clr-bg-dark);
    background: var(--clr-accent);
    border-radius: 12px;
}

.btn-secondary {
    padding: 0.4rem 1.2rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--clr-accent);
    background: transparent;
    border: 1px solid var(--clr-accent);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(196, 154, 69, 0.12);
}

/* ── Vision vs Status アドバイス (EXP Stats) ── */
.vision-advice {
    margin-top: 2rem;
    border-top: 1px solid rgba(196, 154, 69, 0.3);
    padding-top: 2rem;
}

.advice-heading {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--clr-primary);
    text-align: center;
    letter-spacing: 0.1em;
    margin-bottom: 1.2rem;
}

.advice-vision-box {
    padding: 1.2rem 1.5rem;
    background: rgba(196, 154, 69, 0.06);
    border: 1px solid rgba(196, 154, 69, 0.25);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.advice-vision-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--clr-accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.advice-vision-text {
    font-size: 0.95rem;
    color: var(--clr-text-main);
    line-height: 1.6;
    margin-bottom: 0.6rem;
}

.advice-target-skills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.advice-target-tag {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--clr-bg-dark);
    background: var(--clr-accent);
    border-radius: 10px;
}

.advice-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.advice-item {
    padding: 1.2rem 1.4rem;
    border-radius: 8px;
    position: relative;
}

.advice-acquired {
    background: rgba(42, 122, 42, 0.06);
    border-left: 3px solid #2a7a2a;
}

.advice-missing {
    background: rgba(139, 38, 20, 0.04);
    border-left: 3px solid var(--clr-primary);
}

.advice-status-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    border-radius: 10px;
    margin-bottom: 0.4rem;
}

.advice-status-badge.acquired {
    color: #fff;
    background: #2a7a2a;
}

.advice-status-badge.missing {
    color: #fff;
    background: var(--clr-primary);
}

.advice-skill-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--clr-text-main);
    margin-bottom: 0.3rem;
}

.advice-exp {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--clr-accent);
}

.advice-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--clr-text-main);
    margin-bottom: 0.4rem;
}

.advice-quest,
.advice-next {
    font-size: 0.83rem;
    line-height: 1.5;
    color: var(--clr-text-main);
    opacity: 0.85;
    margin-bottom: 0.2rem;
}

.advice-summary {
    text-align: center;
    padding: 2.5rem 2rem;
    margin-top: 2rem;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(139, 38, 20, 0.15);
    border-radius: 8px;
}

.advice-summary-text {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--clr-text-main);
    margin-bottom: 1.5rem;
}

.advice-cta {
    text-align: center;
    padding: 2.5rem 2rem;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(139, 38, 20, 0.15);
    border-radius: 8px;
}

.advice-cta-text {
    font-size: 0.9rem;
    color: var(--clr-text-main);
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

/* ── 関連偉人ポップアップ ── */
.related-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.related-overlay.show {
    opacity: 1;
}

.related-popup {
    background: var(--clr-bg-parchment);
    border: 2px solid var(--clr-accent);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.related-overlay.show .related-popup {
    transform: translateY(0);
}

.related-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--clr-accent);
    letter-spacing: 0.12em;
    margin-bottom: 0.2rem;
}

.related-subtitle {
    font-size: 0.85rem;
    color: var(--clr-text-main);
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.related-cards {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.related-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--clr-text-main);
    padding: 0.8rem;
    border: 1px solid rgba(196, 154, 69, 0.3);
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
    width: 130px;
}

.related-card:hover {
    background: rgba(196, 154, 69, 0.12);
    border-color: var(--clr-accent);
}

.related-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--clr-accent);
}

.related-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.related-skills {
    font-size: 0.7rem;
    color: var(--clr-primary);
    opacity: 0.8;
    line-height: 1.3;
}

.related-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

.related-close-btn {
    cursor: pointer;
}

@media (max-width: 600px) {
    .related-popup {
        padding: 1.5rem 1rem;
    }

    .related-card {
        width: 100px;
    }

    .related-img {
        width: 48px;
        height: 48px;
    }
}

/* ── 顔画像ツールチップ ── */
.face-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: 300px;
    padding: 0.7rem 1rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--clr-text-light);
    background: rgba(26, 24, 21, 0.95);
    border: 1px solid var(--clr-accent);
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.face-tooltip.show {
    opacity: 1;
}

/* ── Quest Board CTA ── */
.quest-board-cta {
    background: var(--clr-bg-dark);
    padding: 5rem 0;
}

.quest-board-cta .section-title,
.quest-board-cta .section-subtitle {
    color: var(--clr-text-light);
}

/* ── Sort ── */
.sort-container {
    text-align: center;
    margin-bottom: 2rem;
}

.sort-group {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 0.45rem 1.2rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--clr-text-light);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(196, 154, 69, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.sort-btn:hover {
    background: rgba(196, 154, 69, 0.15);
    border-color: var(--clr-accent);
}

.sort-btn.active {
    background: var(--clr-accent);
    color: var(--clr-bg-dark);
    border-color: var(--clr-accent);
}

/* ── Find Your Hero 検索エリア ── */
.hero-search-container {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-search-group {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

.quest-search-input,
.quest-hero-select {
    padding: 0.7rem 1.1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(196, 154, 69, 0.5);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.quest-search-input {
    width: 280px;
}

.quest-search-input::placeholder {
    color: rgba(228, 220, 204, 0.6);
}

.quest-search-input:focus,
.quest-hero-select:focus {
    border-color: var(--clr-accent);
    box-shadow: 0 0 14px rgba(196, 154, 69, 0.4);
    background: rgba(255, 255, 255, 0.18);
}

.quest-hero-select {
    width: 240px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c49a45' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.quest-hero-select option {
    background: var(--clr-bg-dark);
    color: var(--clr-text-light);
}

@media (max-width: 600px) {
    .quest-search-input,
    .quest-hero-select {
        width: 100%;
    }
}

/* ── クイズモード ── */
.quiz-container {
    max-width: 560px;
    margin: 1.5rem auto;
    text-align: left;
}

.quiz-question {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.quiz-q-text {
    font-size: 1rem;
    margin-bottom: 0.6rem;
    color: var(--clr-text-main);
    line-height: 1.6;
}

.quiz-choices {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.quiz-choice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(139, 38, 20, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.quiz-choice:hover {
    background: rgba(196, 154, 69, 0.1);
}

.quiz-choice input[type="radio"] {
    accent-color: var(--clr-primary);
    flex-shrink: 0;
}

.quiz-choice.is-correct {
    border-color: #2a7a2a;
    background: rgba(42, 122, 42, 0.1);
}

.quiz-choice.is-wrong {
    border-color: #c00;
    background: rgba(200, 0, 0, 0.08);
}

.quiz-feedback {
    font-size: 0.85rem;
    margin-top: 0.4rem;
    font-weight: 600;
}

/* ── マイページ ── */
.mypage-section-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--clr-primary);
    margin-bottom: 0.5rem;
}

.mypage-desc {
    color: var(--clr-text-main);
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.mode-options {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.5rem 2rem;
    border: 2px solid var(--clr-accent);
    background: transparent;
    color: var(--clr-text-main);
    font-family: var(--font-body);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    min-width: 200px;
}

.mode-btn:hover {
    background: rgba(196, 154, 69, 0.12);
}

.mode-btn.active {
    background: var(--clr-accent);
    color: var(--clr-bg-dark);
    box-shadow: 0 0 20px rgba(196, 154, 69, 0.4);
    border-color: var(--clr-accent);
}

.mode-icon {
    font-size: 2rem;
}

.mode-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
}

.mode-detail {
    font-size: 0.8rem;
    opacity: 0.8;
    text-align: center;
}

.mode-current {
    text-align: center;
    font-size: 0.95rem;
    color: var(--clr-accent);
    font-weight: 600;
    margin-top: 0.5rem;
}

.cleared-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cleared-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    background: rgba(196, 154, 69, 0.08);
    border: 1px solid rgba(196, 154, 69, 0.2);
    border-radius: 6px;
    text-decoration: none;
    color: var(--clr-text-main);
    transition: background 0.2s;
}

.cleared-item:hover {
    background: rgba(196, 154, 69, 0.18);
}

.cleared-name {
    font-weight: 600;
}

.cleared-date {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ── My Vision ── */
.my-vision-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--clr-text-main);
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(139, 38, 20, 0.2);
    border-radius: 6px;
    outline: none;
    resize: vertical;
    transition: border-color 0.3s;
}

.my-vision-input:focus {
    border-color: var(--clr-accent);
}

.skill-select-area {
    margin-top: 1.2rem;
}

.skill-select-label {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--clr-primary);
    margin-bottom: 0.6rem;
}

.skill-select-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-select-tag {
    padding: 0.35rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--clr-text-main);
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(139, 38, 20, 0.15);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s;
}

.skill-select-tag:hover {
    background: rgba(196, 154, 69, 0.12);
    border-color: var(--clr-accent);
}

.skill-select-tag.selected {
    background: var(--clr-accent);
    color: var(--clr-bg-dark);
    border-color: var(--clr-accent);
    font-weight: 600;
}

.my-skill-display {
    margin-top: 1.5rem;
}

.my-skill-display-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--clr-accent);
    letter-spacing: 0.1em;
    margin-bottom: 0.8rem;
    text-align: center;
}

.my-skill-display-reason {
    text-align: center;
    font-size: 0.85rem;
    color: var(--clr-text-main);
    opacity: 0.7;
    margin-bottom: 1rem;
}

.btn-save {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.my-skill-cards {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.my-skill-card {
    flex: 1;
    min-width: 150px;
    max-width: 220px;
    padding: 1rem;
    background: rgba(196, 154, 69, 0.08);
    border: 1px solid rgba(196, 154, 69, 0.3);
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.my-skill-num {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--clr-accent);
    line-height: 1;
}

.my-skill-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--clr-primary);
}

.my-skill-desc {
    font-size: 0.75rem;
    color: var(--clr-text-main);
    opacity: 0.7;
    line-height: 1.4;
}

.vision-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.btn-to-quest {
    text-decoration: none;
    text-align: center;
}

.vision-saved-msg {
    text-align: center;
    color: #2a7a2a;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ── 閲覧履歴 ── */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    text-decoration: none;
    color: var(--clr-text-main);
    transition: background 0.2s;
}

.history-item:hover {
    background: rgba(196, 154, 69, 0.12);
}

.history-item.is-cleared {
    border-left: 3px solid #2a7a2a;
}

.history-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.history-date {
    font-size: 0.78rem;
    opacity: 0.6;
    white-space: nowrap;
}

/* ── ハンバーガーメニューボタン ── */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--clr-text-light);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ×アニメーション（.nav-open がbodyについた時） */
.nav-open .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-open .hamburger span:nth-child(2) {
    opacity: 0;
}

.nav-open .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── ハンバーガーメニュー (960px以下) ── */
@media (max-width: 960px) {
    .hamburger {
        display: flex;
        order: 3;
        margin-left: auto;
    }

    .nav-container {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        padding: 0.8rem 1rem;
        gap: 0;
    }

    .nav-container .logo {
        order: 1;
    }

    .nav-container nav {
        order: 2;
    }

    nav ul {
        display: none;
    }

    /* メニュー開いた時のフルスクリーンオーバーレイ */
    .nav-open nav ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--glass-bg-dark);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        z-index: 1050;
        gap: 2rem;
        padding: 0;
        margin: 0;
    }

    .nav-open nav a {
        font-size: 1.4rem;
        letter-spacing: 0.15em;
        color: var(--clr-text-light);
    }

    .nav-open nav a:hover {
        color: var(--clr-accent);
    }

    .logo {
        font-size: 1.1rem;
    }
}

@media (max-width: 600px) {
    .mode-options {
        flex-direction: column;
        align-items: stretch;
    }

    .mode-btn {
        min-width: unset;
    }
}