/* ==========================================================
   integration.css
   統合サイト専用の追加スタイル
   - スキルDB と総合サイトのデザイン整合性
   - 訪問者カウンターの装飾
   - power.html 由来の画像 Lightbox
   - 各タブ間のレイアウト調整
   ========================================================== */

/* ==========================================================
   タブ表示制御（共通） — common.js に合わせる
   ========================================================== */
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   スキルDBタブ専用の余白調整
   （元の skill-db 単体サイトでは body直下だったが、ここでは tab-content 内）
   ========================================================== */
#content-skill .search-bar-wrapper {
    margin-top: 0;
}

/* ==========================================================
   訪問者カウンター
   ========================================================== */
.visitor-counter-card {
    background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
    border-left: 4px solid var(--accent);
}

.visitor-counter-display {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 14px 14px;
    background: linear-gradient(135deg, #fff5fa 0%, #f5f7ff 100%);
    border-radius: var(--radius);
    flex-wrap: wrap;
    position: relative;
}

.visitor-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(253, 121, 168, 0.35);
}

.visitor-text-block {
    flex: 1;
    min-width: 180px;
}

.visitor-number {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--accent-dark);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.visitor-number.bumping {
    color: var(--primary-dark);
}

.visitor-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 600;
}

.visitor-pulse {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--success);
    background: rgba(0, 184, 148, 0.08);
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 184, 148, 0.2);
    white-space: nowrap;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.5);
    animation: pulseDot 1.6s infinite;
}

@keyframes pulseDot {
    0%   { box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(0, 184, 148, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 184, 148, 0); }
}

.visitor-note {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 10px;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .visitor-counter-display {
        padding: 14px 10px 10px;
        gap: 12px;
    }
    .visitor-number {
        font-size: 1.8rem;
    }
    .visitor-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
    .visitor-pulse {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
}

/* ==========================================================
   power タブの画像 Lightbox（拡大表示）
   ========================================================== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.86);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    cursor: zoom-out;
}
.lightbox-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}
.lightbox-img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* zoomable-img のホバー効果 */
.zoomable-img {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.zoomable-img:hover {
    transform: scale(1.01);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* ==========================================================
   ヘッダロゴアイコンの色調整
   （統合サイトではアクセントカラーを優先）
   ========================================================== */
.logo i.fa-book-sparkles,
.logo i.fa-wand-sparkles,
.logo #header-icon {
    color: var(--accent);
}

/* バージョンタグ（スキルDB由来）を統合ヘッダ内でも使えるように */
.logo .version-tag {
    font-size: 0.7rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    margin-left: 4px;
}

/* ==========================================================
   スキルDB のモーダルが他タブのコンテンツに干渉しないよう
   z-index を念のため明示
   ========================================================== */
.modal-overlay {
    z-index: 9000;
}

/* ==========================================================
   サイドバーがマウントされたあとの位置安定化
   （モバイルでヘッダ重なり対策）
   ========================================================== */
.sidebar {
    z-index: 1000;
}
.overlay {
    z-index: 900;
}

/* ==========================================================
   info タブ：scrollRestoration 復帰時のレイアウト調整
   ========================================================== */
#content-info .info-card + .info-card {
    margin-top: 0;
}

/* ==========================================================
   モバイル用全体微調整
   ========================================================== */
@media (max-width: 480px) {
    .header-inner {
        height: 56px;
    }
    .logo {
        font-size: 1rem;
    }
    .main-content {
        padding: 14px 10px 30px;
    }
}

/* ==========================================================
   v6.1 編成シミュレーター: Top2 案 + 立ち回り解説
   ========================================================== */
.sim-top-teams {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
    margin-top: 8px;
}
.sim-top-team {
    background: linear-gradient(135deg, #fff 0%, #fef9f5 100%);
    border: 2px solid var(--border, #f0d4e0);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 6px rgba(253, 121, 168, 0.06);
}
.sim-top-team-head {
    font-size: 0.95rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #f0d4e0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sim-top-team-head .score-num {
    color: #d63384;
    font-weight: 800;
    font-size: 1.1rem;
    margin-left: auto;
}
.sim-top-team-body .row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.sim-top-team-body .row-label {
    min-width: 70px;
    color: #888;
    font-size: 0.78rem;
    font-weight: 600;
}
.sim-team-chip {
    display: inline-block;
    padding: 3px 9px;
    background: #fff5fa;
    border: 1px solid #f9b6d2;
    border-radius: 14px;
    font-size: 0.78rem;
    margin: 1px 3px 1px 0;
}
.sim-team-chip.friend  { background: #fffbe6; border-color: #f6cf60; }
.sim-team-chip.mem     { background: #f0f6ff; border-color: #94c4f7; }
.sim-team-chip.item    { background: #f3fff0; border-color: #94da8a; }
.sim-team-chip small   { color: #888; margin-left: 3px; }

.sim-playbook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}
.sim-playbook-card {
    background: linear-gradient(135deg, #ffffff 0%, #fff8fb 100%);
    border-left: 4px solid #fd79a8;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.sim-playbook-card .pb-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.92rem;
}
.sim-playbook-card .pb-icon {
    font-size: 1.15rem;
}
.sim-playbook-card .pb-text {
    font-size: 0.85rem;
    line-height: 1.55;
    color: #4d4d52;
}

/* ==========================================================
 * Phase 3.7: 艦隊専用版 編成シミュレーター β UI
 * ========================================================== */

/* サイドバー: タブ名横の β バッジ */
.member-beta-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    vertical-align: middle;
    line-height: 1.4;
    letter-spacing: 0.4px;
}

/* 旧艦隊ホームのツールカード β バッジ (v1.9.9 で艦隊ホームタブ削除) */
.fleet-tools-grid .ft-tag.beta {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: #fff;
}
.fleet-tools-grid .ft-icon.purple {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: #fff;
}
.fleet-tools-grid .ft-icon.blue {
    background: linear-gradient(135deg, #4facfe, #00c6fb);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 198, 251, 0.28);
}

/* 艦隊シミュレーター β バナー */
.fleet-sim-banner {
    margin: 0 0 12px 0;
    padding: 0 12px;
}
.fleet-sim-banner-inner {
    background: linear-gradient(135deg, #fff5fb 0%, #f6f0ff 100%);
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-left: 4px solid #6c5ce7;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(108, 92, 231, 0.08);
}
.fleet-sim-banner-inner > i {
    font-size: 22px;
    color: #6c5ce7;
    flex: 0 0 auto;
}
.fleet-sim-banner-inner .fsb-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 2px;
}
.fleet-sim-banner-inner .fsb-beta {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 6px;
    letter-spacing: 0.6px;
}
.fleet-sim-banner-inner .fsb-sub {
    font-size: 12px;
    color: #636e72;
    line-height: 1.5;
}

/* 艦隊シミュレーターのルート */
.fleet-sim-root {
    min-height: 200px;
}
.fleet-sim-root .sim-loading {
    padding: 30px 16px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* EX_TABLE 検証パネル */
.fleet-sim-ex-panel {
    margin: 16px 12px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #f0e6ec;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.fleet-sim-ex-panel .fsex-head {
    font-size: 13px;
    font-weight: 700;
    color: #c2185b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.fleet-sim-ex-panel .fsex-body {
    font-size: 11px;
    color: #444;
    overflow-x: auto;
}

/* ==========================================================
   モバイル(≤600px): auto-fit グリッドの折り返し & データ文字拡大
   ========================================================== */
@media (max-width: 600px) {
    .sim-top-teams {
        grid-template-columns: 1fr;
    }
    .sim-playbook-grid {
        grid-template-columns: 1fr;
    }
    .fleet-sim-ex-panel .fsex-body {
        font-size: 12px;
    }
}
