/* z_vh/vh.css  20260921 VH 新規作成 */

:root {
    --vh-fb-size: 128px;   /* vh_feedback.js がパラメータの SIZE で上書き */
}

/* ---- 手マーカーを gif 表示にする --------------------------------------
   theta-arm-view.js が圧力に応じて inline style で付ける
   変形(transform)・色変化(filter)・角丸(border-radius) を !important で無効化。
   表示/非表示・位置(left/top)・透明度(opacity) は既存どおり theta-arm-view.js に任せる。
   gif 自体は vh_feedback.js が background-image で設定する。 */
/* 20261015 zpma: 手マークへの上書きはすべて html.vh-on のときだけ（OFF = 今の手マークのまま） */
html.vh-on #gestureleft,
html.vh-on #gestureright {
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    border-radius: 0 !important;
    filter: none !important;
    transform: translate(-50%, -50%) !important;
    width: var(--vh-fb-size) !important;
    height: var(--vh-fb-size) !important;
}
/* 20260921l: 指の位置からオフセット（TypeR の FEEDBACK_OFFSET と同じ考え方）
   上へ --vh-off-v、内側へ --vh-off-h（左の gif は右へ、右の gif は左へ）ずらして指で隠れないようにする */
html.vh-on #gestureleft  { transform: translate(calc(-50% + var(--vh-off-h, 60px)), calc(-50% - var(--vh-off-v, 60px))) !important; }
/* 20260921m: 右は scaleX で左右反転し、左右対称にする（--vh-mirror-r: -1 反転 / 1 そのまま） */
html.vh-on #gestureright { transform: translate(calc(-50% - var(--vh-off-h, 60px)), calc(-50% - var(--vh-off-v, 60px))) scaleX(var(--vh-mirror-r, -1)) !important; }
html.vh-on #gestureleft:before,
html.vh-on #gestureright:before {
    display: none !important;   /* 既存の青い影の円を消す */
}

/* ---- 20260921 追加: 左右センサ値の表示（上部中央：自分の映像と終了ボタンの間） ---- */
#vh-values {
    position: fixed;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    padding: 4px 14px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;   /* 下のジェスチャ操作を邪魔しない */
}

/* ---- 設定パネル ------------------------------------------------------- */
#vh-panel-btn {
    position: fixed;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3000;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 22px;
    line-height: 40px;
    padding: 0;
}
#vh-panel {
    position: fixed;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3001;
    width: 340px;                       /* 20260921t: 250 → 340（文字の折り返し防止） */
    max-width: calc(100vw - 64px);      /* 20260921t: 狭い画面でははみ出さない */
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(20, 20, 20, 0.88);
    color: #fff;
    font-size: 14px;
}
#vh-panel .vh-title {
    font-weight: bold;
    margin-bottom: 6px;
}
#vh-panel .vh-live {
    font-size: 12px;
    color: #ffd966;
    margin-bottom: 8px;
    min-height: 1.4em;
}
#vh-panel label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
    font-weight: normal;
}
#vh-panel label input[type="number"],
#vh-panel label select {
    width: 70px;
    color: #000;
    padding: 2px 4px;
}
#vh-panel label select { width: auto; min-width: 110px; }   /* 20260921e gif パターン選択 */
#vh-panel label.vh-check {
    justify-content: flex-start;
    gap: 6px;
}
#vh-panel .vh-btns {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
#vh-panel .vh-btns button {
    flex: 1;
    padding: 4px 0;
    border: none;
    border-radius: 4px;
    background: #2696E8;
    color: #fff;
}
#vh-panel .vh-msg {
    font-size: 12px;
    margin-top: 6px;
    min-height: 1.2em;
}

/* 20260921f: gif の不透明度をパネルで変更。theta-arm-view.js が書く inline の opacity 0.8 / 0.3 を上書き */
/* 20260921k: 一度も触っていない初期状態（inline なし→sma.css の 0.6）にもパネル値を適用 */
html.vh-on #gestureleft, html.vh-on #gestureright { opacity: var(--vh-opa-idle, 0.8) !important; }
html.vh-on #gestureleft[style*="opacity: 0.8"], html.vh-on #gestureright[style*="opacity: 0.8"] { opacity: var(--vh-opa-active, 0.8) !important; }
html.vh-on #gestureleft[style*="opacity: 0.3"], html.vh-on #gestureright[style*="opacity: 0.3"] { opacity: var(--vh-opa-idle, 0.3) !important; }
/* 20260921g: スライダー */
#vh-panel label input[type="range"] { width: auto; flex: 1 1 auto; min-width: 60px; vertical-align: middle; }   /* 20260921t: 余白いっぱいに伸ばす */
/* 20260921t: ラベルを折り返さない・大項目の見出し */
#vh-panel label { gap: 6px; white-space: nowrap; }
#vh-panel .vh-sec { margin: 10px 0 4px; padding-bottom: 2px; border-bottom: 1px solid rgba(255,255,255,0.35); font-weight: bold; color: #9cc8ff; }
/* 20260921u: 大項目の中の小見出し（シフト） */
#vh-panel .vh-sub { margin: 8px 0 2px; font-size: 13px; color: #cfe3ff; }
/* 20260921v: シフトの「0に戻す」ボタンと、上方向・内側方向のスライダー長をそろえる */
#vh-panel .vh-sub { display: flex; justify-content: space-between; align-items: center; }
#vh-panel #vh-off0 { font-size: 12px; padding: 1px 8px; border: none; border-radius: 4px; background: #555; color: #fff; }
#vh-panel .vh-lb { display: inline-block; width: 4.5em; flex: 0 0 auto; }
/* 20260921w: 歯車ボタンを上部中央（センサ値の下）へ。パネルもその下に中央寄せで出し、幅を 300px に縮めて横スクロールを防ぐ */
/* 20261015 zpma: 上部は俯瞰カメラ窓なので、⚙は右端の中央、パネルはその左に出す。センサ値は俯瞰窓の下 */
#vh-panel-btn { left: auto; right: 6px; top: 50%; transform: translateY(-50%); }
#vh-panel { left: auto; right: 52px; top: 50%; transform: translateY(-50%); width: 300px; max-width: calc(100vw - 64px); max-height: 90vh; overflow-x: hidden; }
#vh-values { top: calc(var(--overhead-h, 30vh) + 8px); }
html.no-overhead-cam #vh-values, html.overhead-cam-float #vh-values { top: 8px; }
#vh-panel .vh-on-row { font-weight: bold; color: #ffd966; }
#vh-panel .vh-rv { display: inline-block; min-width: 2.8em; text-align: right; margin-left: 4px; }
/* 20260921n: スライダー横の数値入力欄 */
#vh-panel label input[type="number"].vh-rv { width: 4.2em; min-width: 0; box-sizing: border-box; }
/* 20260921h: スライダーのつまみを真円に */
#vh-panel input[type="range"] { -webkit-appearance: none; appearance: none; height: 18px; margin: 0; padding: 0; background: transparent; }
#vh-panel input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: #888; border: none; }
#vh-panel input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; border: 2px solid #2a6fdb; }
#vh-panel input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: #888; border: none; }
#vh-panel input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid #2a6fdb; box-sizing: border-box; }
/* ★v261117c 右の ⚙ の窓のタブ（走り／VH／記録）。出せるタブが 2 つ以上のときだけ出す（z_vh/vh_panel.js） */
#vh-panel .gt-bar { display: none; align-items: stretch; margin: -10px -12px 8px; border-bottom: 1px solid rgba(255,255,255,0.25); }
#vh-panel .gt-tab { flex: 1; text-align: center; padding: 9px 0 7px; color: #aab; cursor: pointer; border-bottom: 2px solid transparent; }
#vh-panel .gt-tab.on { color: #fff; font-weight: bold; border-bottom-color: #6fa3ff; }
#vh-panel .gt-tab.gt-dev { color: #c9a3ff; }
#vh-panel .gt-tab.gt-dev.on { color: #e4d1ff; border-bottom-color: #b17cff; }
#vh-panel .gt-x { flex: 0 0 auto; padding: 8px 10px 6px; color: #aab; cursor: pointer; font-size: 16px; }
#vh-panel-btn.gt-dot::after { content: ""; position: absolute; right: 3px; top: 3px; width: 9px; height: 9px; border-radius: 50%; background: #ff5a5a; }

/* ★v261117h 窓に枠と決まった高さ（Cozy 2026-11-17「枠があったほうが良い。タブを変えると高さが変わって分からなくなる」）。
   どのタブでも同じ大きさ・同じ場所（縦の真ん中合わせのまま、高さが変わらないので動かない）。続きは窓の中で縦に動かす。
   タブの並びは上に貼り付ける（sticky）。モックアップ _docs/mock/panel_frame_notice_mock.html */
#vh-panel { height: min(60vh, 520px); max-height: none; border: 1.5px solid #4f8ef7; border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 6px 18px rgba(0, 0, 0, 0.55); background: rgba(20, 20, 22, 0.95); overscroll-behavior: contain; }
#vh-panel .gt-bar { position: sticky; top: -10px; z-index: 2; background: #1d1e24; }
