:root {
    --bg-color: #08080a;
    --card-bg: #121216;
    --text-primary: #e0e0e0;
    --text-secondary: #999;
    --gold: #c5a059;
    --gold-light: #dfc285;
    
    --attr-attachment: #9b59b6;
    --attr-sloth:      #3498db;
    --attr-wrath:      #e74c3c;
    --attr-pride:      #7f8c8d;
    --attr-delusion:   #2ecc71;
}

body { 
    background-color: var(--bg-color); 
    color: var(--text-primary); 
    font-family: 'Shippori Mincho', sans-serif; 
    margin: 0; 
    padding: 0; 
}

/* ヘッダー全体 */
.site-header {
    text-align: center;
    padding: 60px 20px 40px 20px;
    position: relative;
    overflow: hidden;
    background: var(--bg-color);
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, 
        rgba(155, 89, 182, 0.12), 
        rgba(52, 152, 219, 0.12), 
        rgba(231, 76, 60, 0.12),  
        rgba(127, 140, 141, 0.1), 
        rgba(46, 204, 113, 0.12)  
    );
    background-size: 400% 400%;
    animation: attributeShift 18s ease infinite;
    z-index: 1;
    pointer-events: none;
}

.site-header > * {
    position: relative;
    z-index: 2;
}

@keyframes attributeShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 100%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 0%; }
    100% { background-position: 0% 50%; }
}

.title-wrapper {
    position: relative;
    display: inline-block;
}

.title-wrapper::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gold);
    opacity: 0.8;
}

.title-wrapper::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gold);
    opacity: 0.8;
}

/* タイトル文字のネオンエフェクト設定 */
.site-header h1 {
    font-family: 'Zen Old Mincho', serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin: 0;
    color: var(--gold);
    white-space: nowrap;
}

.char-neon {
    display: inline-block;
    transition: color 0.4s ease, text-shadow 0.4s ease;
    color: rgba(197, 160, 89, 0.5); /* 通常時は少し落ち着いたトーン */
    text-shadow: none;
}

/* 1文字ずつ点灯したときのネオン発光状態 */
.char-neon.active,
.char-neon.all-glow {
    color: #fff;
    text-shadow: 0 0 8px rgba(197, 160, 89, 0.8), 
                 0 0 20px rgba(197, 160, 89, 0.6), 
                 0 0 35px rgba(197, 160, 89, 0.4);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    margin-top: 12px;
    font-weight: 300;
}

.header-description {
    font-size: 0.9rem;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    margin-top: 15px;
    line-height: 1.8;
    text-align: center;
    max-width: 600px;
}

.header-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.lore-btn {
    background: rgba(197, 160, 89, 0.05);
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 10px 0;
    width: 200px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    transition: all 0.3s;
    border-radius: 2px;
}

.lore-btn:hover {
    background: rgba(197, 160, 89, 0.2);
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.3);
}

/* ソーシャルリンク（高さズレ防止 ＆ 約5mmの隙間設定） */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px; /* アイコン間の隙間（約5mm相当） */
    margin-top: 20px;
}

.insta-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(212, 175, 55, 0.5); /* 金色の薄い枠線 */
    border-radius: 50%;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
}

.insta-icon-link:hover {
    border-color: rgba(212, 175, 55, 1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.insta-icon-link svg {
    display: block;
    margin: auto;
}

/* Xアイコンの高さ微調整 */
.x-icon-link svg {
    position: relative;
    top: 1px;
}

.main-container { max-width: 1200px; margin: 0 auto; padding: 30px 15px; }

.loading-text {
    text-align: center;
    grid-column: 1 / -1;
    color: var(--text-secondary);
    padding: 40px 0;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

.filter-container { display: flex; justify-content: center; gap: 8px; margin-bottom: 30px; flex-wrap: wrap; }
.filter-btn { 
    background: var(--card-bg); 
    color: var(--text-primary); 
    border: 1px solid #333; 
    padding: 8px 16px; 
    cursor: pointer; 
    font-family: inherit; 
    font-size: 0.85rem;
    transition: 0.3s; 
    border-radius: 2px;
}
.filter-btn:hover { border-color: var(--gold); color: var(--gold); }

.filter-btn.active[data-attribute="all"] { border-color: var(--gold); color: var(--gold); background: rgba(197, 160, 89, 0.05); }
.filter-btn.active[data-attribute="Attachment"] { border-color: var(--attr-attachment); color: var(--attr-attachment); background: rgba(155, 89, 182, 0.08); box-shadow: 0 0 10px rgba(155, 89, 182, 0.3); }
.filter-btn.active[data-attribute="Sloth"]      { border-color: var(--attr-sloth); color: var(--attr-sloth); background: rgba(52, 152, 219, 0.08); box-shadow: 0 0 10px rgba(52, 152, 219, 0.3); }
.filter-btn.active[data-attribute="Wrath"]     { border-color: var(--attr-wrath); color: var(--attr-wrath); background: rgba(231, 76, 60, 0.08); box-shadow: 0 0 10px rgba(231, 76, 60, 0.3); }
.filter-btn.active[data-attribute="Pride"]      { border-color: var(--attr-pride); color: var(--attr-pride); background: rgba(127, 140, 141, 0.08); box-shadow: 0 0 10px rgba(127, 140, 141, 0.3); }
.filter-btn.active[data-attribute="Delusion"]   { border-color: var(--attr-delusion); color: var(--attr-delusion); background: rgba(46, 204, 113, 0.08); box-shadow: 0 0 10px rgba(46, 204, 113, 0.3); }

.character-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
}

@media (min-width: 768px) {
    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 25px;
    }
}

.char-card { background-color: var(--card-bg); border: 1px solid #222; border-radius: 4px; overflow: hidden; cursor: pointer; transition: transform 0.3s, border-color 0.3s; }
.char-card:hover { transform: translateY(-4px); border-color: var(--gold); }

.char-card[data-attribute="Attachment"] { border-left: 3px solid var(--attr-attachment); }
.char-card[data-attribute="Sloth"]      { border-left: 3px solid var(--attr-sloth); }
.char-card[data-attribute="Wrath"]     { border-left: 3px solid var(--attr-wrath); }
.char-card[data-attribute="Pride"]      { border-left: 3px solid var(--attr-pride); }
.char-card[data-attribute="Delusion"]   { border-left: 3px solid var(--attr-delusion); }

.char-attr-tag { font-size: 0.75rem; padding: 2px 8px; border-radius: 2px; color: #fff; display: inline-block; margin-bottom: 6px; letter-spacing: 0.05em; }
.char-card[data-attribute="Attachment"] .char-attr-tag { background: var(--attr-attachment); }
.char-card[data-attribute="Sloth"]      .char-attr-tag { background: var(--attr-sloth); }
.char-card[data-attribute="Wrath"]     .char-attr-tag { background: var(--attr-wrath); }
.char-card[data-attribute="Pride"]      .char-attr-tag { background: var(--attr-pride); }
.char-card[data-attribute="Delusion"]   .char-attr-tag { background: var(--attr-delusion); }

.char-image-wrap { width: 100%; height: 220px; background: #000; overflow: hidden; display: flex; align-items: center; justify-content: center; }
@media (min-width: 768px) {
    .char-image-wrap { height: 380px; }
}
.char-image-wrap img { width: 100%; height: 100%; object-fit: contain; }

.char-info { padding: 12px; }
@media (min-width: 768px) {
    .char-info { padding: 18px; }
}
.char-name { font-size: 1rem; margin: 0 0 4px 0; font-weight: bold; }
@media (min-width: 768px) {
    .char-name { font-size: 1.25rem; margin: 0 0 6px 0; }
}
.char-klesha { font-size: 0.75rem; color: var(--text-secondary); margin: 0; }
@media (min-width: 768px) {
    .char-klesha { font-size: 0.85rem; }
}

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); display: flex; justify-content: center; align-items: center; z-index: 1000; padding: 15px; box-sizing: border-box; }
.modal.hidden { display: none; }
.modal-content { background: var(--card-bg); width: 100%; max-width: 800px; max-height: 85vh; overflow-y: auto; padding: 25px; border: 1px solid var(--gold); position: relative; border-radius: 4px; box-shadow: 0 0 40px rgba(0,0,0,0.8); }
.close-btn { position: absolute; top: 12px; right: 15px; background: none; border: none; color: var(--text-primary); font-size: 1.8rem; cursor: pointer; }