/* ポケモンカラーの定義 */
:root {
    --pokemon-red: #CC0000;
    --pokemon-red-dark: #AA0000;
    --pokemon-red-light: #FF6B6B;
    --pokemon-red-faded: #D95B5B;
    --pokemon-black: #222224;
    --pokemon-white: #FFFFFF;
    --pokemon-yellow: #FFCB05;
    --pokemon-blue: #3466AF;
    --pokemon-gray: #6B6B6B;
    --bg-red-faded: #E8B5B5;
    --bg-red-light: #F5D5D5;
}

/* リセットとベース設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', 'メイリオ', 'Meiryo', 'MS PGothic', sans-serif;
    line-height: 1.8;
    color: var(--pokemon-black);
    background-color: var(--bg-red-light);
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 40px,
            rgba(255, 255, 255, 0.05) 40px,
            rgba(255, 255, 255, 0.05) 80px
        );
    position: relative;
    overflow-x: hidden;
}

/* ポケモンボールパターンの背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    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%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23CC0000' stroke-width='8'/%3E%3Cpath d='M10 50 h80' stroke='%23CC0000' stroke-width='8'/%3E%3Ccircle cx='50' cy='50' r='15' fill='%23CC0000'/%3E%3Ccircle cx='50' cy='50' r='10' fill='white'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    background-repeat: repeat;
    z-index: -1;
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 30px rgba(204, 0, 0, 0.1);
    position: relative;
}

/* パンくずリスト */
.breadcrumb {
    background: linear-gradient(to bottom, #FFCB05 0%, #FFD73D 100%);
    padding: 12px 30px;
    font-size: 0.9rem;
    border-bottom: 3px solid var(--pokemon-red);
    position: relative;
}

.breadcrumb::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right,
        var(--pokemon-red) 0%,
        var(--pokemon-yellow) 25%,
        var(--pokemon-blue) 50%,
        var(--pokemon-red) 75%,
        var(--pokemon-red) 100%);
    opacity: 0.5;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    margin: 3px 0;
    position: relative;
}

.breadcrumb li::after {
    content: '●';
    margin: 0 10px;
    color: var(--pokemon-red);
    font-size: 0.6rem;
    opacity: 0.7;
}

.breadcrumb li:last-child::after {
    content: '';
    margin: 0;
}

.breadcrumb a {
    color: var(--pokemon-black);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 2px 8px;
    border-radius: 15px;
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--pokemon-white);
    background-color: var(--pokemon-red);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(204, 0, 0, 0.3);
}

.breadcrumb .current {
    color: var(--pokemon-red-dark);
    font-weight: 700;
    padding: 2px 8px;
    background-color: rgba(255, 203, 5, 0.3);
    border-radius: 15px;
}

/* ヘッダー */
header {
    text-align: center;
    padding: 50px 20px;
    background: linear-gradient(135deg, var(--bg-red-light) 0%, var(--bg-red-faded) 100%);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background-color: rgba(255, 203, 5, 0.1);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}

header::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: rgba(52, 102, 175, 0.1);
    border-radius: 50%;
    bottom: -30px;
    left: -30px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--pokemon-red);
    text-shadow: 3px 3px 0 rgba(255, 203, 5, 0.3);
    font-family: 'Rounded Mplus 1c', 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', sans-serif;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

/* メインコンテンツ */
main {
    padding: 40px 30px;
}

/* セクション */
section {
    margin-bottom: 60px;
}

h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--pokemon-red);
    margin-bottom: 15px;
    padding: 15px 25px;
    background: linear-gradient(to right, rgba(255, 203, 5, 0.2) 0%, transparent 100%);
    border-left: 5px solid var(--pokemon-red);
    font-family: 'Rounded Mplus 1c', 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', sans-serif;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background-image:
        url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='15' cy='15' r='12' fill='none' stroke='%23CC0000' stroke-width='2'/%3E%3Cpath d='M3 15 h24' stroke='%23CC0000' stroke-width='2'/%3E%3Ccircle cx='15' cy='15' r='4' fill='%23CC0000'/%3E%3Ccircle cx='15' cy='15' r='3' fill='white'/%3E%3C/svg%3E");
    opacity: 0.3;
}

h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--pokemon-black);
    margin-bottom: 20px;
    padding-left: 20px;
    position: relative;
}

h3::before {
    content: '◆';
    position: absolute;
    left: 0;
    color: var(--pokemon-yellow);
    font-size: 1rem;
}

/* 段落 */
p {
    margin-bottom: 20px;
    line-height: 1.9;
}

/* 画像とキャプション */
.main-image {
    margin: 30px 0;
    text-align: center;
}

.main-image img {
    width: 100%;
    max-width: 1200px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(204, 0, 0, 0.15);
}

figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--pokemon-gray);
}

/* 目次 */
.toc {
    background: linear-gradient(135deg, rgba(255, 203, 5, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
    border: 2px solid var(--pokemon-red);
    border-radius: 20px;
    padding: 25px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.toc::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(52, 102, 175, 0.1);
    border-radius: 50%;
    top: -40px;
    right: -40px;
}

.toc h2 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 20px;
    background: none;
    border: none;
    padding: 0;
}

.toc ul {
    list-style: none;
}

.toc li {
    margin-bottom: 10px;
    padding-left: 30px;
    position: relative;
}

.toc li::before {
    content: '▶';
    position: absolute;
    left: 10px;
    color: var(--pokemon-red);
    font-size: 0.8rem;
}

.toc a {
    color: var(--pokemon-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.toc a:hover {
    color: var(--pokemon-red);
    padding-left: 5px;
}

/* テーブル */
.table-wrapper {
    overflow-x: auto;
    margin: 30px 0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

thead {
    background: linear-gradient(to bottom, var(--pokemon-red) 0%, var(--pokemon-red-dark) 100%);
    color: white;
}

th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 700;
    letter-spacing: 0.05em;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background-color: rgba(255, 203, 5, 0.1);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ポケモンリストテーブルの画像 */
.pokemon-list img {
    display: block;
    margin: 0 auto;
    border-radius: 5px;
}

/* キャラクターコメント */
.character-comment {
    display: flex;
    align-items: flex-start;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 203, 5, 0.05) 100%);
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.character-comment::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(204, 0, 0, 0.05);
    border-radius: 50%;
    top: -10px;
    right: -10px;
}

.character-comment img {
    margin-right: 20px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comment-content {
    flex: 1;
}

.character-name {
    font-weight: 700;
    color: var(--pokemon-red);
    margin-bottom: 5px;
}

.comment {
    background-color: white;
    padding: 15px 20px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.comment::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

/* リンク情報 */
.link-info {
    background-color: rgba(52, 102, 175, 0.05);
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 3px solid var(--pokemon-blue);
}

.link-info a {
    color: var(--pokemon-blue);
    text-decoration: underline;
}

.link-info a:hover {
    color: var(--pokemon-red);
}

/* 関連記事 */
#related-articles {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 3px solid var(--pokemon-red);
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.related-article {
    display: block;
    text-decoration: none;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.related-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--pokemon-red) 0%, var(--pokemon-yellow) 50%, var(--pokemon-blue) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(204, 0, 0, 0.2);
}

.related-article:hover::before {
    opacity: 1;
}

.related-article img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 20px;
}

.article-content h3 {
    font-size: 1.1rem;
    color: var(--pokemon-red);
    margin-bottom: 10px;
    padding: 0;
}

.article-content h3::before {
    display: none;
}

.article-content p {
    font-size: 0.9rem;
    color: var(--pokemon-gray);
    margin: 0;
}

/* フッター */
footer {
    background: linear-gradient(to bottom, var(--pokemon-black) 0%, #1a1a1c 100%);
    color: var(--pokemon-white);
    padding: 40px 30px;
    text-align: center;
    font-size: 0.9rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right,
        var(--pokemon-red) 0%,
        var(--pokemon-yellow) 33%,
        var(--pokemon-blue) 66%,
        var(--pokemon-red) 100%);
}

footer p {
    margin-bottom: 10px;
}

footer a {
    color: var(--pokemon-yellow);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* レスポンシブデザイン */
@media screen and (max-width: 768px) {
    /* パンくずリスト */
    .breadcrumb {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .breadcrumb li::after {
        margin: 0 8px;
        font-size: 0.5rem;
    }

    /* ヘッダー */
    header {
        padding: 30px 15px;
    }

    h1 {
        font-size: 1.8rem;
        text-shadow: 2px 2px 0 rgba(255, 203, 5, 0.3);
    }

    /* メインコンテンツ */
    main {
        padding: 30px 15px;
    }

    h2 {
        font-size: 1.5rem;
        padding: 12px 20px;
    }

    h2::after {
        width: 25px;
        height: 25px;
        right: 15px;
    }

    h3 {
        font-size: 1.2rem;
    }

    /* 目次 */
    .toc {
        padding: 20px 15px;
    }

    /* テーブル */
    th, td {
        padding: 10px 5px;
        font-size: 0.9rem;
    }

    .pokemon-list img {
        width: 50px;
        height: 50px;
    }

    /* キャラクターコメント */
    .character-comment {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px;
    }

    .character-comment img {
        margin-right: 0;
        margin-bottom: 15px;
        width: 80px;
        height: 80px;
    }

    .comment::before {
        display: none;
    }

    /* 関連記事 */
    .related-articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media screen and (max-width: 480px) {
    /* パンくずリスト */
    .breadcrumb {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .breadcrumb li::after {
        margin: 0 5px;
    }

    .breadcrumb a {
        padding: 2px 5px;
    }

    /* ヘッダー */
    header {
        padding: 25px 10px;
    }

    h1 {
        font-size: 1.5rem;
    }

    /* メインコンテンツ */
    main {
        padding: 20px 10px;
    }

    section {
        margin-bottom: 40px;
    }

    h2 {
        font-size: 1.3rem;
        padding: 10px 15px;
        margin-bottom: 10px;
    }

    h3 {
        font-size: 1.1rem;
        padding-left: 15px;
    }

    /* 目次 */
    .toc {
        padding: 15px 10px;
        margin: 30px 0;
    }

    .toc h2 {
        font-size: 1.3rem;
    }

    .toc li {
        padding-left: 25px;
        margin-bottom: 8px;
    }

    /* テーブル */
    .table-wrapper {
        margin: 20px -10px;
        border-radius: 0;
    }

    th, td {
        padding: 8px 3px;
        font-size: 0.85rem;
    }

    .pokemon-list img {
        width: 40px;
        height: 40px;
    }

    /* キャラクターコメント */
    .character-comment {
        margin: 20px 0;
        padding: 15px 10px;
    }

    .character-comment img {
        width: 70px;
        height: 70px;
    }

    .comment {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    /* リンク情報 */
    .link-info {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    /* 画像 */
    .main-image {
        margin: 20px -10px;
    }

    .main-image img {
        border-radius: 0;
    }

    /* フッター */
    footer {
        padding: 30px 15px;
        font-size: 0.85rem;
    }
}

/* アニメーション */
@keyframes pokeball-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ホバーエフェクト */
.toc:hover::before {
    animation: pokeball-bounce 1s ease-in-out infinite;
}

/* プリント対応 */
@media print {
    body::before {
        display: none;
    }

    .breadcrumb,
    .toc,
    .character-comment,
    #related-articles {
        display: none;
    }

    body {
        background: white;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
    }

    h1, h2, h3 {
        color: black;
    }
}
