/* ==========================================
   TailCrafter - Creative Works Portfolio
   温かく優しい色合いのアーティスティックなデザイン
   ========================================== */

/* カスタムプロパティ（色定義） */
:root {
    --color-cream: #FFF8F0;
    --color-warm-beige: #F5E6D3;
    --color-soft-peach: #FFE4D6;
    --color-light-coral: #FFB4A2;
    --color-dusty-rose: #E5A8A8;
    --color-soft-lavender: #D4C5E2;
    --color-warm-gray: #8B7E74;
    --color-dark-brown: #4A3F35;
    --color-white: #FFFFFF;
    --color-shadow: rgba(74, 63, 53, 0.1);
    --color-shadow-hover: rgba(74, 63, 53, 0.15);
    --color-image-bg: #E8D4BC;
}

/* ==========================================
   ナビゲーションメニュー
   ========================================== */

/* メニュートグルボタン（ハンバーガー） */
.menu-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--color-shadow);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px var(--color-shadow-hover);
}

.menu-icon {
    width: 22px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-icon-bar {
    width: 100%;
    height: 2px;
    background: var(--color-dark-brown);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* メニュー開閉時のハンバーガーアニメーション */
.menu-toggle.active .menu-icon-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .menu-icon-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-icon-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* メニューオーバーレイ */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ナビゲーションメニューパネル */
.nav-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-warm-beige) 100%);
    z-index: 10000;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.nav-menu.active {
    right: 0;
}

.nav-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 25px 20px 25px;
    border-bottom: 1px solid var(--color-soft-peach);
}

.nav-menu-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-dark-brown);
    letter-spacing: 0.1em;
}

.nav-menu-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-warm-gray);
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu-close:hover {
    background: var(--color-soft-peach);
    color: var(--color-dark-brown);
}

.nav-menu-list {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

.nav-menu-list li {
    margin: 0;
}

.nav-menu-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 30px;
    color: var(--color-dark-brown);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-menu-link:hover {
    background: rgba(255, 255, 255, 0.6);
    border-left-color: var(--color-light-coral);
    padding-left: 35px;
}

.nav-menu-link i {
    width: 24px;
    text-align: center;
    font-size: 1.2rem;
    color: var(--color-warm-gray);
    transition: color 0.3s ease;
}

.nav-menu-link:hover i {
    color: var(--color-light-coral);
}

/* メニュー開閉時のbodyスクロール禁止 */
body.menu-open {
    overflow: hidden;
}

/* リセット & 基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Shippori Mincho', 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'Hiragino Mincho Pro', serif;
    background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-soft-peach) 100%);
    color: var(--color-dark-brown);
    line-height: 1.8;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   ヘッダー
   ========================================== */
.site-header {
    background: linear-gradient(135deg, var(--color-warm-beige) 0%, var(--color-soft-lavender) 100%);
    padding: 60px 20px;
    text-align: center;
    box-shadow: 0 4px 20px var(--color-shadow);
    position: relative;
    overflow: hidden;
}

/* ヘッダー背景スライダー */
.header-bg-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.header-bg-track {
    display: flex;
    height: 100%;
    animation: slideBackground 60s linear infinite;
}

.header-bg-track img {
    height: 100%;
    width: auto;
    object-fit: cover;
    opacity: 0.6;
    flex-shrink: 0;
}

@keyframes slideBackground {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* スライダー上のオーバーレイ（グラデーション） */
.header-bg-slider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(245, 230, 211, 0.7) 0%,
        rgba(212, 197, 226, 0.7) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.site-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
    z-index: 2;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 228, 214, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite reverse;
    z-index: 2;
}

/* ヘッダーコンテンツを最前面に */
.site-header .container {
    position: relative;
    z-index: 3;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, -30px) rotate(5deg); }
}

.site-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--color-dark-brown);
    margin-bottom: 10px;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px var(--color-shadow);
}

.site-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--color-dark-brown);
    font-weight: 400;
    letter-spacing: 0.08em;
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

/* ==========================================
   SNSリンク
   ========================================== */
.social-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.social-link {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    color: var(--color-dark-brown);
    font-size: 1.3rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 2px 10px var(--color-shadow);
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px var(--color-shadow-hover);
    background: var(--color-white);
}

/* 各SNSの色 */
.social-link:nth-child(1):hover {
    color: #000000; /* X (Twitter) */
}

.social-link:nth-child(2):hover {
    color: #41C9B4; /* note */
}

.social-link:nth-child(3):hover {
    color: #5865F2; /* Discord */
}

.social-link:nth-child(4):hover {
    color: #FC4D50; /* Booth */
}

/* ==========================================
   メインコンテンツ
   ========================================== */
.main-content {
    padding: 80px 0;
}

.works-section {
    margin-bottom: 100px;
}

.works-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--color-dark-brown);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.title-icon {
    font-size: clamp(2rem, 4vw, 2.5rem);
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==========================================
   作品グリッド（CSS Grid レイアウト）
   ========================================== */
.works-grid {
    display: grid;
    gap: 30px;
    padding: 20px 0 10px 0;
}

/* Gameセクション: 最大3列 */
#game .works-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Novel/Musicセクション: 最大4列 */
#novel .works-grid,
#music .works-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* ==========================================
   作品カード
   ========================================== */
.work-card {
    width: 100%;
    background: var(--color-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px var(--color-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.work-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 50px var(--color-shadow-hover);
}

.work-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--color-image-bg);
    padding: 15px 15px 15px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Gameセクションの画像余白を小さく */
#game .work-image-wrapper {
    padding: 10px 10px 10px 10px;
}

.work-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: contain;
    transform: scale(0.98);
    transform-origin: center center;
    border-radius: 10px;
}

/* Gameセクションの画像を大きく表示 */
#game .work-image {
    transform: scale(1.0);
}

#game .work-card:hover .work-image {
    transform: scale(1.03);
}

.work-card:hover .work-image {
    transform: scale(1.02);
}

/* NEWタグ */
.work-new-tag {
    position: absolute;
    top: 0;
    left: 0;
    background: #E53935;
    color: var(--color-white);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 0 0 12px 0;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
    z-index: 3;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

/* ジャンルタグコンテナ（複数タグ対応） */
.work-genres {
    position: absolute;
    bottom: 22px;
    left: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 2;
}

/* ジャンルタグ（黒地に白字） */
.work-genre {
    background: rgba(0, 0, 0, 0.85);
    color: var(--color-white);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
}

.work-info {
    padding: 30px;
}

.work-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-dark-brown);
    margin-bottom: 12px;
    line-height: 1.4;
    letter-spacing: 0.03em;
}

.work-description {
    font-size: 0.95rem;
    color: var(--color-warm-gray);
    line-height: 1.75;
    letter-spacing: 0.02em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Game/Novel/Musicセクション: 説明文3行 */
#game .work-description,
#novel .work-description,
#music .work-description {
    -webkit-line-clamp: 3;
}

/* ==========================================
   フッター
   ========================================== */
.site-footer {
    background: linear-gradient(135deg, var(--color-warm-beige) 0%, var(--color-soft-lavender) 100%);
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 -4px 20px var(--color-shadow);
    margin-top: 80px;
}

.site-footer .social-links {
    margin-bottom: 30px;
}

.site-footer p {
    color: var(--color-warm-gray);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

/* ==========================================
   Twitterタイムライン
   ========================================== */
.twitter-timeline-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: var(--color-white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px var(--color-shadow);
}

#tweets .section-title {
    text-align: center;
    justify-content: center;
}

/* ==========================================
   セクション区切り線
   ========================================== */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--color-warm-gray),
        transparent
    );
    margin-bottom: 50px;
}

/* ==========================================
   ガイドラインセクション
   ========================================== */
.guidelines-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--color-white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 30px var(--color-shadow);
}

.guideline-block {
    margin-bottom: 40px;
}

.guideline-block:last-child {
    margin-bottom: 0;
}

.guideline-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-dark-brown);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-light-coral);
    letter-spacing: 0.05em;
}

.guideline-category {
    margin-bottom: 25px;
}

.guideline-category:last-child {
    margin-bottom: 0;
}

.guideline-category-title {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 15px;
    letter-spacing: 0.05em;
}

.guideline-category-title.ok {
    background: #E8F5E9;
    color: #2E7D32;
}

.guideline-category-title.ng {
    background: #FFEBEE;
    color: #C62828;
}

.guideline-list {
    list-style: none;
    padding-left: 0;
}

.guideline-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--color-dark-brown);
    line-height: 1.8;
    letter-spacing: 0.02em;
}

.guideline-list li:last-child {
    margin-bottom: 0;
}

.guideline-list li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--color-light-coral);
    font-weight: bold;
}

.guideline-note {
    display: block;
    font-size: 0.9rem;
    color: var(--color-warm-gray);
    margin-top: 5px;
    padding-left: 0;
}

/* ガイドライン レスポンシブ */
@media (max-width: 768px) {
    .guidelines-content {
        padding: 30px 25px;
    }

    .guideline-title {
        font-size: 1.3rem;
    }

    .guideline-list li {
        font-size: 0.95rem;
    }

    .guideline-note {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .guidelines-content {
        padding: 25px 20px;
    }

    .guideline-title {
        font-size: 1.2rem;
    }

    .guideline-category-title {
        font-size: 1rem;
        padding: 6px 16px;
    }

    .guideline-list li {
        font-size: 0.9rem;
        padding-left: 20px;
    }
}

/* ==========================================
   Aboutセクション（略歴）
   ========================================== */
.about-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--color-white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 30px var(--color-shadow);
}

.about-profile {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.about-image-wrapper {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--color-shadow);
    background: var(--color-image-bg);
}

.about-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-info {
    flex: 1;
}

.about-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-dark-brown);
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.about-description {
    font-size: 1rem;
    color: var(--color-warm-gray);
    line-height: 2;
    letter-spacing: 0.03em;
}

.about-description a {
    color: var(--color-dark-brown);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

.about-description a:hover {
    color: var(--color-light-coral);
}

/* ==========================================
   Informationセクション
   ========================================== */
.info-content {
    max-width: 630px;
    margin: 0 auto;
    background: var(--color-white);
    border-radius: 20px;
    padding: 30px 40px;
    box-shadow: 0 8px 30px var(--color-shadow);
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--color-soft-peach);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-item:first-child {
    padding-top: 0;
}

.info-date {
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--color-warm-gray);
    font-weight: 500;
    letter-spacing: 0.05em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.info-text {
    flex: 1;
    font-size: 1rem;
    color: var(--color-dark-brown);
    line-height: 1.6;
    letter-spacing: 0.02em;
}

.info-tag {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.info-tag.new {
    background: #E53935;
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

/* Information レスポンシブ */
@media (max-width: 768px) {
    .info-content {
        padding: 25px 20px;
    }

    .info-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .info-date {
        font-size: 0.85rem;
    }

    .info-text {
        width: 100%;
        order: 3;
        font-size: 0.95rem;
    }

    .info-tag {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .info-content {
        padding: 20px 15px;
    }

    .info-item {
        padding: 12px 0;
    }

    .info-date {
        font-size: 0.8rem;
    }

    .info-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* ==========================================
   レスポンシブデザイン
   ========================================== */

/* 大型ディスプレイ（FullHD以上） */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
}

/* デスクトップ中（1025px〜1399px）: Novel/Music 3列に */
@media (min-width: 1025px) and (max-width: 1399px) {
    #novel .works-grid,
    #music .works-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .work-info {
        padding: 26px;
    }
}

/* タブレット（769px〜1024px）: Game 2列、Novel/Music 3列 */
@media (min-width: 769px) and (max-width: 1024px) {
    #game .works-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #novel .works-grid,
    #music .works-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .work-image-wrapper {
        padding: 12px;
    }

    #game .work-image-wrapper {
        padding: 10px;
    }

    .work-genres {
        bottom: 20px;
        left: 20px;
    }

    .work-info {
        padding: 22px;
    }

    .site-header {
        padding: 50px 20px;
    }

    .main-content {
        padding: 60px 0;
    }

    .works-section {
        margin-bottom: 80px;
    }
}

/* スマートフォン（481px〜768px）: Game 1列、Novel/Music 2列 */
@media (max-width: 768px) {
    /* About: 縦並び */
    .about-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 25px;
    }

    .about-image-wrapper {
        width: 150px;
        height: 150px;
    }

    .about-content {
        padding: 30px 25px;
    }

    .about-name {
        font-size: 1.5rem;
    }

    .about-description {
        font-size: 0.95rem;
        line-height: 1.9;
    }
    /* Game: 1列 */
    #game .works-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    #game .work-card {
        max-width: 600px;
        margin: 0 auto;
    }

    #game .work-image-wrapper {
        padding: 10px;
    }

    #game .work-info {
        padding: 25px;
    }

    #game .work-genres {
        bottom: 20px;
        left: 20px;
    }

    /* Novel/Music: 2列 */
    #novel .works-grid,
    #music .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    #novel .work-title,
    #music .work-title {
        font-size: 1rem;
    }

    #novel .work-description,
    #music .work-description {
        font-size: 0.85rem;
    }

    #novel .work-info,
    #music .work-info {
        padding: 15px;
    }

    #novel .work-genres,
    #music .work-genres {
        bottom: 18px;
        left: 18px;
        gap: 6px;
    }

    #novel .work-genre,
    #music .work-genre {
        font-size: 0.65rem;
        padding: 4px 10px;
    }

    #novel .work-image-wrapper,
    #music .work-image-wrapper {
        padding: 10px;
    }

    .site-header {
        padding: 40px 20px;
    }

    .site-title {
        letter-spacing: 1px;
    }

    .social-links {
        gap: 15px;
    }

    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .main-content {
        padding: 40px 0;
    }

    .works-section {
        margin-bottom: 60px;
    }

    .section-title {
        margin-bottom: 30px;
        gap: 10px;
    }

    .work-info {
        padding: 20px;
    }

    .work-title {
        font-size: 1.25rem;
    }

    .work-description {
        font-size: 0.9rem;
    }
}

/* 小型スマートフォン（〜480px）: 全て1列 */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .site-header {
        padding: 30px 15px;
    }

    .social-links {
        gap: 12px;
    }

    .social-link {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    /* 全セクション1列 */
    #game .works-grid,
    #novel .works-grid,
    #music .works-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #game .work-card,
    #novel .work-card,
    #music .work-card {
        max-width: 100%;
    }

    .work-image-wrapper {
        padding: 10px;
    }

    .work-genres {
        bottom: 18px;
        left: 18px;
        gap: 6px;
    }

    .work-genre {
        font-size: 0.7rem;
        padding: 5px 12px;
    }

    .work-info {
        padding: 18px;
    }

    .work-title {
        font-size: 1.15rem;
        margin-bottom: 10px;
    }

    .work-description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

/* ==========================================
   アニメーション
   ========================================== */
@media (prefers-reduced-motion: no-preference) {
    .work-card {
        animation: fadeInUp 0.6s ease-out backwards;
    }

    .work-card:nth-child(1) { animation-delay: 0.1s; }
    .work-card:nth-child(2) { animation-delay: 0.2s; }
    .work-card:nth-child(3) { animation-delay: 0.3s; }
    .work-card:nth-child(4) { animation-delay: 0.4s; }
    .work-card:nth-child(5) { animation-delay: 0.5s; }
    .work-card:nth-child(6) { animation-delay: 0.6s; }
    .work-card:nth-child(7) { animation-delay: 0.7s; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   モーダルウィンドウ
   ========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: var(--color-white);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    z-index: 1;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--color-warm-beige);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--color-dark-brown);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.modal-close:hover {
    background: var(--color-light-coral);
    transform: rotate(90deg);
}

.modal-image-wrapper {
    width: 100%;
    background: var(--color-image-bg);
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px 20px 0 0;
}

.modal-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 10px;
}

.modal-body {
    padding: 30px;
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-dark-brown);
    margin-bottom: 15px;
    letter-spacing: 0.03em;
}

.modal-description {
    font-size: 1rem;
    color: var(--color-warm-gray);
    line-height: 1.9;
    margin-bottom: 25px;
    letter-spacing: 0.02em;
}

.modal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.modal-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--color-dark-brown);
    color: var(--color-white);
    text-decoration: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
}

.modal-link:hover {
    background: var(--color-warm-gray);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--color-shadow-hover);
}

.modal-link i {
    font-size: 1.1rem;
}

/* モーダル表示時のbodyスクロール禁止 */
body.modal-open {
    overflow: hidden;
}

/* モーダル レスポンシブ */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .modal-image-wrapper {
        padding: 20px;
    }

    .modal-image {
        max-height: 200px;
    }

    .modal-body {
        padding: 25px;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .modal-description {
        font-size: 0.95rem;
    }

    .modal-links {
        gap: 10px;
    }

    .modal-link {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }

    .modal-image-wrapper {
        padding: 15px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-links {
        flex-direction: column;
    }

    .modal-link {
        justify-content: center;
    }
}

/* プリントスタイル */
@media print {
    .site-header,
    .site-footer {
        background: none;
        box-shadow: none;
    }

    .work-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--color-warm-gray);
    }

    .modal {
        display: none !important;
    }
}
