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

/* フォントの読み込み */
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700;900&display=swap');

/* ルート変数 */
:root {
    --kirby-pink: #ffb3d9;
    --kirby-pink-dark: #ff6fb5;
    --kirby-pink-muted: #c85a74;
    --kirby-red: #ff1744;
    --kirby-yellow: #ffd600;
    --kirby-orange: #ff9100;
    --kirby-blue: #2196f3;
    --kirby-light-blue: #81d4fa;
    --white: #ffffff;
    --black: #333333;
    --background-pink: #f5b3c8;
    --star-yellow: #ffe082;
}

/* ボディ全体の設定 */
body {
    font-family: 'M PLUS Rounded 1c', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', sans-serif;
    color: var(--black);
    line-height: 1.7;
    background-color: var(--background-pink);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath d='M40,20 L45,35 L60,35 L48,45 L52,60 L40,50 L28,60 L32,45 L20,35 L35,35 Z' fill='%23ffffff' opacity='0.15'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='30' fill='none' stroke='%23ffffff' stroke-width='2' opacity='0.1'/%3E%3Ccircle cx='50' cy='50' r='20' fill='%23ffffff' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 80px 80px, 120px 120px;
    background-position: 0 0, 40px 40px;
    min-height: 100vh;
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--white);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    border-radius: 30px 30px 0 0;
    overflow: hidden;
    margin-top: 20px;
}

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

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M30,15 L34,25 L45,25 L36,32 L40,42 L30,35 L20,42 L24,32 L15,25 L26,25 Z' fill='%23ffffff' opacity='0.2'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    animation: twinkle 30s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.2;
    }
    25% {
        opacity: 0.3;
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 0.2;
    }
    75% {
        opacity: 0.1;
    }
}

/* タイトル */
h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--white);
    text-shadow:
        3px 3px 0 var(--kirby-pink-muted),
        -1px -1px 0 var(--kirby-pink-muted),
        1px -1px 0 var(--kirby-pink-muted),
        -1px 1px 0 var(--kirby-pink-muted),
        1px 1px 0 var(--kirby-pink-muted),
        4px 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
    transform: rotate(-2deg);
    animation: bounce 3s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: rotate(-2deg) translateY(0); }
    50% { transform: rotate(-2deg) translateY(-5px); }
}

h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--kirby-pink-dark);
    margin: 40px 0 20px;
    padding: 15px 30px;
    background: linear-gradient(to right, #fff0f5 0%, #ffffff 100%);
    border-left: 8px solid var(--kirby-pink);
    border-radius: 0 30px 30px 0;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
    position: relative;
}

h2::after {
    content: '★';
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--star-yellow);
    font-size: 1.5rem;
    animation: spin 4s linear infinite;
}

@keyframes spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--kirby-orange);
    margin: 20px 0 15px;
    padding-left: 30px;
    position: relative;
}

h3::before {
    content: '⭐';
    position: absolute;
    left: 0;
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 目次 */
.toc {
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8f5 100%);
    padding: 30px;
    margin: 30px;
    border-radius: 25px;
    border: 3px solid var(--kirby-pink);
    box-shadow: 0 5px 15px rgba(255, 179, 217, 0.3);
    position: relative;
}

.toc::before,
.toc::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
}

.toc::before {
    top: 10px;
    left: 10px;
}

.toc::after {
    bottom: 10px;
    right: 10px;
}

.toc h2 {
    background: none;
    border: none;
    text-align: center;
    padding: 0;
    margin-bottom: 20px;
    color: var(--kirby-pink-dark);
}

.toc h2::after {
    display: none;
}

.toc ul {
    list-style: none;
    padding: 0;
}

.toc li {
    margin: 12px 0;
    padding-left: 35px;
    position: relative;
}

.toc li::before {
    content: '🌟';
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

.toc a {
    color: var(--kirby-blue);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-block;
}

.toc a:hover {
    color: var(--kirby-pink-dark);
    transform: translateX(5px) scale(1.05);
}

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

/* メイン画像 */
.main-image, .sub-image {
    margin: 0 0 40px;
    text-align: center;
}

.main-image img, .sub-image img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(255, 179, 217, 0.4);
    border: 3px solid var(--kirby-pink);
}

.main-image figcaption, .sub-image figcaption {
    margin-top: 15px;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

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

/* 段落 */
p {
    margin-bottom: 20px;
    font-size: 1.05rem;
}

/* キャラクターコメント */
.character-comment {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(to right, #ffe8f5 0%, #ffffff 100%);
    border-radius: 25px;
    box-shadow: 0 3px 10px rgba(255, 179, 217, 0.2);
    border: 2px solid rgba(255, 179, 217, 0.3);
}

.character-comment img {
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 3px solid var(--kirby-pink);
}

.comment-content {
    flex: 1;
}

.character-name {
    font-weight: 700;
    color: var(--kirby-pink-dark);
    margin-bottom: 5px !important;
    font-size: 1.1rem;
}

.comment {
    background-color: var(--white);
    padding: 15px 20px;
    border-radius: 20px;
    position: relative;
    font-style: italic;
    color: #555;
    box-shadow: inset 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 var(--white) transparent transparent;
}

/* テーブル */
.table-wrapper {
    overflow-x: auto;
    margin: 30px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white);
    box-shadow: 0 3px 10px rgba(255, 179, 217, 0.2);
    border-radius: 20px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, var(--kirby-pink) 0%, var(--kirby-pink-dark) 100%);
    color: var(--white);
}

th {
    padding: 15px;
    font-weight: 700;
    text-align: left;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

td {
    padding: 15px;
    border-bottom: 1px solid #ffe8f5;
}

tbody tr:hover {
    background-color: #fff8fc;
}

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

table img {
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}

/* カービィリストテーブル特有のスタイル */
.kirby-list {
    font-size: 0.95rem;
}

.kirby-list th:nth-child(4),
.kirby-list th:nth-child(5),
.kirby-list th:nth-child(6),
.kirby-list td:nth-child(4),
.kirby-list td:nth-child(5),
.kirby-list td:nth-child(6) {
    text-align: center;
    width: 80px;
}

/* フッター */
footer {
    background: linear-gradient(135deg, var(--kirby-pink-muted) 0%, #a04860 100%);
    color: var(--white);
    text-align: center;
    padding: 30px 20px;
}

footer p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* レスポンシブデザイン */
@media screen and (max-width: 768px) {
    /* コンテナ */
    .container {
        margin-top: 0;
        border-radius: 0;
    }

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

    h1 {
        font-size: 1.8rem;
        text-shadow:
            2px 2px 0 var(--kirby-pink-muted),
            -1px -1px 0 var(--kirby-pink-muted),
            1px -1px 0 var(--kirby-pink-muted),
            -1px 1px 0 var(--kirby-pink-muted);
    }

    h2 {
        font-size: 1.5rem;
        padding: 12px 20px;
        border-left-width: 5px;
        margin: 30px 0 15px;
    }

    h2::after {
        right: 20px;
        font-size: 1.2rem;
    }

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

    /* メインコンテンツ - スマホ用の余白調整 */
    main {
        padding: 15px 15px 30px;
    }

    .toc {
        margin: 20px 10px;
        padding: 20px 15px;
    }

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

    .comment::before {
        display: none;
    }

    /* テーブル */
    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 10px 8px;
    }

    /* カービィリストテーブル */
    .kirby-list {
        font-size: 0.8rem;
    }

    .kirby-list th:nth-child(4),
    .kirby-list th:nth-child(5),
    .kirby-list th:nth-child(6),
    .kirby-list td:nth-child(4),
    .kirby-list td:nth-child(5),
    .kirby-list td:nth-child(6) {
        width: 50px;
    }

    .kirby-list img {
        width: 80px;
        height: 80px;
    }
}

/* 小さいスマホ用の追加調整 */
@media screen and (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1rem;
    }

    main {
        padding: 10px 10px 25px;
    }

    .toc {
        margin: 15px 5px;
        padding: 15px 10px;
    }

    p {
        font-size: 1rem;
    }

    /* テーブル */
    .kirby-list {
        font-size: 0.75rem;
    }

    .kirby-list img {
        width: 60px;
        height: 60px;
    }

    .kirby-list th,
    .kirby-list td {
        padding: 8px 5px;
    }

    /* Vol列の幅調整 */
    .kirby-list th:nth-child(4),
    .kirby-list th:nth-child(5),
    .kirby-list th:nth-child(6),
    .kirby-list td:nth-child(4),
    .kirby-list td:nth-child(5),
    .kirby-list td:nth-child(6) {
        width: 40px;
        font-size: 0.7rem;
    }
}

/* アニメーション最適化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* 関連記事セクション */
#related-articles {
    background: linear-gradient(135deg, #fff0f8 0%, #ffe8f5 100%);
    padding: 50px 0;
    margin: 60px -30px 0;
    position: relative;
    overflow: hidden;
}

#related-articles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50,20 L55,35 L70,35 L58,45 L63,60 L50,50 L37,60 L42,45 L30,35 L45,35 Z' fill='%23ffb3d9' opacity='0.1'/%3E%3C/svg%3E");
    background-size: 100px 100px;
}

#related-articles h2 {
    text-align: center;
    background: none;
    border: none;
    color: var(--kirby-pink-dark);
    margin-bottom: 40px;
    font-size: 2.2rem;
    position: relative;
    z-index: 1;
}

#related-articles h2::after {
    display: none;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 0 30px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.related-article {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(255, 179, 217, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border: 3px solid transparent;
    display: block;
}

.related-article:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 179, 217, 0.5);
    border-color: var(--kirby-pink);
}

.related-article img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.related-article:hover img {
    transform: scale(1.1);
}

.article-content {
    padding: 20px;
    background: linear-gradient(to bottom, var(--white) 0%, #fff5fb 100%);
}

.related-article h3 {
    margin: 0 0 10px 0;
    padding: 0;
    font-size: 1.1rem;
    color: var(--kirby-pink-dark);
    line-height: 1.4;
}

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

.related-article p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* 関連記事の装飾的な星 */
.related-articles-grid::before,
.related-articles-grid::after {
    content: '⭐';
    position: absolute;
    font-size: 2rem;
    color: var(--star-yellow);
    animation: float-star 6s ease-in-out infinite;
}

.related-articles-grid::before {
    top: -20px;
    left: 20px;
    animation-delay: 0s;
}

.related-articles-grid::after {
    bottom: -20px;
    right: 20px;
    animation-delay: 3s;
}

@keyframes float-star {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* レスポンシブデザイン */
@media screen and (max-width: 768px) {
    #related-articles {
        padding: 40px 0;
        margin: 50px -15px 0;
    }

    .related-articles-grid {
        padding: 0 15px;
        gap: 20px;
    }

    #related-articles h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .related-article img {
        height: 180px;
    }

    .article-content {
        padding: 15px;
    }

    .related-article h3 {
        font-size: 1rem;
    }

    .related-article p {
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 480px) {
    #related-articles {
        padding: 30px 0;
        margin: 40px -10px 0;
    }

    .related-articles-grid {
        padding: 0 10px;
        grid-template-columns: 1fr;
    }

    .related-article img {
        height: 160px;
    }
}
