html {
    background-color: #010E1C;
    height: 100%;
}

body {
    font-family: 'Helvetica Neue', Arial, "M PLUS Rounded 1c", sans-serif;
    line-height: 1.6;
    color: #e0e0e0;

    background-color: transparent;
    max-width: 980px;
    margin: 40px auto;
    padding: 20px;

    /* 背景の設定 */
    background-size: auto;
    background-repeat: repeat;
    background-position: top left;
    background-attachment: fixed;
}


#bg-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.95) 100%);
pointer-events: none;
z-index: -100;
}

.menu-toggle {
    position: fixed;
    top: 20px;
    left: 25px;
    font-size: 28px;
    color: #F4B002;
    cursor: pointer;
    z-index: 2000;
    user-select: none;
    background: rgba(1, 14, 28, 0.8);
    padding: 10px 15px;
    border-radius: 6px;
}

.side-menu {
    position: fixed;
    top: 0;
    left: -360px;
    width: 360px;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    padding-top: 100px;
    transition: all 0.3s ease;
    z-index: 1500;
}

.side-menu.open {
    left: 0;
}

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

.side-menu li {
    padding: 15px 20px;
}

.side-menu a {
    text-decoration: none;
    color: #F4B002;
    font-size: 20px;
}

.side-menu a.active-page {
    background-color: #B30404;
    color: #ffffff !important;
    font-weight: bold;
    display: block;
    padding: 10px 15px;
    border-radius: 5px;
}

/* ヘッダー・見出し */
.header-img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 20px;
}

h1 {
    color: #F4B002;
    border-bottom: 2px solid #F4B002;
    padding-bottom: 10px;
    text-align: center;
}

h2 {
    color: #F4B002;
    border-left: 4px solid #F4B002;
    padding-left: 10px;
    margin-top: 30px;
}

/* ==========================================
 * 名刺風（カード）アニメーションスタイル
 * ========================================== */
.card-container {
    perspective: 1000px;
    margin: 40px auto;
    width: 100%;
    max-width: 550px;
    height: 300px;
}

.profile-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

/* JavaScriptでこのクラスを切り替えて裏返します */
.profile-card.flipped {
    transform: rotateY(180deg);
}

/* 表裏共通のスタイル */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    padding: 30px;
    box-sizing: border-box;
    border: 2px solid rgba(244, 176, 2, 0.6);
    background: linear-gradient(135deg, rgba(2, 22, 43, 0.95) 0%, rgba(1, 14, 28, 0.98) 100%);

    /* 浮かせるドロップシャドウ効果 */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 5px 15px rgba(244, 176, 2, 0.1);
}

/* ホバー時にさらに浮かせる */
.card-container:hover .profile-card:not(.flipped) {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 8px 20px rgba(244, 176, 2, 0.15);
}
.card-container:hover .profile-card.flipped {
    transform: rotateY(180deg) translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 8px 20px rgba(244, 176, 2, 0.15);
}

/* --- カード表面 --- */
.card-front {
    display: flex;
    align-items: center;
    gap: 25px;
}

.card-avatar-wrap {
    flex-shrink: 0;
}

/* プロフィール画像を正円に */
.card-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #F4B002;
    box-shadow: 0 0 15px rgba(244, 176, 2, 0.3);
}

.card-front-info {
    flex-grow: 1;
}

.card-name {
    color: #F4B002;
    font-size: 28px;
    margin: 0 0 5px 0;
    border: none;
    padding: 0;
    text-align: left;
}

.card-id {
    color: #a0a0a0;
    font-size: 14px;
    margin: 0 0 15px 0;
}

.card-tags {
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid #B30404;
    margin: 0;
}

.card-hint {
    position: absolute;
    bottom: 12px;
    right: 20px;
    font-size: 11px;
    color: rgba(244, 176, 2, 0.5);
    letter-spacing: 1px;
}

/* --- カード裏面 --- */
.card-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-back-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.intro-text {
    margin: 0;
    font-size: 15px;
    color: #e0e0e0;
}

.card-footer {
    margin-top: 15px;
    font-size: 14px;
    color: #F4B002;
    border-top: 1px dashed rgba(244, 176, 2, 0.3);
    padding-top: 10px;
    font-style: italic;
}

/* ==========================================
 * アバター・ギャラリー関連
 * ========================================== */
.avatar-section {
    margin-top: 30px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.avatar-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 14px;
    border: 1.3px solid rgba(244, 176, 2, 0.5);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 6px 8px rgba(244, 176, 2, 0.5);
}

.avatar-name {
    font-size: 18px;
    font-weight: bold;
    color: #F4B002;
    margin-bottom: 10px;
}

.avatar-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 10px;
}

/* ==========================================
 * アイコン共通スタイル（Software & SNS）
 * ========================================== */
.software-list,
.sns-icons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.software-icon,
.sns-icons-row img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(244, 176, 2, 0.2);
    transition: transform 0.2s ease;
}

.software-icon:hover,
.sns-icons-row img:hover {
    transform: scale(1.08);
}

/* ==========================================
 * スマホ向け設定 (820px以下) - 最適化バージョン
 * ========================================== */
@media (max-width: 820px) {
    body {
        margin: 20px auto;
        padding: 15px;
        padding-top: 80px; /* メニューボタンとの被り防止 */
    }

    /* --- メニュー周り --- */
    .menu-toggle {
        left: 50%;
        transform: translateX(-50%);
        font-size: 30px;
    }

    .side-menu {
        width: 100%;
        left: 0;
        top: -100%;
        height: auto;
        padding-bottom: 40px;
        transition: top 0.3s ease;
    }

    .side-menu.open {
        top: 0;
        left: 0;
    }

    /* --- 名刺カード（スマホ最適化） --- */
    .card-container {
        max-width: 340px; /* 一般的なスマホの画面幅にフィット */
        height: 460px;    /* 縦長の名刺サイズに変更 */
        margin: 30px auto;
    }

    .card-front, .card-back {
        padding: 24px 20px;
    }

    /* カード表面（縦型配置） */
    .card-front {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 15px;
    }

    .card-avatar {
        width: 100px;
        height: 100px;
    }

    .card-front-info .card-name {
        text-align: center;
        font-size: 24px;
    }

    .card-id {
        margin: 0 0 10px 0;
        font-size: 13px;
    }

    .card-tags {
        font-size: 12px;
        padding: 6px 10px;
        border-left: none;
        border-top: 3px solid #B30404; /* 縦型に合わせて上線に変更 */
    }

    /* カード裏面（縦型配置） */
    .card-back {
        justify-content: space-between; /* フッターを下に固定 */
    }

    .card-back-content {
        gap: 12px; /* スマホで読みやすいよう行間を調整 */
    }

    .intro-text {
        font-size: 14px;
        line-height: 1.5;
    }

    .card-footer {
        margin-top: 10px;
        font-size: 13px;
    }

    /* --- その他コンテンツ --- */
    .avatar-grid {
        grid-template-columns: 1fr;
    }

    /* アイコンサイズをまとめて縮小 */
    .software-list, .sns-icons-row {
        gap: 12px;
    }

    .software-icon,
    .sns-icons-row img {
        width: 65px;
        height: 65px;
        padding: 8px;
        border-radius: 10px;
    }
}
