/* =============================================================================
   Mode1 Identify v3 — 結果表示CSS
   既存 style.css と併用。ffs-m1- プレフィックスで衝突回避。
   ============================================================================= */

/* ----- 信頼度バナー（Mode1レベル） ----- */
.ffs-confidence-banner.ffs-m1-confirmed {
    background: linear-gradient(135deg, #e8f8f0 0%, #d5f5e3 100%);
    border-left: 5px solid #27ae60;
}
.ffs-confidence-banner.ffs-m1-probable {
    background: linear-gradient(135deg, #eaf2fb 0%, #d4e6f9 100%);
    border-left: 5px solid #2980b9;
}
.ffs-confidence-banner.ffs-m1-possible {
    background: linear-gradient(135deg, #fef9e7 0%, #fdebd0 100%);
    border-left: 5px solid #f39c12;
}
.ffs-confidence-banner.ffs-m1-uncertain {
    background: linear-gradient(135deg, #fdf2e9 0%, #fae5d3 100%);
    border-left: 5px solid #e67e22;
}
.ffs-confidence-banner.ffs-m1-unknown {
    background: linear-gradient(135deg, #fdedec 0%, #fadbd8 100%);
    border-left: 5px solid #e74c3c;
}

/* ----- ★ 親グリッド上書き: 1カラムに戻す ----- */
/* identifyではactressGrid内にヒーロー/別名義/その他のセクションを入れるので
   既存の2カラムグリッドを解除し、セクション内部で2カラムを制御する */
.ffs-actress-grid:has(.ffs-m1-hero) {
    display: block;
}

/* has()非対応ブラウザ用フォールバック — JSで付与するクラス */
.ffs-actress-grid.ffs-m1-layout {
    display: block;
}

/* ----- ヒーローカード（1位・フル幅） ----- */
.ffs-m1-hero {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    overflow: hidden;
    margin-bottom: 24px;
}

.ffs-m1-hero-header {
    padding: 20px 20px 12px;
    text-align: center;
}

.ffs-m1-hero-name {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.ffs-m1-hero-ruby {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}

/* ジャケ大（1位の注目作品） */
.ffs-m1-hero-featured {
    position: relative;
    display: block;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 16px;
    cursor: pointer;
}
.ffs-m1-hero-featured img {
    width: 100%;
    border-radius: 10px;
    display: block;
}

/* バッジ: 画像に対して相対配置 */
.ffs-m1-hero-featured .ffs-vr-badge {
    position: absolute;
    top: 8px;
    left: 24px;
}
.ffs-m1-hero-featured .ffs-release-badge {
    position: absolute;
    bottom: 8px;
    right: 24px;
}

/* 作品サムネイル行（小・コンパクトカードと同じサイズ） */
.ffs-m1-hero-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px;
    background: #f8f9fa;
    justify-content: center;
}

.ffs-m1-hero-thumbs .ffs-m1-hero-thumb-item {
    flex: 0 0 calc((100% - 40px) / 3);
    max-width: 163px;
}
.ffs-m1-hero-thumbs .ffs-product-thumb-wrapper {
    width: auto;
    min-width: unset;
    position: relative;
    aspect-ratio: 147/200;
    border-radius: 6px;
    overflow: hidden;
    background: #e0e0e0;
}
.ffs-m1-hero-thumbs .ffs-product-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    display: block;
}

.ffs-m1-hero-footer {
    display: flex;
    gap: 12px;
    padding: 12px 20px 16px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
    justify-content: center;
}

/* ----- 2カラムグリッド（別名義・その他共通） ----- */
.ffs-m1-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* ----- 別名義セクション ----- */
.ffs-m1-alias-section {
    margin-bottom: 24px;
}

.ffs-m1-alias-header {
    font-size: 18px;
    font-weight: 700;
    color: #444;
    margin-bottom: 14px;
    padding: 12px 18px;
    background: #f7f3ff;
    border-radius: 8px;
    border-left: 4px solid #8e44ad;
}

/* ----- その他の候補セクション ----- */
.ffs-m1-others-section {
    margin-bottom: 24px;
}

.ffs-m1-others-header {
    font-size: 18px;
    font-weight: 700;
    color: #666;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* ----- コンパクトカード（2位以降 — 既存カード形式に準拠） ----- */
.ffs-m1-compact-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}
.ffs-m1-compact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.ffs-m1-compact-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.ffs-m1-compact-name {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.ffs-m1-compact-ruby {
    font-size: 12px;
    opacity: 0.85;
    margin-left: 8px;
    color: white;
}

/* 作品グリッド — 既存の .ffs-actress-products と同じ形式 */
.ffs-m1-compact-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    overflow: visible;
}

.ffs-m1-compact-thumb {
    cursor: pointer;
    transition: transform 0.2s;
}
.ffs-m1-compact-thumb:hover {
    transform: scale(1.05);
}

.ffs-m1-compact-thumb .ffs-product-thumb-wrapper {
    width: auto;
    min-width: unset;
    position: relative;
    aspect-ratio: 147/200;
    border-radius: 6px;
    overflow: hidden;
    background: #e0e0e0;
}
.ffs-m1-compact-thumb .ffs-product-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    display: block;
}

.ffs-m1-compact-footer {
    border-top: 1px solid #f0f0f0;
}

.ffs-m1-compact-footer .ffs-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    text-decoration: none;
    transition: all 0.2s;
}
.ffs-m1-compact-footer .ffs-footer-link:hover {
    color: #ff6b9d;
    background: #fef0f5;
}

/* ----- 空結果 ----- */
.ffs-m1-empty {
    text-align: center;
    padding: 48px 20px;
    color: #999;
    font-size: 15px;
}

/* ----- 顔サムネイル: 大きめ & 角度表示なし ----- */
.ffs-face-thumb {
    width: 80px !important;
    height: 80px !important;
}
.ffs-face-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.ffs-thumb-angle {
    display: none !important;
}

/* ----- 検出後: 下の青ボックスを白背景テキストに ----- */
.ffs-face-thumbnails {
    margin-bottom: 0 !important;
}
#searchControls {
    margin-top: 0 !important;
}
#searchControls .ffs-step-hint {
    background: none !important;
    border-left: none !important;
    font-size: 13px;
    color: #999;
    padding: 6px 0 10px;
    margin: 0;
}

/* ----- レスポンシブ ----- */
@media (max-width: 640px) {
    .ffs-m1-hero-name {
        font-size: 20px;
    }
    .ffs-m1-hero-header {
        padding: 16px 14px 10px;
    }
    .ffs-m1-hero-featured {
        padding: 0 10px;
    }
    .ffs-m1-hero-thumbs {
        padding: 10px 12px;
    }
    .ffs-m1-hero-thumbs .ffs-m1-hero-thumb-item {
        flex: 0 0 calc((100% - 20px) / 3);
        max-width: none;
    }
    .ffs-m1-hero-thumbs .ffs-m1-hero-thumb-item:nth-child(n+4) {
        display: none;
    }
    .ffs-m1-hero-footer {
        padding: 10px 12px 14px;
        flex-direction: column;
        gap: 8px;
    }
    .ffs-m1-grid-2col {
        grid-template-columns: 1fr;
    }
    .ffs-m1-hero-featured .ffs-vr-badge {
        left: 16px;
    }
    .ffs-m1-hero-featured .ffs-release-badge {
        right: 16px;
    }
    .ffs-m1-alias-header,
    .ffs-m1-others-header {
        font-size: 16px;
    }
}
