/* =========================================
   1. 過去のグリッド設定（念のため残す）
========================================= */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .tables-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   v1.9.13: サブタブ内リード文 (.admin-description)
   テーブルと同じ最大幅 (800px) で中央寄せにし、
   PC で表示したときに左寄せになって浮いて見えるのを防ぐ。
========================================= */
.admin-description {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    padding: 12px 16px;
    background: #f8fafc;
    border-left: 4px solid #fd79a8;
    border-radius: 8px;
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.55;
}
.admin-description i {
    color: #fd79a8;
    margin-right: 6px;
}

/* =========================================
   2. 1番目の表（統合テーブル）の箱とデザイン
========================================= */
.blog-table-container {
    background: white;
    border-radius: 12px;
    padding: 15px 0; /* ★修正：左右の余白をゼロにする（透け防止） */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #edf2f7;
    margin-bottom: 25px;
    max-width: 800px;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.blog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.blog-table th, .blog-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #f1f3f5;
    white-space: nowrap;    /* 文字の折り返しを防ぐ */
}

.blog-table th {
    background-color: #f8fafc;
    color: #4a5568;
    font-weight: 600;
}

/* =========================================
   3. 2番目以降の表（エンカウント等）の箱とデザイン
========================================= */
.data-table-container {
    background: white;
    border-radius: 12px;
    padding: 15px 0; /* ★修正：左右の余白をゼロにする */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #edf2f7;
    margin-bottom: 25px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 1rem;
    border-bottom: 2px solid #f1f3f5;
    padding: 0 15px 8px 15px; /* ★修正：タイトルが端にくっつかないよう左右に余白を追加 */
    flex-wrap: wrap;
    gap: 8px;
}

.data-table-total {
    font-size: 0.8rem;
    color: #718096;
    font-weight: normal;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #f1f3f5;
    white-space: nowrap;
}

.data-table th {
    background-color: #f8fafc;
    color: #4a5568;
    font-weight: 600;
}

.expected-col {
    background-color: #f0f7ff;
    color: #3182ce;
    font-weight: bold;
}

.badge-future {
    background: #e2e8f0;
    color: #64748b;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 5px;
    white-space: nowrap;
    display: inline-block;
}

/* =========================================
   4. 横スクロール時の「一番左の列を固定」
========================================= */
.blog-table th:first-child,
.blog-table td:first-child,
.data-table th:first-child,
.data-table td:first-child {
    position: sticky;
    left: 0;
    background-color: #FFFFFF;
    z-index: 2;
    padding-left: 15px; /* ★修正：削った分の余白をセルの中に移す */
    box-shadow: 2px 0px 4px rgba(0,0,0,0.05); /* 右側の影だけ残す */
}

/* ★追加：一番右のセルも端に詰まらないように余白を持たせる */
.blog-table th:last-child,
.blog-table td:last-child,
.data-table th:last-child,
.data-table td:last-child {
    padding-right: 15px;
}

/* ヘッダー部分は背景色をグレーに維持 */
.blog-table th:first-child,
.data-table th:first-child {
    background-color: #f8fafc;
}
/* =========================================
   v1.9.11 検証まとめ サブタブナビ
========================================= */
.subtab-nav {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 0 auto 22px;
    max-width: 800px;
    padding: 6px;
    background: #f1f3f8;
    border-radius: 12px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
    flex-wrap: nowrap; /* v1.9.13: アクティブ影がはみ出さないよう折り返さず幅内で収める */
    box-sizing: border-box;
}
.subtab-btn {
    flex: 1 1 auto; /* v1.9.13: 均等幅ではなく内容長に合わせて配分し、長めの「コンディション」を詰まらせない */
    min-width: 0;
    padding: 10px 8px; /* v1.9.13: 横padding控えめに */
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    font-family: inherit;
    box-sizing: border-box;
}
.subtab-btn i {
    margin-right: 6px;
}
.subtab-btn:hover {
    background: #ffffff;
    color: #2d3748;
}
.subtab-btn.active {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    color: #ffffff;
    /* v1.9.13: 外側ではなく内側影に変更し、右端でアクティブ時に影がコンテナをはみ出さないようにする */
    box-shadow: 0 1px 3px rgba(253,121,168,0.30);
}
/* v1.9.13: スマホでは文字とアイコンを少し詰めて 3 ボタンが必ず 1 行に収まるようにする */
@media (max-width: 480px) {
    .subtab-nav {
        gap: 3px;
        padding: 4px;
    }
    .subtab-btn {
        padding: 9px 6px;
        font-size: 0.78rem;
    }
    .subtab-btn i {
        margin-right: 4px;
        font-size: 0.85em;
    }
}
@media (max-width: 360px) {
    .subtab-btn {
        padding: 9px 4px;
        font-size: 0.72rem;
    }
    .subtab-btn i {
        margin-right: 3px;
    }
}
.subtab-panel {
    display: none;
    animation: subtabFadeIn 0.25s ease;
}
.subtab-panel.active {
    display: block;
}
@keyframes subtabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   v1.9.11 コンディションタブ — ひとつの大カードに統合
   (配色を抑えてシンプルに)
========================================= */
.cond-wrapper {
    max-width: 820px;
    margin: 0 auto 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border: 1px solid #edf2f7;
    overflow: hidden;
}
.cond-wrapper-header {
    background: linear-gradient(135deg, #fdf2f8 0%, #ffffff 100%);
    padding: 22px 24px 18px;
    border-bottom: 1px solid #f1f5f9;
}
.cond-wrapper-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cond-wrapper-title i {
    color: #e84393;
}
.cond-wrapper-lead {
    margin: 0;
    color: #4a5568;
    font-size: 0.92rem;
    line-height: 1.75;
}
.cond-wrapper-lead strong {
    color: #2d3748;
}

/* ----- 内側ブロック (3 つのセクション) ----- */
.cond-block {
    padding: 22px 24px;
    border-bottom: 1px solid #f1f5f9;
}
.cond-block:last-child {
    border-bottom: none;
}
.cond-block-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 10px 0;
    padding: 4px 0 4px 12px;
    border-left: 4px solid #fd79a8;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cond-block-title i {
    color: #fd79a8;
}
.cond-block-lead {
    margin: 0 0 14px 0;
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.7;
}
.cond-block-lead strong {
    color: #2d3748;
}

/* ----- 階層 / 休憩 共通 表 ----- */
.cond-tier-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #edf2f7;
    background: #ffffff;
}
.cond-tier-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.cond-tier-table thead th {
    background: #f8fafc;
    color: #4a5568;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.85rem;
    white-space: nowrap;
}
.cond-tier-table tbody td {
    padding: 12px 12px;
    border-bottom: 1px solid #f5f7fa;
    color: #2d3748;
    vertical-align: middle;
    white-space: nowrap;
}
.cond-tier-table tbody tr:last-child td {
    border-bottom: none;
}
.cond-tier-table tbody tr:hover {
    background: #fafbfc;
}
.cond-tier-table td.col-tier {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
}
.cond-tier-table td.col-tier i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}
.cond-tier-table td.col-tier .tier-name {
    font-size: 1.0rem;
    color: #2d3748;
}
.cond-tier-table td.col-range {
    font-variant-numeric: tabular-nums;
    color: #4a5568;
    font-weight: 600;
    width: 50%;
    white-space: normal;
}
.cond-tier-table td.col-trigger {
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: #6b7280;
    width: 90px;
}
.cond-tier-table td.col-trigger strong {
    color: #e84393;
    font-size: 1rem;
}

/* ----- 「好き」注意書きコールアウト ----- */
.cond-callout {
    display: flex;
    gap: 10px;
    background: #fff8e6;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 12px;
    font-size: 0.86rem;
    line-height: 1.65;
    color: #6b4f00;
}
.cond-callout i {
    color: #d97706;
    flex-shrink: 0;
    margin-top: 3px;
    font-size: 1rem;
}
.cond-callout strong {
    color: #b91c1c;
}

/* ----- デートプラン グループ ----- */
.cond-plan-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cond-plan-group {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #edf2f7;
    padding: 14px 16px;
}
.cond-plan-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
/* v1.9.13: スマホでは 2 列レイアウトにし、3 番目 (消費0確率) は全幅で 2 段目に配置 */
@media (max-width: 640px) {
    .cond-plan-stats {
        grid-template-columns: 1fr 1fr;
    }
    .cond-plan-stats > .cond-plan-stat:nth-child(3) {
        grid-column: 1 / -1;
    }
}
.cond-plan-stat {
    background: #f8fafc;
    border-radius: 6px;
    padding: 8px 10px;
    border-left: 3px solid #cbd5e0;
}
.cond-plan-stat-label {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 3px;
    letter-spacing: 0.02em;
}
.cond-plan-stat-value {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: #2d3748;
    font-variant-numeric: tabular-nums;
}
.cond-plan-stat.is-positive { border-left-color: #16a34a; }
.cond-plan-stat.is-positive .cond-plan-stat-value { color: #16a34a; }
.cond-plan-stat.is-negative { border-left-color: #dc2626; }
.cond-plan-stat.is-negative .cond-plan-stat-value { color: #dc2626; }
.cond-plan-stat.is-zero     { border-left-color: #94a3b8; }
.cond-plan-stat.is-zero     .cond-plan-stat-value { color: #6b7280; }
.cond-plan-stat.stat-free   { border-left-color: #3182ce; }

/* ----- プラン サムネ (v1.9.12: アイコン部 + プラン名ラベル部の両方が見えるように調整) ----- */
.cond-plan-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cond-plan-thumb {
    position: relative;
    /* 元画像は 270x376 (縦横比 約 1:1.39)。
       添付参考画像のように "アイコン + 下部ラベル (ショッピング等)" の両方を
       見せるため、サムネも同じ縦横比 (約 9:13) として画像全体を表示する。 */
    width: 64px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f3f8;
    border: 1px solid #e2e8f0;
}
.cond-plan-thumb img {
    /* コンテナいっぱいに画像全体を表示 (上部イラストと下部ラベルの両方が見える) */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 補足ノート (v1.9.12: 不要のため非表示。DOM が残っても見えないようにする) */
.cond-plan-note {
    display: none !important;
}

/* ----- マス効果 (準備中プレースホルダ) ----- */
.prep-placeholder {
    max-width: 600px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 14px;
    padding: 50px 30px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border: 1px solid #edf2f7;
    color: #6b7280;
}
.prep-placeholder i {
    font-size: 3rem;
    color: #fd79a8;
    margin-bottom: 16px;
    display: block;
}
.prep-placeholder p {
    font-size: 1.02rem;
    color: #4a5568;
    margin: 0;
}

/* =========================================
   マス効果 サブタブ (検証まとめデザイン準拠)
========================================= */
.mass-wrapper .cond-block:first-of-type { border-top: none; }
.mass-block .mass-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.mass-block .mass-icon {
    width: 58px;
    height: 58px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}
.mass-block .mass-head-txt { min-width: 0; }
.mass-block .mass-name {
    font-size: 1.08rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 4px 0;
}
.mass-block .mass-desc {
    font-size: 0.86rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}
.mass-table td.col-tier {
    gap: 12px;
    min-width: 110px;
}
.mass-table .mass-r-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}
.mass-table .rar-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    padding: 2px 9px;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.mass-table .rar-badge.r1 { background: linear-gradient(135deg, #4a90d9, #3b78c4); }
.mass-table .rar-badge.r2 { background: linear-gradient(135deg, #ef5da8, #e84393); }
.mass-table .rar-badge.r3 { background: linear-gradient(135deg, #f6b73c, #f39c12); }
.mass-table td.col-range {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    width: auto;
}
.mass-table td.col-trigger { width: 84px; }
.mass-table td.col-trigger strong { color: #e84393; }
.mass-table .mass-na { color: #b6bdc8; font-weight: 600; }

@media (max-width: 560px) {
    .mass-block .mass-icon { width: 48px; height: 48px; }
    .mass-block .mass-name { font-size: 1rem; }
    .mass-table td.col-tier { gap: 8px; min-width: 96px; }
    .mass-table .mass-r-img { width: 30px; height: 30px; }
}

/* 単一レア効果（★3のみ等）の効果量表示 */
.mass-block .mass-single {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 11px 14px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 8px;
}
.mass-block .mass-single-label {
    font-size: 0.76rem;
    color: #718096;
    font-weight: 700;
    flex-shrink: 0;
}
.mass-block .mass-single-val {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.92rem;
}

@media (max-width: 600px) {
    .cond-wrapper-header { padding: 16px 14px 14px; }
    .cond-block { padding: 16px 14px; }
    .cond-plan-stat-label { font-size: 0.75rem; }
}
