:root {
    --bg-color: #fefcf3;
    /* 暖かみのあるクリームベージュ */
    --primary-color: #3ab6ca;
    /* 爽やかなターコイズ */
    --secondary-color: #fce7e9;
    /* 薄いピンク（背景・アクセント用） */
    --accent-pink: #e87a90;
    /* 差し色のピンク */
    --text-color: #4b3d39;
    /* 柔らかい焦げ茶色 */
    --text-secondary: #7d6b67;
    --card-bg: #ffffff;
    --code-bg: #fcfaf0;
    --btn-hover: #2ea1b4;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    /* モダンな標準比率 */
    -webkit-font-smoothing: antialiased;
}

/* === ヘッダー === */
header {
    text-align: center;
    padding: 60px 20px 40px;
    background-color: var(--bg-color);
    /* 背景色に合わせる */
    color: var(--text-color);
    border-bottom: 3px solid var(--secondary-color);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.2rem;
    margin: 0;
    letter-spacing: 2px;
}

header p {
    margin-top: 10px;
    font-size: 1.1rem;
    opacity: 0.9;
}

.header-link {
    display: inline-block;
    background-color: var(--primary-color);
    /* 鮮やかなグリーン */
    color: white !important;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    margin: 0 4px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.header-link:hover {
    background-color: var(--btn-hover);
    /* ホバーで少し濃いグリーンに */
    transform: translateY(-1px);
}

/* === カテゴリーフィルター === */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    margin-bottom: 40px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.filter-btn {
    background-color: var(--card-bg);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.filter-btn:hover:not(.active) {
    background-color: var(--secondary-color);
}

/* === ギャラリー（カード配置） === */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 0 20px;
    max-width: 1600px;
    margin: 0 auto;
}

@media (min-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(6, 1fr);
    }
}

.card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
    /* アニメーション開始前は透明 */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-20px, -20px);
    }

    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* 画像プレースホルダー（後で実際のAI画像に差し替え） */
.card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    object-fit: cover;
}

.card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.category-badge {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--accent-pink);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-weight: bold;
    align-self: flex-start;
}

.card h2 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.4;
    color: var(--text-color);
}

.prompt-box {
    background-color: var(--code-bg);
    border: 1px solid rgba(0, 0, 0, 0.03);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
    max-height: 70px;
    overflow-y: auto;
    word-break: break-all;
    flex-grow: 1;
}

.copy-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: bold;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.copy-btn:hover {
    background-color: var(--btn-hover);
}

/* === ローディング === */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.5rem;
    color: var(--primary-color);
    display: none;
    /* JSで制御 */
}

/* === 作成者リンクボタン（固定位置） === */
.author-link {
    position: fixed;
    bottom: 30px;
    right: 30px;
    /* 左から右へ移動 */
    background-color: var(--text-color);
    color: var(--bg-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    font-size: 1.1rem;
    /* 大きく調整 */
    font-weight: 700;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
    z-index: 1000;
    transform: scale(0.9);
    /* 全体のサイズを90%に縮小 */
    transform-origin: bottom right;
    /* 拡大の起点を右下に */
}

.author-link:hover {
    transform: scale(0.95) translateY(-3px);
    /* 0.9倍ベースで少し浮かせる */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.author-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background-color: white;
}

/* SP用改行 */
.sp-br {
    display: none;
}

/* モバイル対応：少しサイズを調整 */
@media (max-width: 600px) {
    .sp-br {
        display: block;
    }

    header {
        padding: 40px 15px 30px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .author-link {
        bottom: 20px;
        right: 20px;
        transform: scale(0.8);
        /* モバイルではさらに少し小さく */
    }

    .author-icon {
        width: 22px;
        height: 22px;
    }
}

/* 肉球アニメーション */
.paw {
    animation: bounce 1s infinite alternate;
    display: inline-block;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}