@charset "UTF-8";
@import url("tokens.css");
/* ==========================================================================
   SHOWROOM イベント追跡用 スタイルシート (showroom_event.css)
   文字と背景のコントラストを徹底改善・非蛍光モダンダーク仕様
   日本語コメント規約準拠 / UTF-8
   ========================================================================== */

/* 全体ベースカラー定義 */
:root {
    --event-bg-dark: #141721;
    --event-card-bg: #1c202a;
    --event-card-inner: #242936;
    --event-border: #3b4252;
    --event-text-main: #f8fafc;
    --event-text-sub: #cbd5e1;
    --event-text-muted: #94a3b8;
    
    /* 落ち着いたアクセントカラー（非蛍光） */
    --accent-blue: #3b82f6;
    --accent-amber: #f59e0b;
    --accent-teal: #0d9488;
    --accent-wine: #ac5093; /* HKT伝統のワインピンク */
    --accent-live: #dc2626;
}

/* イベントページのbody背景色を統一（白背景とのコントラスト衝突を解消） */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background: var(--event-bg-dark);
    color: var(--event-text-main);
    margin: 0;
    padding: 0;
}

/* ヘッダーおよびナビゲーションは showroom.css (v2.0) の共通定義を継承 */



/* ==========================================================================
   メインラッパー（横幅1300px対応）
   ========================================================================== */
.event-main-wrapper {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto 50px auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 8px;
    box-sizing: border-box;
}

/* ==========================================================================
   1. イベント選択エリア (Event Selector)
   ========================================================================== */
.event-select-card {
    background: var(--event-card-bg);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    padding: 12px 16px;
}

.event-select-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--event-text-sub);
}

.event-select-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--event-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-select-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.event-select-col {
    flex: 1 1 auto;
}

.event-select-main {
    flex: 2 1 320px;
}

.event-select-block {
    flex: 1 1 200px;
}

.event-dropdown-select {
    width: 100%;
    height: 38px;
    background: var(--event-card-inner);
    color: #ffffff;
    border: 1px solid var(--event-border);
    border-radius: 5px;
    padding: 0 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.event-dropdown-select option {
    background: #1c202a;
    color: #ffffff;
}

.event-dropdown-select:focus {
    border-color: var(--accent-blue);
}

/* ブロック切り替えクイックピルズ（タブ形式） */
.block-pills-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--event-border);
    align-items: center;
}

.block-pills-label {
    font-size: 11.5px;
    color: var(--event-text-sub);
    margin-right: 4px;
}

.block-pill-btn {
    background: var(--event-card-inner);
    border: 1px solid var(--event-border);
    color: var(--event-text-sub);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.block-pill-btn:hover {
    background: #334155;
    color: #fff;
    border-color: #64748b;
}

.block-pill-btn.active {
    background: var(--accent-wine);
    color: #ffffff;
    border-color: var(--accent-wine);
    font-weight: bold;
    box-shadow: 0 0 8px rgba(172, 80, 147, 0.4);
}

.block-cutoff-badge {
    font-size: 10px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
}

/* メンバーブロックタグ（全体表示時の所属枠インジケーター・改行防止） */
.member-block-tag {
    font-size: 10px;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: normal;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ボーダー差ハイライト表示 */
.gap-cutoff-safe {
    color: #4ade80; /* 合格圏内グリーン */
    font-weight: 600;
}

.gap-cutoff-danger {
    color: #f87171; /* ボーダー下レッド */
    font-weight: 600;
}

/* ==========================================================================
   2. イベント情報・カウントダウン・KPI カード
   ========================================================================== */
.event-summary-card {
    background: var(--event-card-bg);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    padding: 18px 20px;
}

.event-title-line {
    display: flex;
    flex-wrap: nowrap; /* カウントダウンが下に落ちないよう1行に保持 */
    justify-content: space-between;
    align-items: flex-start; /* 常に右上角に位置を固定 */
    gap: 16px;
    margin-bottom: 12px;
}

/* タイトルとステータス表示エリア（伸縮可能・文字あふれ防止） */
.event-title-info {
    flex: 1 1 auto;
    min-width: 0;
}

.event-title-h1 {
    font-size: 19px;
    font-weight: 700;
    margin: 0;
    color: var(--event-text-main);
    line-height: 1.4;
    word-break: break-word;
}

.event-status-pill {
    font-size: 12px;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(13, 148, 136, 0.25);
    color: #2dd4bf;
    border: 1px solid rgba(13, 148, 136, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.event-status-pill.finished {
    background: rgba(107, 114, 128, 0.3);
    color: #cbd5e1;
    border-color: rgba(107, 114, 128, 0.5);
}

/* カウントダウン表示（右上固定・サイズ維持） */
.event-countdown-container {
    flex: 0 0 auto;
    background: var(--event-card-inner);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.countdown-digits {
    font-family: 'Courier New', Courier, monospace;
    font-size: 17px;
    font-weight: bold;
    color: var(--accent-amber);
}

.event-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 12px 0 16px 0;
}

.event-progress-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.event-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.event-kpi-item {
    background: var(--event-card-inner);
    border: 1px solid var(--event-border);
    border-radius: 5px;
    padding: 10px 14px;
}

.kpi-lbl {
    font-size: 11px;
    color: var(--event-text-sub);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.kpi-num {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
}

/* ==========================================================================
   3. 直近の配信中ルーム（Onlive）
   ========================================================================== */
.onlive-box {
    background: var(--event-card-bg);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    padding: 14px 16px;
}

/* 配信中メンバーリストコンテナ（showroom.cssの固定高さ制限を解除し全件動的表示） */
.onlive-box #live-now-list {
    max-height: none;
    overflow-y: visible;
}


.onlive-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.onlive-title {
    font-size: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--event-text-main);
}

.live-indicator {
    background: var(--accent-live);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.onlive-item-row {
    display: flex;
    align-items: center;
    background: var(--event-card-inner);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    padding: 7px 12px;
    margin-bottom: 6px;
    gap: 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.onlive-item-row:last-child {
    margin-bottom: 0;
}

.onlive-item-row:hover {
    background-color: #2b3140;
    border-color: rgba(255, 255, 255, 0.15);
}

.onlive-item-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--accent-live);
    flex-shrink: 0; /* アバター画像の縮小を防止 */
}

/* 配信中ルームメインコンテナ（上下2段の対称高効率レイアウト） */
.onlive-item-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 上段：メンバー名＆ブロック名 ＋ 今枠10分速 */
.onlive-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.onlive-title-area {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.onlive-item-name {
    font-weight: bold;
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.onlive-item-speed {
    font-size: 12px;
    color: var(--accent-amber);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

/* 下段：今枠獲得ポイント（＆テロップ） ＋ 操作ボタン群 */
.onlive-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.onlive-sub-area {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.onlive-sub-area .member-block-tag {
    margin-left: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.onlive-item-session-pt {
    font-size: 11.5px;
    color: #34d399; /* 今枠獲得ポイント（視認性の高いエメラルドグリーン） */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.onlive-metric-time {
    font-size: 10px;
    color: var(--event-text-sub);
    font-weight: normal;
    margin-left: 2px;
}

.onlive-item-telop {
    font-size: 11px;
    color: var(--event-text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.onlive-item-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

/* 直近配信中枠のギフト明細ボタン（SHOWROOMギフト調のグラデーションスタイル） */
.onlive-item-gift-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(168, 85, 247, 0.18));
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.45);
    padding: 3.5px 9px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.onlive-item-gift-btn:hover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(168, 85, 247, 0.35));
    border-color: #ec4899;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.onlive-item-gift-btn:active {
    transform: translateY(0);
}

.onlive-item-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap; /* テキストの縦並び（折り返し）を防止 */
    flex-shrink: 0;      /* ボタンスタイルの崩れ・サイズ不揃いを防止 */
    box-sizing: border-box;
}

.onlive-item-btn:hover {
    background: var(--accent-blue);
    color: #fff;
}

/* ==========================================================================
   4. 変動グラフ（横幅1300px・縦幅1000px対応）
   ========================================================================== */
.chart {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    box-sizing: border-box;
}

.chart_center {
    width: 100%;
    max-width: 1300px;
    min-width: 0; /* showroom.cssのmin-width: 350pxを無効化 */
    margin: 0 auto;
    box-sizing: border-box;
    background: var(--event-card-bg);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    padding: 14px 16px;
}

#chart_showroom_all {
    width: 100%;
    height: 700px;
    min-height: 700px;
    touch-action: pan-y; /* モバイル縦スクロール時のtouchend Intervention警告を抑止 */
}


.chart-days-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 8px 5px 12px 5px;
    height: auto;
}

/* ボタン小グループ（モバイルでの折返し対応） */
.chart-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chart-selector-divider {
    color: #64748b;
    margin: 0 4px;
    align-self: center;
}

/* ボタンの文字色と背景色を強制指定（高特異性セレクタ） */
#chart-days-selector button,
.chart-days-selector button,
button.day-selector-btn {
    height: 28px;
    padding: 0 12px;
    margin: 2px;
    border: 1px solid var(--event-border);
    background-color: #334155; /* 明確なダークグレー背景 */
    color: #f8fafc;           /* はっきりした白色テキスト */
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

#chart-days-selector button:hover,
.chart-days-selector button:hover,
button.day-selector-btn:hover {
    background-color: #475569;
    color: #ffffff;
    border-color: #64748b;
}

/* アクティブボタン */
#chart-days-selector button.active-day-btn,
.chart-days-selector button.active-day-btn,
button.day-selector-btn.active-day-btn {
    background-color: var(--accent-wine);
    color: #ffffff;
    border-color: var(--accent-wine);
    font-weight: bold;
    box-shadow: 0 0 6px rgba(172, 80, 147, 0.4);
}

.mb-mail-chat {
    background-color: transparent;
    border-radius: 8px;
    border: 1px solid var(--event-border);
    padding: 8px 6px 4px 6px;
    min-height: unset;
}

/* メインチャート用インタラクティブ凡例（Interactive Legend） */
.chart-main-legend-wrap {
    margin-top: 10px;
    background: #1c202a;
    border: 1px solid var(--event-border);
    border-radius: 6px;
    padding: 8px 10px;
    user-select: none;
}

.chart-main-legend-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.main-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #242936;
    border: 1px solid #3b4252;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11.5px;
    color: #f1f5f9;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.main-legend-item:hover {
    border-color: #60a5fa;
    background: #2d3548;
    transform: translateY(-1px);
}

.main-legend-item.is-highlighted {
    border-color: #38bdf8;
    background: #1e293b;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.main-legend-item.is-dimmed {
    opacity: 0.3;
    filter: grayscale(50%);
}

.main-legend-item.is-hidden-series {
    opacity: 0.25;
    text-decoration: line-through;
    filter: grayscale(80%);
}

.main-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.main-legend-rank {
    font-size: 10.5px;
    font-weight: bold;
    color: #94a3b8;
}

.main-legend-name {
    font-weight: 600;
    color: #ffffff;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-legend-live-tag {
    background: #ef4444;
    color: #fff;
    font-size: 8.5px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    line-height: 1.1;
}

.chart-main-legend-toggle-wrap {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: center;
}

.main-legend-more-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.main-legend-more-btn:hover {
    color: #38bdf8;
}

/* チャート下部の複数メンバー選択（マルチセレクト）ドロップダウン */
.chart-multiselect-wrap {
    margin-top: 10px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    position: relative;
    user-select: none;
}

.chart-multiselect-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
}

.chart-multiselect-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
    padding: 0 12px;
    background: #1e293b;
    border: 1px solid var(--event-border);
    border-radius: 4px;
    color: #f8fafc;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.chart-multiselect-toggle-btn:hover {
    background: #273549;
    border-color: #64748b;
}

.chart-multiselect-toggle-btn.is-custom {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.15);
}

.multiselect-toggle-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multiselect-chevron {
    color: #94a3b8;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.multiselect-chevron.open {
    transform: rotate(180deg);
}

.chart-multiselect-reset-btn {
    height: 36px;
    padding: 0 12px;
    background-color: #334155;
    color: #cbd5e1;
    border: 1px solid var(--event-border);
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.chart-multiselect-reset-btn:hover {
    background-color: #475569;
    color: #ffffff;
}

.chart-multiselect-reset-btn.active {
    background-color: rgba(59, 130, 246, 0.25);
    border-color: var(--accent-blue);
    color: #60a5fa;
    font-weight: bold;
}

/* 展開されるマルチセレクトパネル */
.chart-multiselect-panel {
    border-top: 1px solid var(--event-border);
    padding: 10px 12px;
    background: #18202f;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    animation: fadeInPanel 0.15s ease-out;
}

@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.multiselect-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.multiselect-actions-title {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
}

.multiselect-quick-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ms-quick-btn {
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
    background: #242f42;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ms-quick-btn:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

/* チェックボックスリストコンテナ */
.chart-member-checkbox-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}

.chart-member-checkbox-list::-webkit-scrollbar {
    width: 6px;
}
.chart-member-checkbox-list::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

/* 単一メンバーチェック項目（幅広タッチターゲット） */
.member-check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.member-check-item:hover {
    background: rgba(51, 65, 85, 0.8);
}

.member-check-item.is-selected {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.4);
}

.member-check-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    flex: 1;
}

.member-check-box {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
    flex-shrink: 0;
}

.member-check-rank {
    font-size: 11px;
    font-weight: bold;
    color: #94a3b8;
    min-width: 24px;
    flex-shrink: 0;
}

.member-check-name {
    font-size: 13px;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-check-right {
    font-size: 11.5px;
    color: var(--accent-gold);
    font-weight: bold;
    white-space: nowrap;
    margin-left: 8px;
    flex-shrink: 0;
}

/* パネルフッター */
.multiselect-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.multiselect-count-badge {
    font-size: 11.5px;
    color: #94a3b8;
}

.multiselect-close-btn {
    height: 28px;
    padding: 0 14px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s ease;
}

.multiselect-close-btn:hover {
    background: #2563eb;
}

/* ==========================================================================
   5. リアルタイム順位＆ギャップ分析ボード
   ========================================================================== */
.event-ranking-card {
    background: var(--event-card-bg);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    padding: 16px 20px;
}

/* モバイル用スワイプヒント（PCでは非表示） */
.mobile-scroll-hint {
    display: none;
}

.ranking-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
    padding-bottom: 6px;
}

/* スクロールバーのカスタマイズ */
.ranking-table-responsive::-webkit-scrollbar {
    height: 6px;
}

.ranking-table-responsive::-webkit-scrollbar-track {
    background: #1c202a;
    border-radius: 3px;
}

.ranking-table-responsive::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.ranking-table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--accent-wine);
}

.event-table {
    width: 100%;
    min-width: 640px; /* モバイル端末での文字折れ・圧迫崩れを防止 */
    border-collapse: separate;
    border-spacing: 0 4px;
    font-size: 13px;
}

.event-table th,
.event-table td {
    white-space: nowrap; /* メンバー名等の縦折れ（1文字ずつ改行）を根絶 */
}

.event-table th {
    padding: 8px 10px;
    color: var(--event-text-sub);
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--event-border);
    text-align: left;
}

.event-table td {
    padding: 10px;
    background: var(--event-card-inner);
    border-top: 1px solid var(--event-border);
    border-bottom: 1px solid var(--event-border);
    color: var(--event-text-main);
}

.event-table td:first-child {
    border-left: 1px solid var(--event-border);
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.event-table td:last-child {
    border-right: 1px solid var(--event-border);
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.event-table tr:hover td {
    background: #2b3140;
}

/* メダルバッジ */
.rank-badge-box {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    background: #334155;
    color: #e2e8f0;
}

.rank-1-badge {
    background: #854d0e;
    color: #fef08a;
    border: 1px solid #ca8a04;
}

.rank-2-badge {
    background: #475569;
    color: #f8fafc;
    border: 1px solid #94a3b8;
}

.rank-3-badge {
    background: #7c2d12;
    color: #fed7aa;
    border: 1px solid #ea580c;
}

.member-flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

.member-thumb {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--event-border);
}

.member-thumb.live-on {
    border-color: var(--accent-live);
}

/* 本日の累計配信時間バッジ（メンバー名下部に表示） */
.member-today-live {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--event-text-muted);
    margin-top: 3px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.member-today-live i {
    font-size: 10px;
    color: #60a5fa; /* 時計アイコン */
}

/* 既に配信実績がある場合 */
.member-today-live.has-live {
    color: var(--event-text-sub);
}

/* 現在配信中の場合（グリーン表示） */
.member-today-live.is-onlive {
    color: #4ade80;
    font-weight: 500;
}

.member-today-live.is-onlive i {
    color: #22c55e;
    animation: pulse 1.5s infinite;
}

/* ポイントセルおよび数値・バッジコンテナ（垂直同期レイアウト） */
.point-cell {
    text-align: right;
    white-space: nowrap;
}

.point-cell-box {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
}

.point-text {
    font-weight: bold;
    color: #ffffff;
    font-size: 14px;
    font-variant-numeric: tabular-nums; /* 数字の桁揃えを完全に同期 */
    text-align: right;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.point-badge-wrap {
    width: 142px; /* バッジ列の開始基準位置を垂直に完全同期 */
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
    flex-shrink: 0;
}

.gap-text {
    color: var(--event-text-sub);
    font-size: 12px;
}

.gap-first-highlight {
    color: var(--accent-amber);
    font-weight: 600;
}

.speed-text {
    color: #38bdf8;
    font-size: 12px;
}

/* 通過ボーダー区切りライン（上位名次の境界線） */
.border-divider-row td {
    background: transparent;
    border: none;
    padding: 8px 0;
}

.border-divider-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 4px 0;
}

.border-divider-content::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: repeating-linear-gradient(90deg, #f59e0b, #f59e0b 6px, transparent 6px, transparent 12px);
    z-index: 1;
}

.border-divider-badge {
    position: relative;
    z-index: 2;
    background: #1c202a;
    border: 1px solid #f59e0b;
    color: #fbbf24;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 14px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

/* ボーダー差タグ（ポイント欄の安全圏・不足差表示：固定ピルスタイル） */
.member-border-tag,
.member-cutoff-tag.danger {
    font-size: 10.5px;
    font-weight: 600;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.2;
    white-space: nowrap;
    width: 100%; /* ピルの横幅を枠いっぱいに統一し左右の境界線を整列 */
    box-sizing: border-box;
    font-variant-numeric: tabular-nums;
}

.member-border-tag i,
.member-cutoff-tag.danger i {
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}

.member-border-tag.safe {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.member-cutoff-tag.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-action-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-open-contrib {
    background: #334155;
    border: 1px solid var(--event-border);
    color: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-open-contrib:hover {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
}

.btn-open-live {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.btn-open-live:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

/* ==========================================================================
   6. ファン貢献度モーダル (Top 100) & 配信履歴モーダル
   ========================================================================== */
.contrib-modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.contrib-modal-mask.open {
    display: flex;
}

.contrib-modal-panel {
    background: var(--event-card-bg);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* 配信履歴パネル専用サイズ拡張 */
.contrib-modal-panel.live-history-panel {
    max-width: 680px;
}

.contrib-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--event-border);
}

.contrib-modal-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--event-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.contrib-modal-close {
    background: transparent;
    border: none;
    color: var(--event-text-sub);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.contrib-modal-close:hover {
    color: #fff;
}

.contrib-modal-body {
    padding: 14px 18px;
    overflow-y: auto;
}

.contrib-list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contrib-single-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--event-card-inner);
    border: 1px solid var(--event-border);
    border-radius: 4px;
    padding: 6px 12px;
}

.contrib-user-flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contrib-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* ==========================================================================
   6.1 配信履歴モーダル専用スタイル (Live History Components)
   ========================================================================== */
.live-history-summary-box {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: var(--event-card-inner);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.live-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.live-summary-lbl {
    font-size: 11px;
    color: var(--event-text-muted);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-summary-val {
    font-size: 13.5px;
    font-weight: bold;
    color: #fff;
}

.live-summary-val.highlight {
    color: #38bdf8;
}

.live-summary-val.speed {
    color: var(--accent-amber);
}

.live-history-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 単一配信枠カード */
.live-history-card {
    background: var(--event-card-inner);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s, transform 0.15s;
}

.live-history-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
}

.live-history-card.is-live {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.04);
}

.live-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 6px;
    column-gap: 8px;
    font-size: 12.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 6px;
}

.live-card-time,
.live-card-time-group {
    color: #e2e8f0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.live-card-period {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
}

.live-badge-duration {
    background: #334155;
    color: #cbd5e1;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.live-card-status,
.live-card-status-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.live-status-ended {
    font-size: 11px;
    color: var(--event-text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.live-on-badge {
    background: #ef4444;
    color: #fff;
    font-size: 10.5px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 4px;
    animation: live-pulse 1.8s infinite;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.live-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: center;
}

.live-gain-box {
    display: flex;
    flex-direction: column;
}

.live-gain-label {
    font-size: 11px;
    color: var(--event-text-muted);
}

.live-gain-val {
    font-size: 16px;
    font-weight: bold;
    color: #22c55e;
}

.live-speed-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.live-speed-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.live-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 11px;
    color: var(--event-text-sub);
    background: rgba(0, 0, 0, 0.15);
    padding: 5px 8px;
    border-radius: 4px;
}

.live-telop-text {
    font-size: 11px;
    color: var(--event-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   6.5 配信枠ギフト明細モーダル & 投げギフトボタンスタイル
   日本語コメント規約準拠 / UTF-8
   -------------------------------------------------------------------------- */

/* 配信履歴カード内のギフト明細ボタンスタイル */
.btn-live-gift {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(168, 85, 247, 0.18));
    border: 1px solid rgba(236, 72, 153, 0.45);
    color: #f472b6;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-live-gift:hover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(168, 85, 247, 0.35));
    border-color: #ec4899;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

/* ギフト詳細モーダルマスク（履歴モーダルよりも上位のレイヤー） */
.contrib-modal-mask.live-gift-modal-mask {
    z-index: 2050;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
}

/* ギフト詳細モーダルパネル（PCデスクトップ表示時に視認性を向上させるため横幅・高さを拡張） */
.contrib-modal-panel.live-gift-panel {
    width: 94%;
    max-width: 980px;
    height: 90vh;
    max-height: 880px;
    background: #0f172a;
    border: 1px solid #334155;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

@media (min-width: 1440px) {
    /* ワイドディスプレイ向け最適化 */
    .contrib-modal-panel.live-gift-panel {
        max-width: 1040px;
    }
}

/* データ欠落の可能性に関する注意事項・免責バナー */
.live-gift-notice-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 12px;
    color: #fbbf24;
    font-size: 12px;
    line-height: 1.5;
}

.live-gift-notice-banner i {
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.live-gift-notice-banner .notice-text {
    flex: 1;
}

.live-gift-notice-banner strong {
    color: #fef08a;
}

/* 配信枠サマリー＆KPI情報カード */
.live-gift-summary-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.live-gift-info-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gift-member-tag {
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
}

.gift-time-tag {
    font-size: 12px;
    color: var(--event-text-sub);
}

/* LIVE配信中自動更新バッジ */
.gift-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
}

.gift-live-badge .auto-refresh-text {
    font-size: 10px;
    color: #fca5a5;
    font-weight: 500;
}

/* LIVEパルス点滅ドット */
.live-dot-pulse {
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: livePulseAnim 1.8s infinite;
}

@keyframes livePulseAnim {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* 最終更新時刻表示 */
.gift-updated-time {
    font-size: 11px;
    color: var(--event-text-muted);
    margin-left: auto;
}

/* 手動更新ボタン */
.gift-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--event-text-sub);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.gift-refresh-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #38bdf8;
}

.gift-refresh-btn.rotating i {
    animation: giftSpinAnim 0.8s linear infinite;
}

@keyframes giftSpinAnim {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.live-gift-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.live-gift-kpi-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 6px 10px;
    text-align: center;
}

.gift-kpi-lbl {
    font-size: 10.5px;
    color: var(--event-text-muted);
    margin-bottom: 2px;
}

.gift-kpi-val {
    font-size: 14px;
    font-weight: 700;
    color: #38bdf8;
}

.gift-kpi-val.ratio {
    font-size: 12.5px;
    color: #f472b6;
}

/* ツールバー（タブ切替とユーザー検索） */
.live-gift-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.live-gift-tabs {
    display: flex;
    gap: 6px;
}

.gift-tab-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.gift-tab-btn:hover {
    color: #f1f5f9;
    border-color: #475569;
}

.gift-tab-btn.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #fff;
    font-weight: 700;
}

.gift-search-wrap {
    position: relative;
    width: 200px;
    max-width: 45%;
}

.gift-search-wrap i {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #64748b;
}

.gift-search-wrap input {
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 5px 8px 5px 26px;
    font-size: 12px;
    color: #f1f5f9;
    outline: none;
    transition: border-color 0.2s ease;
}

.gift-search-wrap input:focus {
    border-color: #38bdf8;
}

/* ギフトコンテンツコンテナ（スクロール可能） */
.live-gift-content-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

/* ユーザー別カード */
.gift-user-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 10px 12px;
    transition: border-color 0.2s, background 0.2s;
}

.gift-user-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(30, 41, 59, 0.8);
}

.gift-user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.gift-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

/* 順位バッジ */
.gift-user-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    background: #334155;
    color: #cbd5e1;
    flex-shrink: 0;
}

.gift-user-rank.rank-1 {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: #000;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.5);
}

.gift-user-rank.rank-2 {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #000;
}

.gift-user-rank.rank-3 {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
}

.gift-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.gift-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gift-user-point-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
    flex-shrink: 0;
}

.gift-user-total-pt {
    font-size: 14px;
    font-weight: 700;
    color: #f59e0b;
}

.gift-toggle-icon {
    font-size: 12px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.gift-user-card.expanded .gift-toggle-icon {
    transform: rotate(180deg);
}

/* ユーザーが投げたギフト詳細リスト（アコーディオン） */
.gift-user-details {
    display: none;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.gift-user-card.expanded .gift-user-details {
    display: block;
}

.gift-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gift-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11.5px;
}

.gift-chip.paid {
    border-color: rgba(236, 72, 153, 0.35);
    background: rgba(236, 72, 153, 0.08);
}

.gift-chip-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.gift-chip-name {
    color: #cbd5e1;
}

.gift-chip-count {
    font-weight: 700;
    color: #fff;
}

.gift-chip-pt {
    color: #fbbf24;
    font-size: 11px;
}

/* ギフト種別集計テーブル */
.gift-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    table-layout: auto;
}

.gift-summary-table th {
    background: #1e293b;
    color: #94a3b8;
    text-align: left;
    padding: 8px 8px;
    font-weight: 600;
    border-bottom: 1px solid #334155;
    white-space: nowrap;
}

.gift-summary-table td {
    padding: 7px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    vertical-align: middle;
}

.gift-summary-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* 区分列の固定幅・中央配置設定（文字の縦折れ・崩れを防止） */
.gift-summary-table th.col-type,
.gift-summary-table td.col-type {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    text-align: center;
    padding: 6px 2px;
}

.gift-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: 44px;
    height: 22px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1;
    box-sizing: border-box;
    text-align: center;
}

.gift-type-pill.paid {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.5);
}

.gift-type-pill.free {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.5);
}

/* ギフト名・アイコンのフレックス整列 */
.gift-name-flex {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.gift-name-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.gift-name-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gift-name-label {
    font-weight: 700;
    color: #fff;
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gift-name-unit {
    font-size: 11px;
    color: var(--event-text-muted);
    margin-top: 1px;
}

/* ==========================================================================
   7. レスポンシブ対応・モバイル端末向けレイアウト最適化 (Mobile Layout)
   768px以下のスマートフォンおよびタブレット表示の徹底改善
   日本語コメント規約準拠
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* ナビゲーションタブの調整 */
    .tag-navigation {
        width: 100%;
        margin: 10px auto 6px auto;
        padding: 0 4px;
    }

    .tag {
        gap: 5px;
        margin-bottom: 6px;
    }

    .tagblock {
        padding: 6px 12px;
        font-size: 13px;
        margin: 2px;
        min-width: auto;
        border-radius: 20px;
    }

    /* メインラッパー余白の最適化 */
    .event-main-wrapper {
        padding: 0 8px;
        gap: 10px;
        margin-bottom: 30px;
    }

    /* 1. イベントセレクター */
    .event-select-card {
        padding: 10px 12px;
    }

    .event-dropdown-select {
        height: 36px;
        font-size: 13px;
    }

    .event-select-row {
        gap: 6px;
    }

    .event-select-main,
    .event-select-block {
        flex: 1 1 100%;
    }

    .block-pills-bar {
        gap: 4px;
        margin-top: 8px;
        padding-top: 6px;
    }

    .block-pill-btn {
        padding: 3px 9px;
        font-size: 11px;
    }

    /* 2. イベント概要カード */
    .event-summary-card {
        padding: 12px 14px;
    }

    .event-title-line {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 6px;
    }

    .event-title-h1 {
        font-size: 16px;
        line-height: 1.35;
    }

    /* カウントダウンと総合戦報ボタンを同一行に配置 */
    .event-title-actions {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin-top: 2px;
    }

    .event-countdown-container {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        justify-content: space-between;
        padding: 6px 10px;
        box-sizing: border-box;
    }

    .countdown-digits {
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .event-sns-share-btn {
        flex: 0 0 auto;
        height: 34px;
        padding: 0 10px;
        font-size: 11.5px;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    /* KPIグリッド：スマートフォン画面では綺麗な2x2グリッドに配置 */
    .event-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .event-kpi-item {
        padding: 8px 10px;
    }

    .kpi-lbl {
        font-size: 10.5px;
    }

    .kpi-num {
        font-size: 16px;
    }

    /* 3. 配信中ルームリスト */
    .onlive-box {
        padding: 10px 12px;
    }

    .onlive-item-row {
        padding: 6px 10px;
        gap: 8px;
    }

    .onlive-item-avatar {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
    }

    .onlive-item-main {
        gap: 3px;
    }

    .onlive-item-name {
        font-size: 12px;
    }

    .onlive-item-speed {
        font-size: 11px;
    }

    .onlive-item-session-pt {
        font-size: 10.5px;
    }

    .onlive-metric-time {
        font-size: 9.5px;
    }

    .onlive-item-telop {
        font-size: 10px;
    }

    .onlive-item-actions {
        gap: 4px;
        flex-shrink: 0;
    }

    .onlive-item-gift-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 7px;
        height: 25px;
        font-size: 10.5px;
        gap: 3px;
        white-space: nowrap;
        flex-shrink: 0;
        box-sizing: border-box;
    }

    .onlive-item-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
        height: 25px;
        min-width: 40px;
        font-size: 10.5px;
        white-space: nowrap;
        flex-shrink: 0;
        box-sizing: border-box;
    }

    /* 4. チャートセクションと操作ボタン */
    .chart_center {
        padding: 8px;
    }

    /* チャートヘッダーのモバイル最適化（1行での整列・折り返し防止） */
    .chart-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
        margin: 0 2px 6px 2px;
    }

    .chart-title {
        font-size: 13.5px;
        white-space: nowrap;
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }

    .chart-header-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 0 0 auto;
    }

    .chart-update-time {
        font-size: 11px;
        color: var(--event-text-sub);
        white-space: nowrap;
        margin: 0;
    }

    .chart-sns-share-mini-btn,
    .ranking-sns-share-mini-btn {
        height: 27px;
        padding: 0 8px;
        font-size: 11px;
        white-space: nowrap;
        flex-shrink: 0;
        gap: 4px;
    }

    .chart-days-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin: 6px 2px 10px 2px;
    }

    .chart-btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        width: 100%;
    }

    .chart-selector-divider {
        display: none; /* スマホでは上下2段構成のため区切り線を非表示 */
    }

    #chart-days-selector button,
    .chart-days-selector button,
    button.day-selector-btn {
        height: 27px;
        padding: 0 10px;
        font-size: 12px;
        margin: 1px;
    }

    #chart_showroom_all {
        height: 450px; /* スマホ向け高さを拡張 */
        min-height: 450px;
    }

    /* メインチャート用インタラクティブ凡例のスマホ表示最適化 */
    .chart-main-legend-wrap {
        padding: 8px 10px;
    }
    .chart-main-legend-list {
        gap: 5px 6px;
    }
    .main-legend-item {
        padding: 5px 8px; /* タップしやすいサイズに調整 */
        font-size: 11px;
    }
    .main-legend-name {
        max-width: 105px;
    }

    /* チャート下部メンバーマルチセレクトのスマホ表示最適化 */
    .chart-multiselect-toggle-btn {
        height: 40px; /* タップしやすい高さ */
        font-size: 13px;
    }
    .chart-multiselect-reset-btn {
        height: 40px;
        padding: 0 14px;
        font-size: 13px;
    }
    .member-check-item {
        padding: 8px 8px; /* スマホでの誤タップ防止 */
    }
    .member-check-box {
        width: 18px;
        height: 18px;
    }
    .chart-member-checkbox-list {
        max-height: 220px;
    }

    /* 5. ランキングテーブル */
    .event-ranking-card {
        padding: 12px 10px;
    }

    .event-ranking-card .event-title-line {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
        margin-bottom: 8px;
    }

    .mobile-scroll-hint {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        color: var(--accent-amber);
        background: rgba(245, 158, 11, 0.15);
        border: 1px solid rgba(245, 158, 11, 0.3);
        padding: 2px 8px;
        border-radius: 12px;
    }

    .event-table th {
        padding: 6px 8px;
        font-size: 11.5px;
    }

    .event-table td {
        padding: 8px 6px;
        font-size: 12.5px;
    }

    .rank-badge-box {
        width: 22px;
        height: 22px;
        font-size: 11.5px;
    }

    .member-thumb {
        width: 28px;
        height: 28px;
    }

    .point-text {
        font-size: 13px;
    }

    /* スマホ画面向けのバッジ幅およびパディング調整 */
    .point-badge-wrap {
        width: 130px;
    }

    .member-border-tag,
    .member-cutoff-tag.danger {
        font-size: 10px;
        padding: 1.5px 5px;
    }

    .gap-text,
    .speed-text {
        font-size: 11.5px;
    }

    .btn-action-group {
        gap: 3px;
    }

    .btn-open-contrib,
    .btn-open-live {
        padding: 3px 6px;
        font-size: 10.5px;
    }

    /* 6. ファン貢献度・配信履歴モーダル */
    .contrib-modal-panel {
        max-width: 96%;
        max-height: 88vh;
        margin: 6px;
    }

    .contrib-modal-panel.live-history-panel {
        width: 96%;
        max-width: 580px;
        max-height: 90vh;
        border-radius: 8px;
        margin: auto;
    }

    .contrib-modal-header {
        padding: 10px 12px;
        align-items: flex-start;
        gap: 8px;
    }

    .contrib-modal-title {
        font-size: 13.5px;
        line-height: 1.4;
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }

    .contrib-modal-close {
        padding: 0 4px;
        font-size: 22px;
        flex-shrink: 0;
        margin-top: -3px;
    }

    .contrib-modal-body {
        padding: 8px 10px;
    }

    .live-history-summary-box {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 8px 10px;
        margin-bottom: 10px;
    }

    .live-summary-lbl {
        font-size: 10.5px;
        margin-bottom: 2px;
        gap: 3px;
    }

    .live-summary-val {
        font-size: 12.5px;
    }

    /* 配信履歴カードのモバイル最適化 */
    .live-history-card {
        padding: 9px 11px;
        gap: 7px;
    }

    .live-card-header {
        font-size: 12px;
        padding-bottom: 5px;
        row-gap: 5px;
        column-gap: 6px;
    }

    .live-card-period {
        font-size: 12px;
    }

    .live-badge-duration {
        font-size: 10px;
        padding: 1.5px 5.5px;
    }

    .btn-live-gift {
        font-size: 10.5px;
        padding: 2.5px 7px;
    }

    .live-status-ended {
        font-size: 10px;
        padding: 1px 5px;
    }

    .live-gain-val {
        font-size: 14.5px;
    }

    .live-speed-badge {
        font-size: 11px;
        padding: 2.5px 6px;
    }

    .live-card-footer {
        font-size: 10.5px;
        padding: 4px 6px;
    }

    /* 配信枠ギフト明細モーダルのモバイル対応 */
    .contrib-modal-panel.live-gift-panel {
        width: 96%;
        max-width: 580px;
        height: 90vh;
        max-height: 90vh;
        border-radius: 8px;
        margin: auto;
    }

    /* 配信枠ギフト明細モーダルのモバイル対応：PC版と同様にモーダル全体（ヘッダー以下）を一括スクロール可能にする */
    .contrib-modal-panel.live-gift-panel .contrib-modal-body {
        padding: 8px 10px;
        display: block;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1 1 auto;
        min-height: 0;
    }

    /* 内部コンテンツコンテナの個別スクロールを解除し、親ボディ全体でスクロール */
    .contrib-modal-panel.live-gift-panel .live-gift-content-container {
        overflow-y: visible;
        flex: none;
        height: auto;
        padding-right: 0;
    }

    /* 注意事項バナーのモバイル縮小 */
    .live-gift-notice-banner {
        padding: 6px 10px;
        font-size: 11px;
        line-height: 1.4;
        margin-bottom: 6px;
        gap: 7px;
    }

    .live-gift-notice-banner i {
        font-size: 13px;
        margin-top: 2px;
    }

    /* サマリー・KPIカードのモバイル最適化 */
    .live-gift-summary-card {
        padding: 8px 10px;
        margin-bottom: 6px;
    }

    .live-gift-info-bar {
        margin-bottom: 6px;
        padding-bottom: 4px;
        gap: 6px;
    }

    .gift-member-tag {
        font-size: 13px;
    }

    .gift-time-tag {
        font-size: 11px;
    }

    .live-gift-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .live-gift-kpi-item {
        padding: 5px 6px;
    }

    .gift-kpi-lbl {
        font-size: 10px;
        margin-bottom: 1px;
    }

    .gift-kpi-val {
        font-size: 13.5px;
    }

    .gift-kpi-val.ratio {
        font-size: 12px;
    }

    /* ツールバー（タブと検索バーの左右・上下整列） */
    .live-gift-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-bottom: 6px;
    }

    .live-gift-tabs {
        display: flex;
        width: 100%;
        gap: 6px;
    }

    .gift-tab-btn {
        flex: 1 1 50%;
        justify-content: center;
        padding: 5px 8px;
        height: 32px;
        font-size: 11.5px;
        box-sizing: border-box;
    }

    .gift-search-wrap {
        width: 100%;
        max-width: 100%;
    }

    .gift-search-wrap input {
        height: 32px;
        padding: 4px 8px 4px 26px;
        font-size: 11.5px;
    }

    /* ユーザー別カードのモバイル最適化 */
    .gift-user-card {
        padding: 8px 10px;
    }

    .gift-user-info {
        gap: 8px;
        min-width: 0;
    }

    .gift-user-rank {
        width: 22px;
        height: 22px;
        font-size: 10.5px;
    }

    .gift-user-avatar {
        width: 28px;
        height: 28px;
    }

    .gift-user-name {
        font-size: 12px;
        max-width: 130px;
    }

    .gift-user-total-pt {
        font-size: 13px;
    }

    .gift-chips-grid {
        gap: 4px;
    }

    .gift-chip {
        padding: 2px 6px;
        font-size: 10.5px;
        gap: 4px;
    }

    .gift-chip-img {
        width: 15px;
        height: 15px;
    }

    /* ギフト種別集計テーブルのモバイル最適化 */
    .gift-summary-table {
        font-size: 11.5px;
    }

    .gift-summary-table th,
    .gift-summary-table td {
        padding: 6px 4px;
    }

    .gift-summary-table th.col-type,
    .gift-summary-table td.col-type {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
        padding: 5px 1px;
    }

    .gift-type-pill {
        width: 38px;
        height: 20px;
        font-size: 10px;
        padding: 0;
    }

    .gift-name-flex {
        gap: 6px;
    }

    .gift-name-icon {
        width: 20px;
        height: 20px;
    }

    .gift-name-label {
        font-size: 11.5px;
        max-width: 140px;
    }

    .gift-name-unit {
        font-size: 10px;
    }

    /* 画面幅540px以下では割合列を非表示にしてスペースを確保 */
    @media screen and (max-width: 540px) {
        .gift-summary-table th.col-ratio,
        .gift-summary-table td.col-ratio {
            display: none;
        }
    }
}

/* 400px以下の極小画面デバイス（iPhone SEなど）への微調整 */
@media screen and (max-width: 400px) {
    .tagblock {
        padding: 5px 9px;
        font-size: 12px;
    }

    #chart-days-selector button,
    .chart-days-selector button,
    button.day-selector-btn {
        padding: 0 7px;
        font-size: 11px;
    }

    .kpi-num {
        font-size: 14.5px;
    }

    /* 極小画面用配信履歴カード微調整 */
    .live-card-period {
        font-size: 11.5px;
    }

    .live-badge-duration {
        font-size: 9.5px;
        padding: 1px 4.5px;
    }

    .btn-live-gift {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* 極小画面用配信中ルームのギフト明細ボタン調整 */
    .onlive-item-gift-btn {
        font-size: 10px;
        padding: 0 6px;
    }
}

/* フッターのアイコンを1300pxカード枠と左端整列 */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #888;
    color: #fff;
    width: 100%;
    height: 50px;
    margin: 20px 0 0 0;
    box-sizing: border-box;
}

.footer .header {
    background: transparent;
    margin: 0;
    height: 100%;
    width: 100%;
}

.footer .icon {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 8px;
    box-sizing: border-box;
    font-size: 18px;
}

.footer .icon a {
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.footer .icon-space {
    width: 15px;
}

.footer .icon .mail-icon:before {
    content: "\f0e0";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    color: #fff;
}

.footer .icon .fa-x-twitter,
.footer .icon .card-icon,
.footer .icon .fa-twitter {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    color: #fff;
}

/* ==========================================================================
   SNS戦報画像生成・共有機能用 スタイルシート (日本語コメント規約準拠)
   ========================================================================== */

/* 1. トリガーボタン（イベント概要・グラフ・順位表の各ヘッダー配置） */
.event-title-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.event-sns-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.event-sns-share-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.45);
}

.chart-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-sns-share-mini-btn,
.ranking-sns-share-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-sns-share-mini-btn:hover,
.ranking-sns-share-mini-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    color: #ffffff;
    border-color: #60a5fa;
}

/* 2. モーダルパネルの拡張（横幅920px対応） */
.sns-share-modal-panel {
    max-width: 920px;
    width: 96%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* ツールバー（表示範囲・グラフ切替） */
.sns-share-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    background: var(--event-card-inner);
    border: 1px solid var(--event-border);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.sns-share-ctrl-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sns-share-ctrl-group .ctrl-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--event-text-sub);
}

.sns-btn-toggle {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--event-border);
    border-radius: 6px;
    overflow: hidden;
}

.sns-toggle-btn {
    background: transparent;
    border: none;
    color: var(--event-text-muted);
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sns-toggle-btn.active {
    background: var(--accent-blue);
    color: #ffffff;
    font-weight: bold;
}

.sns-toggle-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--event-text-main);
}

/* アクションボタン（共有・コピー・ダウンロード） */
.sns-action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.sns-act-btn {
    flex: 1 1 auto;
    min-width: 140px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.sns-act-btn.btn-share {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff;
}

.sns-act-btn.btn-share:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    transform: translateY(-1px);
}

.sns-act-btn.btn-copy {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #ffffff;
}

.sns-act-btn.btn-copy:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    #sns-preview-btn-share,
    #sns-preview-btn-copy {
        display: none;
    }
    #sns-preview-btn-download {
        width: 100%;
        flex: 1 1 100%;
    }
}

.sns-act-btn.btn-download {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
}

.sns-act-btn.btn-download:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}

.sns-act-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* 状態メッセージ */
.sns-status-message {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 500;
}

.sns-status-message.info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sns-status-message.success {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.sns-status-message.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sns-status-message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 3. プレビュー用スクロール領域 */
.sns-preview-scroll-wrap {
    background: #0b0d13;
    border: 1px solid var(--event-border);
    border-radius: 8px;
    padding: 14px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 58vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    scrollbar-width: thin;
    scrollbar-color: #334155 #0b0d13;
}

/* プレビュー領域のスクロールバースタイル（ダークテーマ調和） */
.sns-preview-scroll-wrap::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.sns-preview-scroll-wrap::-webkit-scrollbar-track {
    background: #0b0d13;
}
.sns-preview-scroll-wrap::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}
.sns-preview-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* 4. 出力対象となるSNS戦報カード（レンダリング用DOM、固定幅820px） */
.sns-card-export {
    width: 820px;
    min-width: 820px;
    max-width: 820px;
    background: #141721;
    border: 1px solid #3b4252;
    border-radius: 10px;
    padding: 20px 24px;
    box-sizing: border-box;
    color: #f8fafc;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

/* カードヘッダー */
.sns-card-header {
    border-bottom: 2px solid #2d3748;
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.sns-card-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.brand-badge {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.brand-sub {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.sns-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 4px 0 10px 0;
    line-height: 1.35;
}

.sns-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: #cbd5e1;
}

.sns-meta-pill {
    background: #2563eb;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
}

/* グラフエリア */
.sns-card-chart-wrap {
    background: #1c202a;
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 18px;
}

.sns-card-chart-title {
    font-size: 13px;
    font-weight: bold;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sns-card-chart-container {
    width: 100%;
    min-height: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.sns-card-chart-container svg {
    max-width: 100%;
    height: auto;
}

/* グラフ凡例コンテナ（グラフ単体・総合出力時に下部に配置） */
.sns-card-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #2d3748;
}

.sns-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #242936;
    border: 1px solid #3b4252;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    color: #f1f5f9;
}

.sns-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sns-legend-rank {
    font-size: 10px;
    color: #94a3b8;
    font-weight: bold;
}

.sns-legend-name {
    font-weight: 600;
    color: #ffffff;
}

/* ランキングエリア */
.sns-card-ranking-wrap {
    background: #1c202a;
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

.sns-card-ranking-title {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.sns-card-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sns-card-table thead th {
    background: #242936;
    color: #94a3b8;
    font-weight: 600;
    padding: 7px 10px;
    border-bottom: 1px solid #3b4252;
    font-size: 12px;
}

.sns-card-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sns-card-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.sns-card-table tbody td {
    padding: 8px 10px;
    color: #f1f5f9;
}

/* 順位バッジ（金銀銅） */
.sns-rank-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
}

.sns-rank-1 {
    background: linear-gradient(135deg, #ffd700, #b45309);
    color: #000;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.sns-rank-2 {
    background: linear-gradient(135deg, #e2e8f0, #64748b);
    color: #000;
}

.sns-rank-3 {
    background: linear-gradient(135deg, #fdba74, #9a3412);
    color: #fff;
}

.sns-rank-other {
    background: #2d3748;
    color: #94a3b8;
}

.sns-live-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: bold;
    margin-left: 6px;
}

/* フッター */
.sns-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #2d3748;
    padding-top: 12px;
    font-size: 11px;
    color: #94a3b8;
}

.sns-footer-url {
    font-weight: 500;
    color: #60a5fa;
}

.sns-footer-tags {
    color: #64748b;
}

/* モバイル表示時のレスポンシブ最適化 */
@media (max-width: 768px) {
    .sns-preview-scroll-wrap {
        justify-content: flex-start;
        padding: 8px;
    }
}

/* ==========================================================================
   全プラットフォーム対応 画像共有・保存プレビューモーダルスタイル
   日本語コメント規約準拠 / UTF-8
   ========================================================================== */

.sns-preview-modal-panel {
    max-width: 600px;
    width: 94%;
    background: #141721;
    border: 1px solid #3b4252;
    border-radius: 12px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75);
    overflow: hidden;
}

.sns-preview-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 85vh;
    overflow-y: auto;
}

/* プラットフォーム操作ガイドボックス */
.sns-preview-guide-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 8px;
    padding: 12px 14px;
    color: #93c5fd;
    font-size: 13px;
    line-height: 1.45;
}

.sns-preview-guide-box i {
    font-size: 22px;
    color: #60a5fa;
    flex-shrink: 0;
    animation: bouncePointer 1.8s infinite;
}

@keyframes bouncePointer {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.sns-preview-guide-box strong {
    color: #ffffff;
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}

.sns-preview-guide-box p {
    margin: 0;
    font-size: 12px;
    color: #cbd5e1;
}

/* 画像プレビュー表示領域 */
.sns-preview-img-container {
    width: 100%;
    background: #0b0d13;
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 6px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.sns-preview-image {
    width: 100%;
    height: auto;
    max-height: 52vh;
    object-fit: contain;
    border-radius: 6px;
    user-select: auto; /* スマホ長押しメニューおよびPC右クリックを許可 */
    -webkit-user-select: auto;
    -webkit-touch-callout: default; /* Safariの長押しメニューを明示的に有効化 */
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* アクションボタングループ（全デバイス対応フレキシブルグリッド） */
.sns-preview-action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.sns-preview-action-btns .sns-act-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
    text-align: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    padding: 9px 12px;
}
