/* =========================
全体ベース
========================= */
body {
    background: #f6f7fb;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin: 12px auto;
    max-width: 900px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.05);
}

/* =========================
タイトル
========================= */
.card-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #222;
}

/* =========================
プロフィールカード
========================= */
.profile-card .card {
    text-align: center;
}

/* 名前 */
.profile-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* サポーターバッジ */
.supporter-badge {
    margin-left: 6px;
}

/* サポーターメッセージ */
.supporter-message {
    font-size: 12px;
    color: #ff6b81;
    margin-bottom: 10px;
}

/* =========================
プロフィール画像
========================= */
.avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    margin: 12px auto;
    display: block;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: 0.2s;
}

.avatar:hover {
    transform: scale(1.05);
}

/* =========================
モーダル
========================= */
.image-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
}

.image-modal .close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

/* =========================
プロフィール情報
========================= */
.profile-info {
    margin-top: 12px;
    padding: 12px;
    background: #fafafa;
    border-radius: 12px;
}

.profile-info p {
    margin: 6px 0;
    font-size: 13px;
    color: #444;
}

/* =========================
相性スコア
========================= */
.match-score {
    margin-top: 10px;
    font-weight: bold;
    color: #ff4d6d;
}

/* =========================
タグ
========================= */
.profile-tags {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-category {
    width: 100%;
    margin-bottom: 8px;
}

.tag-category h4 {
    font-size: 12px;
    color: #888;
    border-left: 4px solid #ff7a7a;
    padding-left: 8px;
    margin-bottom: 6px;
}

/* タグチップ */
.tag-chip {
    display: inline-block;
    background: linear-gradient(135deg, #ffe0e0, #ffd6ff);
    color: #444;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    margin: 4px 4px 0 0;
    transition: 0.2s;
}

.tag-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.tag-chip[data-level="1"] { opacity: 0.6; }
.tag-chip[data-level="2"] { opacity: 0.85; }
.tag-chip[data-level="3"] { font-weight: bold; }

/* =========================
ボタン
========================= */
.card-actions {
    margin-top: 16px;
}

.card-actions .btn,
.card-footer .btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    transition: 0.2s;
}

.card-actions .btn.primary {
    background: linear-gradient(135deg, #ff7a7a, #ff4d6d);
    color: #fff;
}

.card-actions .btn.outline,
.card-footer .btn.outline {
    border: 1px solid #ddd;
    color: #333;
    background: #fff;
}

.btn:hover {
    transform: scale(1.03);
}

/* =========================
投稿グリッド（動画・画像）
========================= */
.post-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    max-width: 900px;
    margin: 0 auto;
}

/* 正方形 */
.post-grid a {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #000;
    border-radius: 10px;
}

/* メディア */
.post-grid img,
.post-grid video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* hover */
@media (hover: hover) {
    .post-grid a:hover {
        transform: scale(1.03);
        transition: 0.2s;
        z-index: 2;
    }
}

/* =========================
   ひとこと
========================= */

.profile-bio {
    margin-top: 16px;
    margin-bottom: 18px;

    padding: 14px 16px;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.10),
            rgba(255,255,255,0.04)
        );

    border: 1px solid rgba(255,255,255,0.08);

    font-size: 14px;
    line-height: 1.8;

    backdrop-filter: blur(10px);

    box-shadow:
        0 4px 18px rgba(0,0,0,0.18);

    word-break: break-word;

    position: relative;

    overflow: hidden;
}

/* 左アクセント */
.profile-bio::before {
    content: "";

    position: absolute;

    top: 12px;
    left: 0;

    width: 3px;
    height: calc(100% - 24px);

    border-radius: 999px;

    background: linear-gradient(
        to bottom,
        #ff4d6d,
        #ff8fab
    );
}

/* テキスト */
.profile-bio {
    padding-left: 18px;
}

/* 空欄対策 */
.profile-bio:empty {
    display: none;
}

/* =========================
ブログ・日記カード（統一サブカード）
========================= */
.sub-card {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.sub-card-title {
    font-size: 14px;
    margin-bottom: 6px;
}

.sub-card-title a {
    color: #222;
    text-decoration: none;
}

.sub-card-date {
    font-size: 11px;
    color: #888;
}

.sub-card-body {
    font-size: 13px;
    color: #444;
    margin-top: 8px;
}

/* LIKE */
.sub-card-like {
    font-size: 12px;
    color: #ff4d6d;
    margin-top: 8px;
}

/* LIVE */
.post-live {
    color: #ff3b30;
    font-weight: bold;
    margin-left: 6px;
}

/* =========================
空状態
========================= */
.empty-text {
    text-align: center;
    font-size: 13px;
    color: #aaa;
    padding: 20px;
}

/* =========================
戻る
========================= */
.card-footer.center {
    text-align: center;
    padding: 20px;
}

/* =========================
スマホ最適化
========================= */
@media (max-width: 768px) {

    .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .card {
        margin: 10px;
    }
}

/* =========================
LIKEボタン
========================= */
.user-like-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    z-index: 9999;
    pointer-events: auto;
}
    

/* 未LIKE（赤） */
.user-like-btn {
    background: #ff4d6d;
    color: #fff;
}

/* LIKE済（グレー） */
.user-like-btn.liked {
    background: #ccc;
    color: #333;
}

/* 未ログインlikeボタン */
.guest-like-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
}

/* =========================
   👑 管理人専用DM
   ========================= */

.admin-message-action {
    margin-top: 10px;
}

.admin-message-btn {
    border: 1px solid #b8860b;
    color: #8a6500;
    background: rgba(184, 134, 11, 0.08);
}

.admin-message-btn:hover {
    background: rgba(184, 134, 11, 0.16);
}


/* ==================================================
   📸 ユーザー投稿メディア
================================================== */

.user-detail-media-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;

    padding: 0;
    margin: 0;

    border: 0;
    overflow: hidden;

    background: #f2f2f2;

    display: block;
}

.user-detail-media-item img,
.user-detail-media-item video {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.user-detail-media-item.media-image {
    cursor: pointer;
}

.user-detail-media-item.media-video {
    cursor: default;
}

.user-detail-media-item video {
    pointer-events: none;
}

.media-type-badge {
    position: absolute;

    right: 6px;
    bottom: 6px;

    min-width: 25px;
    height: 25px;

    padding: 0 5px;

    border-radius: 999px;

    background: rgba(0, 0, 0, 0.65);

    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;

    pointer-events: none;
}

.blog-badge {
    font-size: 13px;
}


/* ==================================================
   🖼️ 投稿画像 全画面モーダル
================================================== */

.user-detail-image-modal {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.96);

    z-index: 99999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    box-sizing: border-box;
}

.user-detail-image-modal.is-open {
    display: flex;
}

.user-detail-modal-image {
    display: block;

    max-width: 100%;
    max-height: 100%;

    width: auto;
    height: auto;

    object-fit: contain;

    user-select: none;
    -webkit-user-select: none;
}

.user-detail-image-modal-close {
    position: absolute;

    top: 12px;
    right: 15px;

    z-index: 2;

    width: 44px;
    height: 44px;

    border: 0;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.55);

    color: #fff;

    font-size: 34px;
    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}


@media (max-width: 600px) {

    .user-detail-image-modal {
        padding: 10px;
    }

    .user-detail-image-modal-close {
        top: 10px;
        right: 10px;

        width: 42px;
        height: 42px;

        font-size: 32px;
    }
}

/* ==================================================
   🃏 Blog複数画像
   カードを手に持っているような表示
================================================== */

.user-detail-media-stack {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-width: 0;
    overflow: visible;
}


/* ------------------------------------------
   カード本体
------------------------------------------ */

.user-detail-media-stack-card {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    padding: 0;
    margin: 0;

    border: 0;
    border-radius: 4px;

    overflow: hidden;

    background: #f2f2f2;

    cursor: pointer;

    display: block;

    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.12);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


/* ------------------------------------------
   画像
------------------------------------------ */

.user-detail-media-stack-card img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


/* ------------------------------------------
   後ろのカード
------------------------------------------ */

.user-detail-media-stack-card:nth-child(2) {
    z-index: 2;

    transform:
        translate(5px, -3px)
        rotate(2deg);
}

.user-detail-media-stack-card:nth-child(3) {
    z-index: 3;

    transform:
        translate(9px, -5px)
        rotate(4deg);
}

.user-detail-media-stack-card:nth-child(4) {
    z-index: 4;

    transform:
        translate(12px, -6px)
        rotate(5deg);
}

.user-detail-media-stack-card:nth-child(5) {
    z-index: 5;

    transform:
        translate(14px, -7px)
        rotate(6deg);
}

.user-detail-media-stack-card:nth-child(n + 6) {
    z-index: 1;

    transform:
        translate(15px, -7px)
        rotate(7deg);
}


/* ------------------------------------------
   一番手前
------------------------------------------ */

.user-detail-media-stack-card.is-front {
    z-index: 20;

    transform: none;
}


.user-detail-media-stack-card.is-front:active {
    transform: scale(0.98);
}


/* ------------------------------------------
   枚数表示
------------------------------------------ */

.user-detail-media-stack .media-stack-count {
    position: absolute;

    top: 8px;
    right: 8px;

    z-index: 30;

    min-width: 38px;
    height: 26px;

    padding: 0 8px;

    border-radius: 999px;

    background: rgba(0, 0, 0, 0.68);

    color: #fff;

    font-size: 12px;
    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    pointer-events: none;
}

/* ==================================================
   🖼️ User Detail 投稿画像
   複数画像カードスタック
================================================== */

.user-detail-media-stack {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    overflow: visible;
}


/* --------------------------------
   スタックしている画像
-------------------------------- */

.user-detail-media-stack-card {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    padding: 0;
    margin: 0;

    border: 0;
    border-radius: 14px;

    background: #fff;

    overflow: hidden;

    cursor: pointer;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);

    -webkit-tap-highlight-color: transparent;
}


/* 後ろのカード */

.user-detail-media-stack-card:nth-child(2) {
    transform: translate(7px, 7px);
    z-index: 1;
}

.user-detail-media-stack-card:nth-child(3) {
    transform: translate(12px, 12px);
    z-index: 0;
}


/* 一番前のカード */

.user-detail-media-stack-card.is-front {
    transform: translate(0, 0);
    z-index: 3;
}


/* 画像 */

.user-detail-media-stack-card img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    border-radius: 14px;

    pointer-events: none;
}


/* --------------------------------
   「3枚」などの枚数表示
-------------------------------- */

.user-detail-media-stack .media-stack-count {
    position: absolute;

    right: 10px;
    bottom: 10px;

    z-index: 10;

    padding: 5px 9px;

    border-radius: 999px;

    background: rgba(0, 0, 0, 0.65);
    color: #fff;

    font-size: 12px;
    font-weight: 600;

    line-height: 1;

    pointer-events: none;
}


/* ==================================================
   🖼️ User Detail 全画面画像モーダル
================================================== */

.user-detail-image-modal {
    position: fixed;

    inset: 0;

    z-index: 99999;

    display: none;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.92);

    padding: 20px;

    box-sizing: border-box;
}


/* JSで開いた状態 */

.user-detail-image-modal.is-open {
    display: flex;
}


/* --------------------------------
   拡大画像
-------------------------------- */

.user-detail-modal-image {
    display: block;

    max-width: 100%;
    max-height: 90vh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 8px;

    cursor: pointer;

    /*
     * 横スワイプをJSで取得しつつ、
     * 縦方向のブラウザ操作は許可
     */
    touch-action: pan-y;

    -webkit-user-select: none;
    user-select: none;

    -webkit-touch-callout: none;
}


/* --------------------------------
   閉じるボタン
-------------------------------- */

.user-detail-image-modal-close {
    position: absolute;

    top: 15px;
    right: 15px;

    z-index: 100000;

    width: 44px;
    height: 44px;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.55);

    color: #fff;

    font-size: 32px;
    font-weight: 300;

    line-height: 44px;
    text-align: center;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;
}


/* ==================================================
   📱 スマホ
================================================== */

@media (max-width: 600px) {

    .user-detail-media-stack {
        border-radius: 12px;
    }

    .user-detail-media-stack-card {
        border-radius: 12px;
    }

    .user-detail-media-stack-card img {
        border-radius: 12px;
    }

    .user-detail-modal-image {
        max-width: 100%;
        max-height: 85vh;

        border-radius: 4px;
    }

    .user-detail-image-modal {
        padding: 10px;
    }

    .user-detail-image-modal-close {
        top: 10px;
        right: 10px;

        width: 42px;
        height: 42px;

        font-size: 30px;
        line-height: 42px;
    }
}

/* ==================================================
   📝 画像拡大 → 投稿ページへ
================================================== */

.user-detail-modal-post-link {
    display: block;

    position: fixed;
    left: 50%;

    /* footerに隠れない位置 */
    bottom: 90px;

    transform: translateX(-50%) translateY(10px);

    z-index: 100002;

    padding: 13px 22px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.95);
    color: #222;

    text-decoration: none;

    font-size: 15px;
    font-weight: 700;

    white-space: nowrap;

    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.25);

    /* 最初は見えない */
    opacity: 0;
    visibility: hidden;

    /* ふんわり表示 */
    transition:
        opacity 0.35s ease,
        transform 0.35s ease,
        visibility 0.35s;
}


/* ==================================================
   📝 0.5秒後にふんわり表示
================================================== */

.user-detail-modal-post-link.is-visible {

    opacity: 1;
    visibility: visible;

    transform:
        translateX(-50%)
        translateY(0);
}


/* ==================================================
   👆 タップ時
================================================== */

.user-detail-modal-post-link:active {

    transform:
        translateX(-50%)
        translateY(0)
        scale(0.96);
}