/* ==========================================================
   chart.css — チャートタブ・監視モニターの見た目
   ========================================================== */
.chart-top-bar {
    display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-shrink: 0; justify-content: space-between;
}
.chart-pair-select {
    width: 95px; max-width: 105px;
    background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-glass);
    color: var(--text-main); padding: 5px 6px; border-radius: 10px; font-size: 0.72rem; font-weight: 600;
    backdrop-filter: blur(10px); outline: none; flex-shrink: 0;
}
.chart-btn {
    background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-glass);
    color: var(--text-main); padding: 5px 8px; border-radius: 10px; font-size: 0.72rem; font-weight: 600;
    backdrop-filter: blur(10px); outline: none;
}
.chart-tf-group { display: flex; gap: 4px; flex: 1; justify-content: flex-end; }
.chart-btn.active {
    background: #ffffff; color: #000000; font-weight: bold; border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.chart-container-box {
    position: relative; width: 100%; flex: 1; min-height: 120px; flex-shrink: 0;
    background: rgba(10, 10, 15, 0.85); border: 1px solid var(--border-glass);
    border-radius: 16px; overflow: hidden; box-shadow: var(--glass-shadow); margin-bottom: 6px;
}
#tv-chart { width: 100%; height: 100%; }

/* ---------- 監視モニター ---------- */
.monitor-dashboard {
    flex-shrink: 0; display: flex; flex-direction: column;
    background: var(--bg-card); backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass); border-radius: 16px; padding: 6px 10px;
    box-shadow: var(--glass-shadow); overflow: hidden;
    transition: height 0.2s ease;
}
.monitor-list {
    flex: 1; overflow-y: auto; display: grid; gap: 4px; padding-right: 2px;
    grid-auto-rows: max-content; align-content: start; /* 行の高さをカード本来の高さに固定(高さ調整は chart.js) */
}
.monitor-list.col-1 { grid-template-columns: 1fr; }
.monitor-list.col-2 { grid-template-columns: repeat(2, 1fr); }

.monitor-card {
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-glass);
    border-radius: 10px; padding: 4px 6px; display: flex; flex-direction: column; gap: 2px;
    backdrop-filter: blur(8px); height: 100%; justify-content: space-between;
}
.monitor-card-header {
    display: flex; justify-content: space-between; align-items: center; font-size: 0.7rem; font-weight: bold;
}
.monitor-stages {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px;
}
.stage-badge {
    background: rgba(0,0,0,0.3); border: 1px solid var(--border-subtle); border-radius: 5px;
    padding: 2px 2px; text-align: center; font-size: 0.58rem; display: flex; flex-direction: column; gap: 1px;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.stage-badge-label { color: var(--text-sub); font-size: 0.5rem; }
.stage-badge-val { font-weight: bold; color: var(--text-main); font-size: 0.58rem; overflow: hidden; text-overflow: ellipsis; }
.stage-badge-val.buy { color: var(--success); text-shadow: 0 0 4px rgba(74, 222, 128, 0.4); }
.stage-badge-val.sell { color: var(--danger); text-shadow: 0 0 4px rgba(248, 113, 113, 0.4); }

/* ゾーン到達=黄色パルス / トリガー発動=赤色パルス */
.stage-badge-val.zone-pulse { color: #facc15; text-shadow: 0 0 8px #facc15; animation: pulse-glow-yellow 1.5s infinite; }
.stage-badge-val.active-trigger { color: #f87171; text-shadow: 0 0 8px #f87171; animation: pulse-glow-red 1.5s infinite; }

@keyframes pulse-glow-yellow {
    0% { opacity: 0.7; text-shadow: 0 0 6px #facc15; }
    50% { opacity: 1; text-shadow: 0 0 14px #facc15, 0 0 24px rgba(250, 204, 21, 0.7); }
    100% { opacity: 0.7; text-shadow: 0 0 6px #facc15; }
}

@keyframes pulse-glow-red {
    0% { opacity: 0.7; text-shadow: 0 0 6px #f87171; }
    50% { opacity: 1; text-shadow: 0 0 14px #f87171, 0 0 24px rgba(248, 113, 113, 0.7); }
    100% { opacity: 0.7; text-shadow: 0 0 6px #f87171; }
}

/* チャートの状態メッセージ(未接続・読み込み中・エラー) */
.chart-msg {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 3;
    display: none; align-items: center; justify-content: center; text-align: center;
    padding: 16px; font-size: 0.75rem; line-height: 1.6; color: var(--text-sub);
    white-space: pre-line; background: rgba(0, 0, 0, 0.35); pointer-events: none;
}

/* チャート上のメッセージ(読み込み中・エラー) */
.chart-message {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: none;
    align-items: center; justify-content: center; text-align: center; padding: 14px;
    font-size: 0.72rem; color: var(--text-sub); background: rgba(10, 10, 15, 0.55);
    z-index: 5; pointer-events: none; line-height: 1.5;
}
