/* ルート設定 */
:root {
    --bg-main: #fdfbf7;
    /* ぬくもりのある優しい生成り（アイボリー） */
    --bg-card: rgba(255, 255, 255, 0.85);
    /* テクスチャが透ける、少し透明な白 */
    --bg-accent: #f5efe6;
    /* 変換フォームや小説リンクの背景（マイルドベージュ） */
    --bg-header: #e6edd9;
    /* ヘッダー背景（マカロンをイメージした淡いピスタチオグリーン） */

    --text-main: #524a41;
    /* メインの文字色（読みやすいビターココアブラウン） */
    --text-muted: #807465;
    /* 補足などの文字色 */

    --color-primary: #869f6c;
    /* アクセントカラー（落ち着いたリーフグリーン） */
    --color-secondary: #b09987;
    /* サブカラー（優しく引き締めるミルクティブラウン） */
    --color-border: #e8dec9;
    /* 区切り線の色 */
}

/* 全体設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    color: var(--text-main);
    line-height: 1.8;
    overflow-x: hidden;

    /* 生成り色ベース ＋ ダマスク・アンティークレース調の背景パターン */
    background-color: var(--bg-main);
    background-image:
        radial-gradient(circle at 50% 50%, rgba(232, 222, 201, 0.4) 2px, transparent 3px),
        radial-gradient(circle at 0 0, rgba(232, 222, 201, 0.4) 2px, transparent 3px),
        linear-gradient(45deg, transparent 46%, rgba(232, 222, 201, 0.25) 49%, rgba(232, 222, 201, 0.25) 51%, transparent 54%),
        linear-gradient(-45deg, transparent 46%, rgba(232, 222, 201, 0.25) 49%, rgba(232, 222, 201, 0.25) 51%, transparent 54%);
    background-size: 32px 32px;
}

/* 擬似要素を使って、文字の左右に自動で植物マークを出す */
.font-deco::before {
    content: "𖤣𖥧𖥣 ";
    font-size: 1.6rem;
    color: var(--color-primary);
    vertical-align: middle;
    margin-right: 10px;
}

.font-deco::after {
    content: " 𖥣𖥧𖤣";
    font-size: 1.6rem;
    color: var(--color-primary);
    vertical-align: middle;
    margin-left: 10px;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-secondary);
}

/* ヘッダー（1カラムのすっきりとしたデザイン） */
.site-header {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--bg-header);
    position: relative;
    margin-bottom: 40px;
}

/* ヘッダー下のピコットレース風の飾り */
.site-header::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background-image: radial-gradient(circle at 50% 100%, transparent 4px, var(--bg-header) 5px);
    background-size: 16px 10px;
}

.site-header h1 {
    font-size: 2.8rem;
    font-family: 'Fredoka', sans-serif;
    color: var(--color-primary);
    letter-spacing: 7px;
    font-weight: bold;
    text-shadow: 2px 2px 2px rgba(170, 189, 158, 0.9);
}

/* サブタイトルの表示ズレをクリアに修正 */
.site-header p {
    margin-top: 10px;
    font-size: 1rem;
    color: var(--color-primary);
    letter-spacing: 2.5px;
}

/* 1カラムのスマートなコンテナレイアウト */
.container {
    max-width: 840px;
    /* 720px から 840px に広げました */
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 35px;
}

/* ナビゲーション（上部にシンプルに配置） */
.nav-menu {
    text-align: center;
    margin-bottom: 10px;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-menu a {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--color-secondary);
    padding: 5px 10px;
    border-radius: 5px;
}

.nav-menu a:hover {
    background-color: var(--bg-accent);
}

/* コンテンツセクション */
.content-section {
    background: var(--bg-card);
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    padding: 30px 25px;
    box-shadow: 0 4px 15px rgba(141, 166, 116, 0.05);
}

/* タイトル風の見出しデザイン */
.content-section h2 {
    font-size: 1.25rem;
    color: var(--color-primary);
    margin-bottom: 20px;
    font-weight: normal;
}

.content-section h2::before {
    content: "🐾 ";
    font-size: 1rem;
    vertical-align: middle;
}

.content-section p {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.name-converter {
    background-color: var(--bg-accent);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

/* 更新履歴リスト */
.update-list {
    list-style: none;
    font-size: 0.9rem;
}

.update-list li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--color-border);
}

.update-list span {
    color: var(--color-secondary);
    font-weight: bold;
    margin-right: 15px;
}

/* 小説リンク */
.novel-link {
    background-color: var(--bg-accent);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--color-primary);
}

.novel-link a {
    font-weight: bold;
}

.synopsis {
    font-size: 0.85rem;
    margin-top: 5px;
    color: var(--text-muted);
}

.dream-last,
.dream-first {
    font-weight: bold;
    color: var(--color-primary);
}

/* 注意事項リスト */
.attention-list {
    list-style: none;
    font-size: 0.9rem;
}

.attention-list li {
    margin-bottom: 6px;
    padding-left: 15px;
    position: relative;
}

.attention-list li::before {
    content: "・";
    position: absolute;
    left: 0;
}

/* ブックマーク用テーブル */
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.info-table th,
.info-table td {
    padding: 10px;
    border-bottom: 1px solid var(--color-border);
}

.info-table th {
    width: 25%;
    color: var(--color-secondary);
    text-align: left;
    font-weight: bold;
}

/*フッター*/
.site-footer {
    background-color: var(--bg-accent);
    text-align: center;
    padding: 60px 20px 40px 20px;
    color: var(--color-secondary);
    font-size: 0.85rem;
    position: relative;
    margin-top: 60px;
}

/* フッターの上にピコットレースを配置 */
.site-footer::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    /* ヘッダーとは逆向きの波（上向きの凸）を作る */
    background-image: radial-gradient(circle at 50% 0%, transparent 4px, var(--bg-header) 5px);
    background-size: 16px 10px;
}

/* アニメーション（ふわっと浮き上がる演出） */
.animate-fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease forwards;
}

.container>*:nth-child(1) {
    animation-delay: 0.1s;
}

.container>*:nth-child(2) {
    animation-delay: 0.2s;
}

.container>*:nth-child(3) {
    animation-delay: 0.3s;
}

.container>*:nth-child(4) {
    animation-delay: 0.4s;
}

.container>*:nth-child(5) {
    animation-delay: 0.5s;
}

.container>*:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   スマホ・タブレット用のレスポンシブ設定
   ========================================== */
@media screen and (max-width: 560px) {

    /* 主要なテキストや小説本文のベースサイズを12pxに変更 */
    .content-section p,
    .update-list,
    .attention-list,
    .info-table,
    .tweet-content {
        font-size: 12px !important;
    }

    /* 各種補足テキストを少し小さめに調整 */
    .synopsis,
    .tweet-time,
    .no-tweet {
        font-size: 11px !important;
    }

    /* タイトルの文字サイズをスマホに合わせて最適化 */
    .site-header h1 {
        font-size: 2.2rem;
    }

    .site-header p {
        font-size: 0.85rem;
    }

    /* 左右の草マークのサイズ調整 */
    .font-deco::before,
    .font-deco::after {
        font-size: 1.3rem;
    }

    /* セクション見出しのサイズ調整 */
    .content-section h2 {
        font-size: 1.1rem;
    }

    /* コンテナの余白を少しタイトにして画面を広く使う */
    .container {
        padding: 0 12px;
        gap: 25px;
    }

    .content-section {
        padding: 20px 15px;

    }

    .nav-menu ul {
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: center;
    }

    /* メニューの文字サイズと余白をスマホ用に最適化 */
    .nav-menu a {
        font-size: 12px;
        padding: 4px 6px;
        letter-spacing: 0;
    }

    .name-form-inner {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
    }

    .name-form-inner h3 {
        display: none;
    }

    /* 入力欄を包むブロックも横並びに参加させる */
    .input-group {
        font-size: 12px;
    }

    /* OKボタンのサイズも微調整 */
    #save-btn {
        padding: 5px 12px;
        font-size: 12px;
    }

}

/* --- トップに戻るボタン --- */
#totop-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-primary);
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(141, 166, 116, 0.15);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;

    /* ページの最上部では目立たないように、少し薄くしておきます */
    opacity: 0.6;
}

/* マウスを乗せたときのふわっとした動き */
#totop-btn:hover {
    opacity: 1;
    background-color: var(--bg-accent);
    transform: translateY(-3px);
    /* ちょこっと上に浮き上がる */
}

/* スマホのときは少しだけ位置とサイズをコンパクトに */
@media screen and (max-width: 560px) {
    #totop-btn {
        bottom: 20px;
        right: 20px;
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}