/* =====================================================
 * 天下情勢・合戦情報 — 専用ページスタイル
 * 既存の style.css (.world-*, .rank-*, .score-*, .diplo-*) パターンを踏襲
 * ===================================================== */

/* ワールド切替タブ */
.ws-world-tabs {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 9999px;
    padding: 4px;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    max-width: 100%;
}
.ws-world-tabs::-webkit-scrollbar {
    height: 4px;
}
.ws-world-tabs::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}
.ws-tab {
    padding: 10px 24px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.ws-tab:hover { color: #1e40af; }
.ws-tab.active {
    background: #1e40af;
    color: white;
    box-shadow: 0 1px 3px rgba(30,64,175,0.3);
}

/* セクションタイトル */
.ws-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 3px solid #1e40af;
}

/* パネル */
.ws-panel {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

/* ローディングスピナー */
.ws-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: ws-spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes ws-spin { to { transform: rotate(360deg); } }

/* メタ情報の更新時刻 */
.ws-meta-time {
    display: inline-block;
    margin-left: 12px;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #6b7280;
}

/* =====================================================
 * 進行中合戦カード（複数対応グリッド）
 * ===================================================== */
.ws-battle-cards-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 599px) {
    .ws-battle-cards-grid {
        grid-template-columns: 1fr;
    }
}


/* =====================================================
 * 総合力スコア・ランキング（トップページパターン踏襲）
 * ===================================================== */
.ws-score-row, .ws-rank-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}
.ws-score-label, .ws-rank-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
    flex-shrink: 0;
}
.ws-rank-number {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    background: #f3f4f6;
    color: #6b7280;
    flex-shrink: 0;
}
.ws-score-row:nth-child(1) .ws-rank-number,
.ws-rank-row:nth-child(1) .ws-rank-number { background: #fef3c7; color: #92400e; }
.ws-score-row:nth-child(2) .ws-rank-number,
.ws-rank-row:nth-child(2) .ws-rank-number { background: #e5e7eb; color: #374151; }
.ws-score-row:nth-child(3) .ws-rank-number,
.ws-rank-row:nth-child(3) .ws-rank-number { background: #fed7aa; color: #9a3412; }

.ws-rank-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.ws-bar-wrap {
    flex: 1;
    height: 22px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.ws-bar {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    transition: width 0.5s ease;
    min-width: 20px;
}
.ws-bar-text {
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    white-space: nowrap;
}
.ws-score-detail {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 70px;
    flex-shrink: 0;
}
.ws-score-territory { font-size: 0.7rem; color: #6b7280; }
.ws-rank-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 90px;
    flex-shrink: 0;
}
.ws-rank-winrate { font-size: 0.7rem; color: #6b7280; }
.ws-rank-points { font-size: 0.65rem; color: #9ca3af; }
.ws-momentum-up { color: #10b981; font-size: 0.7rem; }
.ws-momentum-down { color: #ef4444; font-size: 0.7rem; }
.ws-momentum-stay { color: #d1d5db; font-size: 0.7rem; }

.ws-momentum-pct {
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.ws-momentum-pct.positive {
    background: #dcfce7;
    color: #166534;
}

.ws-momentum-pct.negative {
    background: #fee2e2;
    color: #991b1b;
}

.ws-peak-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
    background: #e0e7ff;
    color: #3730a3;
    margin-left: 4px;
    cursor: help;
    transition: all 0.2s;
    border: 1px solid #c7d2fe;
}

.ws-peak-badge:hover {
    background: #c7d2fe;
    transform: translateY(-1px);
}

.ws-peak-badge.ws-peak-now {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
    animation: ws-pulse 2s ease-in-out infinite;
}

.ws-peak-badge.ws-peak-now:hover {
    background: #fde68a;
}

@keyframes ws-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* =====================================================
 * 家紋アイコン
 * ===================================================== */
.ws-kamon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
}
.ws-kamon svg, .ws-kamon img { display: block; }

/* =====================================================
 * レーダーチャート
 * ===================================================== */
.ws-radar-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    border: 1px solid #e5e7eb;
}
.ws-radar-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.ws-radar-canvas { width: 100%; height: auto; }

/* =====================================================
 * 支配関係ツリー
 * ===================================================== */
.ws-tree-root {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ws-tree-node {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.ws-tree-name {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f3f4f6;
    white-space: nowrap;
}
.ws-tree-name.ws-tree-root-name {
    background: #1e40af;
    color: white;
}
.ws-tree-children {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 12px;
    border-left: 2px solid #e5e7eb;
    margin-left: 8px;
}
.ws-tree-arrow {
    color: #d1d5db;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: 5px;
}

/* =====================================================
 * 外交関係 — ブロック表示
 * ===================================================== */
.ws-diplo-blocs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ws-diplo-bloc {
    border-radius: 10px;
    border: 1px solid rgba(16,185,129,0.2);
    background: rgba(209,250,229,0.08);
    overflow: hidden;
}
.ws-diplo-bloc.solo {
    border-color: rgba(239,68,68,0.2);
    background: rgba(254,226,226,0.06);
}
.ws-diplo-bloc-allies {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
}
.ws-diplo-bloc-enemies {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(239,68,68,0.06);
    border-top: 1px dashed rgba(239,68,68,0.15);
}
.ws-diplo-bloc-tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ws-diplo-bloc-tag.alliance {
    color: #059669;
    background: rgba(16,185,129,0.12);
}
.ws-diplo-bloc-tag.hostile {
    color: #dc2626;
    background: rgba(239,68,68,0.1);
}
.ws-diplo-bloc-tag.neutral {
    color: #6b7280;
    background: rgba(107,114,128,0.1);
}
.ws-diplo-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--chip-color, #6b7280);
    background: rgba(107,114,128,0.08);
    background: color-mix(in srgb, var(--chip-color, #6b7280) 8%, transparent);
    border: 1px solid rgba(107,114,128,0.18);
    border-color: color-mix(in srgb, var(--chip-color, #6b7280) 18%, transparent);
    transition: transform 0.15s, box-shadow 0.15s;
}
.ws-diplo-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.ws-diplo-chip.hostile {
    opacity: 0.85;
}
.ws-diplo-chip.neutral {
    opacity: 0.7;
}
.ws-diplo-link-icon {
    color: #10b981;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.ws-diplo-neutral-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

/* 外交力分析バー */
.ws-diplo-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.ws-diplo-name { font-size: 0.8rem; font-weight: 600; min-width: 60px; }
.ws-diplo-bars { flex: 1; display: flex; gap: 2px; height: 14px; }
.ws-diplo-bar-alliance {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
    transition: width 0.3s;
}
.ws-diplo-bar-hostile {
    height: 100%;
    background: #ef4444;
    border-radius: 3px;
    transition: width 0.3s;
}
.ws-diplo-balance { font-size: 0.75rem; font-weight: 600; min-width: 30px; text-align: right; }
.ws-diplo-positive { color: #10b981; }
.ws-diplo-negative { color: #ef4444; }
.ws-diplo-neutral-text { color: #9ca3af; }

/* =====================================================
 * 領土分布
 * ===================================================== */
.ws-territory-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.ws-territory-row:last-child { border-bottom: none; }
.ws-territory-name {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 80px;
}
.ws-territory-bar-wrap {
    flex: 1;
    display: flex;
    gap: 4px;
    align-items: center;
}
.ws-territory-bar {
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    transition: width 0.5s ease;
}
.ws-territory-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.ws-territory-countries {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-left: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* =====================================================
 * 合戦履歴
 * ===================================================== */
.ws-history-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f3f4f6;
}
.ws-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #f9fafb;
}
.ws-history-item:last-child { border-bottom: none; }
.ws-history-icon { flex-shrink: 0; font-size: 0.85rem; }
.ws-history-text { flex: 1; color: #374151; }
.ws-history-winner {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: #dcfce7;
    color: #166534;
    white-space: nowrap;
}
.ws-history-draw {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
}
.ws-history-ongoing {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: #fef3c7;
    color: #92400e;
}

/* =====================================================
 * トレンドチャート
 * ===================================================== */
.ws-trend-btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ws-trend-btn:hover { color: #1e40af; background: #eff6ff; }
.ws-trend-btn.active {
    background: #1e40af;
    color: white;
    border-color: #1e40af;
}
#ws-trend-chart-wrap { position: relative; width: 100%; }
#ws-trend-canvas { width: 100%; height: auto; display: block; }

/* =====================================================
 * ビュー切替タブ
 * ===================================================== */
.ws-view-tab {
    padding: 10px 24px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.ws-view-tab:hover { color: #1e40af; }
.ws-view-tab.active {
    background: #1e40af;
    color: white;
    box-shadow: 0 1px 3px rgba(30,64,175,0.3);
}

/* =====================================================
 * 検索入力
 * ===================================================== */
.ws-search-input {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #374151;
    background: white;
    transition: border-color 0.2s;
}
.ws-search-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}
.ws-search-input::placeholder { color: #9ca3af; }

/* =====================================================
 * 週セレクタ
 * ===================================================== */
.ws-week-selector {
    padding: 6px 32px 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #374151;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.2s;
}
.ws-week-selector:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}

/* =====================================================
 * 功名帳ランキング
 * ===================================================== */
.ws-merit-btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ws-merit-btn:hover { color: #1e40af; background: #eff6ff; }
.ws-merit-btn.active {
    background: #1e40af;
    color: white;
    border-color: #1e40af;
}

/* トップ3サマリー */
.ws-podium {
    margin-bottom: 12px;
}
.ws-podium-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.8rem;
}
.ws-podium-label {
    font-weight: 600;
    color: #9ca3af;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.ws-podium-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}
.ws-podium-chip:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.ws-podium-pos {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}
.ws-podium-chip:nth-child(2) .ws-podium-pos { background: #fef3c7; color: #92400e; }
.ws-podium-chip:nth-child(3) .ws-podium-pos { background: #e5e7eb; color: #374151; }
.ws-podium-chip:nth-child(4) .ws-podium-pos { background: #fed7aa; color: #9a3412; }
.ws-podium-pts {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-left: 2px;
}

/* プレイヤーカード */
.ws-player-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.ws-player-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.ws-player-card-name {
    font-size: 1.2rem;
    font-weight: 800;
}
.ws-player-card-faction {
    font-size: 0.8rem;
    color: #6b7280;
}
.ws-player-card-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.ws-player-card-close:hover { background: #f3f4f6; color: #374151; }
.ws-player-card-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.ws-player-card-stat {
    text-align: center;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.ws-player-card-stat-val {
    font-size: 1.1rem;
    font-weight: 700;
}
.ws-player-card-stat-label {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 2px;
}
.ws-player-card-radar-wrap {
    display: flex;
    justify-content: center;
}

.ws-merit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.15s;
}
.ws-merit-row:hover { background: rgba(30,64,175,0.03); border-radius: 6px; }
.ws-merit-row:last-child { border-bottom: none; }
.ws-merit-name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 80px;
    flex-shrink: 0;
}
.ws-merit-formations {
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

/* 折りたたみボタン */
.ws-merit-fold {
    text-align: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.ws-merit-fold-btn {
    display: inline-block;
    padding: 6px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.ws-merit-fold-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* =====================================================
 * 勢力チップセレクタ
 * ===================================================== */
.ws-faction-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fc, #6b7280);
    background: #f9fafb;
    border: 1.5px solid var(--fc, #e5e7eb);
    cursor: pointer;
    transition: all 0.2s;
}
.ws-faction-chip:hover {
    background: color-mix(in srgb, var(--fc) 10%, white);
}
.ws-faction-chip.active {
    background: var(--fc, #1e40af);
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.ws-faction-clickable { cursor: pointer; transition: background 0.15s; }
.ws-faction-clickable:hover { background: rgba(30,64,175,0.04); border-radius: 8px; }

/* =====================================================
 * 勢力詳細パネル
 * ===================================================== */
.ws-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}
.ws-detail-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ws-detail-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}
.ws-detail-close:hover { background: #f3f4f6; color: #374151; }
.ws-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}
.ws-detail-stat {
    text-align: center;
    min-width: 70px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.ws-detail-stat-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #374151;
}
.ws-detail-stat-label {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 2px;
}
.ws-detail-section {
    margin-bottom: 16px;
}
.ws-detail-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

/* =====================================================
 * ポイント内訳テーブル
 * ===================================================== */
.ws-points-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ws-points-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.ws-points-table th {
    padding: 6px 10px;
    text-align: right;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}
.ws-points-table th:first-child { text-align: center; }
.ws-points-table td {
    padding: 6px 10px;
    text-align: right;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
}
.ws-points-table td:first-child { text-align: center; font-weight: 600; }
.ws-points-table tbody tr:hover { background: #f9fafb; }
.ws-delta-up { color: #10b981; font-size: 0.7rem; margin-left: 2px; }
.ws-delta-down { color: #ef4444; font-size: 0.7rem; margin-left: 2px; }

/* =====================================================
 * 勝敗ストリーク
 * ===================================================== */
.ws-streak-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.ws-streak-marker {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}
.ws-streak-w { background: #dcfce7; color: #166534; }
.ws-streak-l { background: #fee2e2; color: #991b1b; }
.ws-streak-d { background: #f3f4f6; color: #6b7280; }

/* (外交リデザイン styles merged into main block above) */

/* =====================================================
 * レスポンシブ
 * ===================================================== */
/* =====================================================
 * アナウンス
 * ===================================================== */
.ws-announcement-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 14px 18px;
}
.ws-announcement-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 6px;
}
.ws-announcement-icon { margin-right: 4px; }
.ws-announcement-body {
    font-size: 0.8rem;
    color: #374151;
    line-height: 1.6;
}

/* =====================================================
 * モバイル最適化（768px以下）
 * タッチターゲット最小44x44px、フォント最小16px
 * ===================================================== */
@media (max-width: 768px) {
    /* 合戦カード：横並びで高さを抑える */
    .ws-battle-card {
        padding: 16px 12px;
    }

    .ws-battle-name {
        font-size: 0.95rem;
        margin-bottom: 12px;
        text-align: center;
    }

    .ws-battle-jinto {
        font-size: 0.7rem;
        margin-bottom: 10px;
    }

    .ws-battle-forces {
        display: flex;
        flex-direction: row;
        gap: 8px;
        align-items: stretch;
    }

    .ws-battle-force {
        flex: 1;
        background: #f9fafb;
        border-radius: 10px;
        padding: 12px 8px;
        border: 2px solid #e5e7eb;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    .ws-battle-vs {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
        font-weight: 700;
        color: #9ca3af;
        padding: 0 4px;
        flex-shrink: 0;
    }

    .ws-battle-kamon {
        margin-bottom: 6px;
    }

    .ws-battle-force-name {
        font-size: 0.85rem;
        margin-bottom: 4px;
        text-align: center;
        word-break: keep-all;
    }

    .ws-battle-status {
        font-size: 0.65rem;
        padding: 2px 6px;
        margin-bottom: 4px;
    }

    .ws-battle-merit {
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 2px;
    }

    .ws-battle-morale {
        font-size: 0.65rem;
        margin-top: 2px;
    }

    .ws-merit-bar {
        height: 6px;
        margin-top: 10px;
    }

    /* スコア・ランキング行：タッチしやすく */
    .ws-score-row, .ws-rank-row {
        padding: 12px 8px;
        min-height: 48px;
        gap: 12px;
    }

    .ws-score-label, .ws-rank-label {
        min-width: auto;
        flex-wrap: wrap;
        gap: 6px;
    }

    .ws-rank-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .ws-rank-name {
        font-size: 0.9rem;
    }

    .ws-bar-wrap {
        height: 28px;
    }

    .ws-bar-text {
        font-size: 0.75rem;
    }

    .ws-score-detail, .ws-rank-stats {
        flex-direction: column;
        gap: 4px;
        min-width: auto;
        align-items: flex-end;
    }

    .ws-rank-winrate, .ws-rank-points {
        font-size: 0.75rem;
    }

    /* タブ：横スクロール対応 */
    .ws-world-tabs, .ws-detail-modal-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .ws-world-tabs::-webkit-scrollbar,
    .ws-detail-modal-tabs::-webkit-scrollbar {
        display: none;
    }

    .ws-tab, .ws-view-tab, .ws-detail-tab {
        white-space: nowrap;
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    /* ボタン：タッチターゲット確保 */
    .ws-merit-btn, .ws-trend-btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    /* セレクタ：タッチしやすく */
    .ws-week-selector, .ws-faction-select {
        min-height: 44px;
        padding: 10px 32px 10px 12px;
        font-size: 0.9rem;
        max-width: 100%;
    }

    /* 検索入力：タッチしやすく */
    .ws-search-input {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 1rem;
    }

    /* 功名帳ランキング */
    .ws-merit-row {
        padding: 10px 8px;
        min-height: 48px;
        gap: 8px;
    }

    .ws-merit-name {
        font-size: 0.85rem;
        min-width: auto;
    }

    .ws-merit-formations {
        font-size: 0.75rem;
    }

    /* プレイヤーカード */
    .ws-player-card {
        padding: 16px;
    }

    .ws-player-card-name {
        font-size: 1.1rem;
    }

    .ws-player-card-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ws-player-card-stat {
        padding: 12px;
    }

    /* 詳細モーダル */
    .ws-detail-modal-container {
        width: 98%;
        max-height: 96vh;
        border-radius: 12px;
    }

    .ws-detail-modal-header {
        padding: 16px;
    }

    .ws-detail-modal-player-name {
        font-size: 1.3rem;
    }

    .ws-detail-modal-close-btn {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
    }

    .ws-detail-modal-content {
        padding: 16px;
    }

    .ws-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 勢力チップ */
    .ws-faction-chip {
        padding: 8px 12px;
        min-height: 44px;
        font-size: 0.85rem;
    }

    /* 外交関係 */
    .ws-diplo-bloc-allies, .ws-diplo-bloc-enemies {
        gap: 6px;
        padding: 10px 12px;
    }

    .ws-diplo-chip {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-height: 36px;
    }

    /* 表彰台 */
    .ws-podium-summary {
        gap: 6px;
        padding: 10px;
    }

    .ws-podium-chip {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-height: 40px;
    }

    /* 領土分布 */
    .ws-territory-countries {
        max-width: 150px;
        font-size: 0.75rem;
    }

    /* ハイライトカード */
    .ws-highlight-card {
        padding: 14px;
    }

    .ws-highlight-icon {
        font-size: 1.8rem;
    }

    .ws-highlight-title {
        font-size: 0.85rem;
    }

    .ws-highlight-desc {
        font-size: 0.75rem;
    }

    /* 比較ツール */
    .ws-compare-name {
        min-width: 70px;
        font-size: 0.8rem;
    }

    .ws-compare-bar {
        height: 36px;
    }

    .ws-compare-val {
        font-size: 0.7rem;
    }

    /* テーブル：横スクロール */
    .ws-category-stats-table,
    .ws-ranking-trend-table,
    .ws-battle-history-table,
    .ws-points-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ws-stats-table {
        font-size: 0.8rem;
        min-width: 500px;
    }

    .ws-stats-table th,
    .ws-stats-table td {
        padding: 8px;
        white-space: nowrap;
    }

    /* ランキングカード */
    .ws-ranking-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ws-ranking-card {
        padding: 18px;
    }

    .ws-rank-big {
        font-size: 2.2rem;
    }

    /* チャート */
    .ws-chart-container {
        padding: 12px;
        overflow-x: auto;
    }

    /* パフォーマンスの波 */
    .ws-waves-timeline {
        height: 50px;
    }

    .ws-wave-label {
        font-size: 0.7rem;
    }

    /* セクションタイトル */
    .ws-section-title {
        font-size: 0.9rem;
    }

    .ws-detail-section-title {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .ws-section-help {
        font-size: 0.7rem;
    }
}

/* =====================================================
 * プレイヤー詳細モーダル
 * ===================================================== */

/* モーダル本体 */
.ws-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ws-modal-fade-in 0.2s ease;
}

.ws-detail-modal.hidden {
    display: none;
}

@keyframes ws-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* オーバーレイ */
.ws-detail-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* コンテナ */
.ws-detail-modal-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ws-modal-slide-up 0.3s ease;
}

@keyframes ws-modal-slide-up {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ヘッダー */
.ws-detail-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(to bottom, #f9fafb, white);
    flex-shrink: 0;
}

.ws-detail-modal-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ws-detail-modal-player-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

.ws-detail-modal-player-meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.ws-detail-modal-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ws-detail-modal-close-btn:hover {
    background: #e5e7eb;
    color: #374151;
    transform: rotate(90deg);
}

/* タブナビゲーション */
.ws-detail-modal-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    flex-shrink: 0;
}

.ws-detail-tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.ws-detail-tab:hover {
    color: #1e40af;
    background: rgba(30, 64, 175, 0.05);
}

.ws-detail-tab.active {
    color: #1e40af;
    border-bottom-color: #1e40af;
    background: white;
}

/* タブコンテンツ */
.ws-detail-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: white;
}

.ws-detail-tab-content {
    display: none;
}

.ws-detail-tab-content.active {
    display: block;
    min-height: 500px;
}

/* 統計グリッド */
.ws-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ws-stat-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ws-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ws-stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.ws-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e40af;
}

.ws-stat-help {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 6px;
    line-height: 1.3;
}

/* セクションタイトル */
.ws-detail-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.ws-section-help {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
    font-style: italic;
}

/* 統計テーブル */
.ws-category-stats-table,
.ws-ranking-trend-table,
.ws-battle-history-table {
    width: 100%;
    overflow-x: auto;
}

.ws-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ws-stats-table thead {
    background: #f9fafb;
}

.ws-stats-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
}

.ws-stats-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.ws-stats-table tbody tr:hover {
    background: #f9fafb;
}

.ws-battle-table th:nth-child(n+3),
.ws-battle-table td:nth-child(n+3) {
    text-align: right;
}

/* チャートコンテナ */
.ws-chart-container {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.ws-chart-container canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* パフォーマンスの波 */
.ws-performance-waves {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.ws-waves-timeline {
    display: flex;
    gap: 2px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.ws-wave-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    position: relative;
}

.ws-wave-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

/* ランキングカード */
.ws-ranking-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ws-ranking-card {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 12px;
    padding: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

.ws-ranking-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ws-ranking-card-content {
    text-align: center;
}

.ws-rank-big {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

.ws-rank-suffix {
    font-size: 1.2rem;
    font-weight: 600;
    margin-left: 4px;
}

.ws-rank-sub {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 8px;
}

.ws-ranking-card-help {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 8px;
    font-style: italic;
}

/* タブイントロ */
.ws-tab-intro {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 16px;
    padding: 12px;
    background: #f9fafb;
    border-left: 3px solid #1e40af;
    border-radius: 4px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .ws-detail-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .ws-detail-modal-header {
        padding: 16px;
    }

    .ws-detail-modal-player-name {
        font-size: 1.2rem;
    }

    .ws-detail-modal-player-meta {
        font-size: 0.75rem;
    }

    .ws-detail-modal-tabs {
        padding: 0 16px;
    }

    .ws-detail-tab {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .ws-detail-modal-content {
        padding: 16px;
    }

    .ws-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ws-stat-card {
        padding: 12px;
    }

    .ws-stat-value {
        font-size: 1.4rem;
    }

    .ws-ranking-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ws-rank-big {
        font-size: 2rem;
    }

    .ws-waves-timeline {
        height: 50px;
    }

    .ws-wave-label {
        font-size: 0.65rem;
    }

    .ws-chart-container {
        padding: 12px;
    }

    .ws-detail-section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .ws-section-help {
        font-size: 0.7rem;
    }

    .ws-stat-help {
        font-size: 0.65rem;
    }

    .ws-tab-intro {
        font-size: 0.8rem;
        padding: 10px;
    }
}

/* =====================================================
 * 今週のハイライト
 * ===================================================== */
.ws-highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.ws-highlight-card {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid;
    background: #f9fafb;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ws-highlight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ws-highlight-rising { border-left-color: #10b981; background: linear-gradient(135deg, #f0fdf4, #f9fafb); }
.ws-highlight-falling { border-left-color: #ef4444; background: linear-gradient(135deg, #fef2f2, #f9fafb); }
.ws-highlight-battle { border-left-color: #f59e0b; background: linear-gradient(135deg, #fffbeb, #f9fafb); }
.ws-highlight-alliance { border-left-color: #3b82f6; background: linear-gradient(135deg, #eff6ff, #f9fafb); }
.ws-highlight-discovery { border-left-color: #8b5cf6; background: linear-gradient(135deg, #faf5ff, #f9fafb); }
.ws-highlight-warning { border-left-color: #dc2626; background: linear-gradient(135deg, #fef2f2, #f9fafb); }

.ws-highlight-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}

.ws-highlight-content {
    flex: 1;
}

.ws-highlight-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 4px;
}

.ws-highlight-desc {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
}

/* =====================================================
 * 勢力比較ツール
 * ===================================================== */
.ws-faction-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #374151;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.2s;
    min-width: 150px;
}

.ws-faction-select:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.ws-compare-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.ws-compare-metric {
    background: #f9fafb;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

.ws-compare-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ws-compare-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ws-compare-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ws-compare-name {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 80px;
    flex-shrink: 0;
}

.ws-compare-bar {
    flex: 1;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    transition: width 0.5s ease;
    min-width: 60px;
}

.ws-compare-val {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ws-compare-summary {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 16px;
    font-size: 0.85rem;
    color: #1e40af;
    line-height: 1.6;
}

.ws-compare-summary p {
    margin: 4px 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .ws-highlights-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ws-highlight-card {
        padding: 12px;
    }

    .ws-highlight-icon {
        font-size: 1.5rem;
    }

    .ws-faction-select {
        min-width: 120px;
        font-size: 0.8rem;
    }

    .ws-compare-name {
        min-width: 60px;
        font-size: 0.75rem;
    }

    .ws-compare-bar {
        height: 28px;
    }
}
