:root {
    --bg-color: #0d0d0d;
    --text-color: #e0e0e0;
    --accent-color: #ff3e3e;
    /* ホラーな赤 */
    --sub-accent-color: #ff99cc;
    /* ゆるかわなピンク */
    --card-bg: #1a1a1a;
    --nav-bg: rgba(0, 0, 0, 0.82);
    --font-main: 'Noto Sans JP', sans-serif;
    --font-heading: 'Sawarabi Mincho', serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 背景にうっすら霧のようなグラデーション */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(40, 0, 0, 0.2) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* ヘッダー・ナビゲーション */
header {
    padding: 2rem 1rem;
    text-align: center;
}

.logo-container {
    margin-bottom: 1rem;
}

.main-logo {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 62, 62, 0.3);
}

h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--sub-accent-color);
}

nav {
    background-color: var(--nav-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 153, 204, 0.2);
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
    padding: 0.5rem;
}

nav ul li {
    margin: 0.5rem 1.2rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    transition: color 0.3s;
    font-size: 1.2rem;
    letter-spacing: 0.05rem;
}

nav ul li a:hover {
    color: var(--sub-accent-color);
}

/* メインコンテンツ */
main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    margin-bottom: 4rem;
}

h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

/* 妖怪おみくじセクション */
.omikuji-section {
    text-align: center;
}

.uranaidama-container {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
    position: relative;
    max-width: 200px;
    animation: uranaidama-pulse 3s infinite ease-in-out;
}

.uranaidama-container:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 15px rgba(255, 153, 204, 0.6));
}

.uranaidama-img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 5px rgba(255, 153, 204, 0.2));
    transition: filter 0.3s;
}

.uranaidama-container:active .uranaidama-img {
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.8)) brightness(1.2);
}

@keyframes uranaidama-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(255, 153, 204, 0.2));
    }

    50% {
        transform: scale(1.03);
        filter: drop-shadow(0 0 15px rgba(255, 153, 204, 0.4));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(255, 153, 204, 0.2));
    }
}

.manga-page-img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
    background-color: var(--card-bg);
    margin-bottom: 1.5rem;
}

.manga-viewer {
    max-width: 800px;
    margin: 0 auto;
}

/* モーダル（ポップアップ）のスタイル */
.modal {
    display: none;
    /* 最初は非表示 */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    /* 背景を暗く */
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    position: relative;
    max-width: 90%;
    width: 450px;
    text-align: center;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(255, 62, 62, 0.4);
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2.5rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close-button:hover {
    color: var(--accent-color);
}

.omikuji-result {
    margin-top: 1rem;
    display: block;
    /* モーダル内では常にブロック表示 */
}

.yokai-img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 15px rgba(255, 153, 204, 0.3);
}

.yokai-msg {
    font-size: 1.1rem;
    color: var(--sub-accent-color);
    background: rgba(0, 0, 0, 0.5);
    padding: 1.2rem;
    border-radius: 12px;
    border-left: 5px solid var(--accent-color);
    text-align: left;
    line-height: 1.8;
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* 妖怪図鑑：行ごとのレイアウト */
.zukan-row {
    margin-bottom: 4rem;
}

.zukan-row-title {
    font-size: 1.5rem;
    color: var(--accent-color);
    border-bottom: 1px solid rgba(255, 62, 62, 0.3);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    font-family: var(--font-heading);
}

/* 妖怪漫画ページ */
.manga-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 2rem auto;
}

@media (max-width: 768px) {
    .manga-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.manga-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #000;
    border: 1px solid #fff;
    padding: 1.5rem;
    text-decoration: none;
    color: #fff;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}

.manga-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(255, 62, 62, 0.3);
}

/* 四隅の装飾（シンプルな角のライン） */
.manga-card .corner-tl,
.manga-card .corner-tr,
.manga-card .corner-bl,
.manga-card .corner-br {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border: 1.5px solid #fff;
    background: transparent;
}

/* 各角の不要な辺を消してL字にする */
.manga-card .corner-tl {
    top: 5px;
    left: 5px;
    border-right: none;
    border-bottom: none;
}

.manga-card .corner-tr {
    top: 5px;
    right: 5px;
    border-left: none;
    border-bottom: none;
}

.manga-card .corner-bl {
    bottom: 5px;
    left: 5px;
    border-right: none;
    border-top: none;
}

.manga-card .corner-br {
    bottom: 5px;
    right: 5px;
    border-left: none;
    border-top: none;
}

/* 以前の丸い装飾と接続線のスタイルを削除または非表示 */
.manga-card::before,
.manga-card::after,
.manga-card .corner-tl::after,
.manga-card .corner-tr::after,
.manga-card .corner-bl::after,
.manga-card .corner-br::after {
    display: none;
}

.manga-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.manga-title {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    /* 10文字が収まるように調整 */
    font-weight: bold;
    margin-bottom: 1rem;
    text-align: center;
    width: 100%;
    display: block;
}

.manga-thumbnail-box {
    width: 100%;
    background: #808080;
    /* グレーの背景 */
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.manga-thumbnail {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
}

.zukan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.zukan-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.zukan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 62, 62, 0.2);
    border-color: var(--sub-accent-color);
}

.zukan-card-img-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #000;
}

.zukan-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.zukan-card:hover .zukan-card-img {
    transform: scale(1.1);
}

.zukan-card-info {
    padding: 0.8rem;
    text-align: center;
}

.zukan-card-name {
    font-weight: bold;
    font-size: 1rem;
    color: var(--text-color);
}

/* 読み込み中（スケルトン）アニメーション */
@keyframes skeleton-loading {
    0% {
        background-color: rgba(255, 255, 255, 0.05);
    }

    50% {
        background-color: rgba(255, 255, 255, 0.1);
    }

    100% {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

.skeleton {
    animation: skeleton-loading 1.5s infinite ease-in-out;
}

/* 画像のふわっと表示 */
.img-fade-in {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.img-fade-in.loaded {
    opacity: 1;
}

/* おみくじ読み込み中 */
.omikuji-loading {
    display: none;
    color: var(--sub-accent-color);
    font-size: 0.9rem;
    margin: 1rem 0;
}

.omikuji-loading.show {
    display: block;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 0.3rem 0;
    }

    .zukan-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
}

/* フッター */
footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    color: #666;
}

.footer-warning {
    margin-bottom: 0.5rem;
    color: #888;
    font-size: 0.85rem;
}


/* 妖怪図鑑：案内文とナビゲーション */
.zukan-intro {
    text-align: center;
    background: rgba(255, 255, 0, 0.05);
    /* 背景を薄い黄色系に変更 */
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    color: #ffff00;
    /* 文字色を黄色に変更 */
    font-weight: bold;
}

.zukan-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 15px;
    position: sticky;
    top: 70px;
    /* ナビゲーションバーの下に固定 */
    z-index: 900;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.zukan-nav-link {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.zukan-nav-link:hover {
    background: var(--accent-color);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--accent-color);
}

/* スムーズスクロール */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 140px;
    /* 固定ヘッダー分を考慮 */
}

/* タイムラインセクション */
.profile-section,
.latest-info-section {
    max-width: 1000px;
    margin: 3rem auto;
}

#timeline-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

#timeline-container::-webkit-scrollbar {
    width: 6px;
}

#timeline-container::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 10px;
}

.timeline-post {
    background: var(--card-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 15px;
    text-align: left;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #ffffff;
    object-fit: cover;
}

.post-meta {
    display: flex;
    flex-direction: column;
}

.post-user-name {
    font-weight: bold;
    color: var(--text-color);
}

.post-date {
    font-size: 0.8rem;
    color: #888;
}

.post-content {
    margin-left: 0;
    /* スマホで見やすいように調整 */
}

.post-text {
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 以前のコメント機能のスタイルは削除されました */

/* 妖怪TV：動画ギャラリー */
.tv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 480px) {
    .tv-grid {
        grid-template-columns: 1fr;
    }
}

.tv-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.tv-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 62, 62, 0.2);
}

.tv-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    cursor: pointer;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.tv-box:hover {
    transform: scale(1.02);
    transition: transform 0.3s;
}

.tv-trigger {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s, transform 0.3s;
    z-index: 2;
}

.tv-box:hover .tv-trigger {
    background-color: #ff0000;
    transform: translate(-50%, -50%) scale(1.1);
}

.tv-trigger::before {
    content: '';
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
}

.tv-info {
    padding: 1rem;
}

.tv-title {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.tv-desc {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.4;
}