/* ===== HIKINAMI Apple/SaaS風 シンプルデザイン ===== */

:root {
    --color-bg: #f5f5f7;
    --color-surface: #ffffff;
    --color-text: #1d1d1f;
    --color-text-sub: #6e6e73;
    --color-accent: #0071e3;
    --color-accent-hover: #0077ed;
    --color-border: #d2d2d7;
    --color-success: #34c759;
    --color-warning: #ff9500;
    --color-danger: #ff3b30;
    --radius: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}
a:hover {
    color: var(--color-accent-hover);
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
.header {
    background: rgba(255,255,255,0.8);
    backdrop-filter: saturate(180%) blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--color-border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    max-width: 1080px;
    margin: 0 auto;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}
.nav a {
    margin-left: 24px;
    font-size: 14px;
    color: var(--color-text-sub);
    font-weight: 500;
}
.nav a:hover {
    color: var(--color-text);
}

/* カード */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
}
.card:hover {
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.2s ease;
}

/* 見出し */
h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 32px 0 16px;
}
h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 16px;
}
h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--color-text-sub);
}

/* 日付ピッカー */
.date-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.date-picker input[type="date"] {
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--color-surface);
}
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 980px;
    background: var(--color-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.btn:hover {
    background: var(--color-accent-hover);
    color: #fff;
}
.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn-secondary:hover {
    background: #ececec;
    color: var(--color-text);
}

/* 会場グループ */
.venue-group {
    margin-bottom: 32px;
}
.venue-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* レース一覧テーブル */
.race-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.race-table th {
    background: #fafafa;
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-sub);
    border-bottom: 1px solid var(--color-border);
}
.race-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.race-table tr:last-child td {
    border-bottom: none;
}
.race-table tr:hover {
    background: #fafafa;
}
.race-no-badge {
    display: inline-block;
    min-width: 32px;
    text-align: center;
    padding: 4px 8px;
    background: var(--color-bg);
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
}

/* バッジ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 600;
}
.badge-stable { background: #e8f8ec; color: var(--color-success); }
.badge-normal { background: #fff4e5; color: var(--color-warning); }
.badge-chaos  { background: #ffe8e6; color: var(--color-danger); }

/* 出走表 */
.entry-table {
    width: 100%;
    border-collapse: collapse;
}
.entry-table th, .entry-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.entry-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--color-text-sub);
}
.course-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}
.course-1 { background: #ffffff; color: #000; border: 2px solid #000; }
.course-2 { background: #000000; }
.course-3 { background: #ff3b30; }
.course-4 { background: #0071e3; }
.course-5 { background: #ffcc00; color: #000; }
.course-6 { background: #34c759; }

/* 確率バー */
.prob-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.prob-bar-label {
    width: 50px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.prob-bar-track {
    flex: 1;
    height: 24px;
    background: var(--color-bg);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.prob-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), #5ac8fa);
    border-radius: 8px;
    transition: width 0.3s ease;
}
.prob-bar-value {
    width: 60px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-sub);
    flex-shrink: 0;
}

/* 進入予想フォーメーション図（ボート表示）
   ・縦ドラッグ = 進入順の変更（従来通り、確率再計算に反映）
   ・横ドラッグ = STタイミングの調整（表示専用・確率には反映されない） */
.formation-track {
    position: relative;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(180deg, #f7fafd 0%, #ffffff 100%);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.boat-lane {
    display: grid;
    grid-template-columns: 18px 30px 1fr 54px;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 10px;
    cursor: grab;
    user-select: none;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.boat-lane:hover {
    background: #f5faff;
}
.boat-lane:active {
    cursor: grabbing;
}
.boat-lane.dragging {
    opacity: 0.35;
}
.boat-lane .lane-handle {
    color: var(--color-border);
    font-size: 14px;
    text-align: center;
    flex-shrink: 0;
}
.boat-lane .lane-badge {
    flex-shrink: 0;
}

.lane-track {
    position: relative;
    height: 46px;
    background: linear-gradient(180deg, #eaf5ff 0%, #f7fbff 100%);
    border: 1px solid #dceefc;
    border-radius: 10px;
    overflow: hidden;
}
.lane-startline {
    position: absolute;
    left: 83.3%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ffcc00;
    box-shadow: 0 0 4px rgba(255, 204, 0, 0.6);
    z-index: 1;
}
.lane-boat-slider {
    position: absolute;
    top: 50%;
    left: 83.3%;
    transform: translate(-100%, -50%);
    cursor: ew-resize;
    z-index: 2;
    touch-action: none;
}

.lane-st-value {
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    color: var(--color-text-sub);
    flex-shrink: 0;
}
.lane-st-value.flying {
    color: var(--color-danger);
}

/* CSSボート（SVGアイコン版・進行方向は右向き・スタート地点に人物が前傾した状態） */
.boat-container.lane-boat-icon {
    width: 84.6px; /* 94px × 0.9 */
    height: auto;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));

    --boat-color: #0071e3;
    --boat-bg: #eaf5ff;
}
.lane-boat-icon .boat-icon {
    width: 100%;
    height: auto;
    display: block;
}
.lane-boat-icon .boat-main {
    fill: var(--boat-color);
}
.lane-boat-icon .boat-bg-fill {
    fill: var(--boat-bg);
}
.lane-boat-icon .boat-bg-stroke {
    fill: none;
    stroke: var(--boat-bg);
    stroke-linecap: round;
    stroke-linejoin: round;
}
.lane-boat-icon .boat-bg-stroke > path {
    stroke-width: 3.5px;
}
.lane-boat-icon .boat-bg-stroke > .stroke-thin {
    stroke-width: 3.0px;
}
.lane-boat-icon .boat-bg-stroke > .stroke-border {
    stroke-width: 1.5px;
}

.boat-icon-1 .boat-main {
    stroke: #555555;
    stroke-width: 1.5px;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.lane-boat-icon.boat-icon-1 { --boat-color: #ffffff; --boat-bg: #eaf5ff; }
.lane-boat-icon.boat-icon-2 { --boat-color: #1c1c1e; --boat-bg: #eaf5ff; }
.lane-boat-icon.boat-icon-3 { --boat-color: #ff3b30; --boat-bg: #eaf5ff; }
.lane-boat-icon.boat-icon-4 { --boat-color: #0071e3; --boat-bg: #eaf5ff; }
.lane-boat-icon.boat-icon-5 { --boat-color: #ffcc00; --boat-bg: #eaf5ff; }
.lane-boat-icon.boat-icon-6 { --boat-color: #34c759; --boat-bg: #eaf5ff; }

/* 補正フォーム */
.adjust-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.adjust-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-sub);
    margin-bottom: 8px;
}
.adjust-group select,
.adjust-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--color-surface);
}

.eval-buttons {
    display: flex;
    gap: 6px;
}
.eval-btn {
    flex: 1;
    padding: 6px 0;
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    background: var(--color-surface);
    transition: all 0.15s ease;
}
.eval-btn.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* 買い目候補テーブル */
.combo-table {
    width: 100%;
    border-collapse: collapse;
}
.combo-table th, .combo-table td {
    padding: 10px 14px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.combo-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--color-text-sub);
}
.combo-num {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.05em;
}

/* フィルタタブ */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-tab {
    padding: 8px 16px;
    border-radius: 980px;
    background: var(--color-bg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}
.filter-tab.active {
    background: var(--color-text);
    color: #fff;
}

/* マイ買い目候補 */
.my-picks {
    background: #f0f9ff;
    border: 1px solid #b3e0ff;
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 24px;
}

/* フッター */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-sub);
    font-size: 13px;
}

/* 免責表示 */
.disclaimer {
    background: #fff9e6;
    border: 1px solid #ffe58f;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 13px;
    color: #8a6d00;
    margin-bottom: 0;
}
.disclaimer + .disclaimer {
    margin-top: -12px; /* 実質 8px の隙間になります。お好みで数値を調整してください */
}

/* エンプティステート */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-sub);
}

/* レスポンシブ */
@media (max-width: 768px) {
    h1 { font-size: 24px; }
    .race-table th, .race-table td { padding: 10px; font-size: 13px; }
    .progress-editor { padding: 14px; gap: 8px; }
    .boat-icon { width: 52px; height: 52px; }
}
/* ===================================================
   HIKINAMI コンソールレイアウト（新規追加）
   =================================================== */

:root {
    --sidebar-width: 260px;
    --console-gap: 20px;
}

.console-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--console-gap);
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    align-items: start;
}

/* ---------- サイドバー ---------- */
.console-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 84px;
}

.widget-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.widget-card h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-sub);
    letter-spacing: 0.04em;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.venue-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.venue-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    text-decoration: none;
    color: var(--color-text);
    font-size: 11px;
    text-align: center;
    transition: all 0.15s ease;
    position: relative;
}
.venue-chip:hover {
    border-color: var(--color-accent);
}
.venue-chip.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}
.venue-chip .venue-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-border);
}
.venue-chip.has-race .venue-dot {
    background: var(--color-success);
}
.venue-chip.is-finished .venue-dot {
    background: var(--color-danger);
}
.venue-chip:not(.has-race) {
    background: #e5e5ea;    
    color: #a1a1a6; 
    border-color: transparent; 
    opacity: 0.7;
    pointer-events: none;
}
.venue-chip.active .venue-dot {
    background: #fff;
}
.venue-chip .venue-chip-name {
    font-weight: 600;
    font-size: 12px;
}
.venue-chip .venue-chip-count {
    font-size: 10px;
    opacity: 0.75;
}

/* 天候ミニウィジェット */
.weather-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.weather-mini-tile {
    background: var(--color-bg);
    border-radius: 10px;
    padding: 10px 4px;
    text-align: center;
}
.weather-mini-tile .wmt-icon {
    font-size: 18px;
    margin-bottom: 4px;
}
.weather-mini-tile .wmt-value {
    font-size: 13px;
    font-weight: 700;
}
.weather-mini-tile .wmt-label {
    font-size: 10px;
    color: var(--color-text-sub);
}

/* カウントダウン風ウィジェット（現状は締切時刻データ未取得のためプレースホルダ） */
.countdown-widget .countdown-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-accent);
}
.countdown-widget .countdown-note {
    font-size: 11px;
    color: var(--color-text-sub);
    margin-top: 4px;
    line-height: 1.5;
}

/* ---------- メインエリア ---------- */
.console-main {
    display: flex;
    flex-direction: column;
    gap: var(--console-gap);
    min-width: 0;
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.console-header .venue-title-lg {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.race-tabs-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.race-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}
.race-tabs::-webkit-scrollbar {
    display: none;
}

.race-tab {
    flex-shrink: 0;
    min-width: 40px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-sub);
    background: var(--color-bg);
    text-decoration: none;
}
.race-tab.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.race-nav-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    text-decoration: none;
    color: var(--color-text);
}
.race-nav-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.deadline-badge {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 980px;
    background: #fff4e5;
    color: var(--color-warning);
    font-weight: 700;
    font-size: 13px;
}

/* ===================================================
   免責事項アコーディオン
   =================================================== */
.disclaimer-box {
    background: var(--color-bg); /* 背景を薄いグレーに */
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 16px;
    font-size: 12px;
    color: var(--color-text-sub); /* 文字色をグレーに */
    line-height: 1.6;
}

/* カスタマイズパネル */
.customize-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    font-size: 15px;
    flex-shrink: 0;
}
.customize-panel {
    position: absolute;
    right: 20px;
    top: 100%;
    margin-top: 8px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 14px;
    width: 250px;
    z-index: 50;
    display: none;
}
.customize-panel.open {
    display: block;
}
.customize-panel h4 {
    font-size: 12px;
    color: var(--color-text-sub);
    margin: 0 0 10px;
}
.customize-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #f5f5f7;
}
.customize-item:last-child {
    border-bottom: none;
}
.switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-track {
    position: absolute;
    inset: 0;
    background: var(--color-border);
    border-radius: 999px;
    transition: 0.15s;
    cursor: pointer;
}
.switch-track::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.15s;
}
.switch input:checked + .switch-track {
    background: var(--color-accent);
}
.switch input:checked + .switch-track::before {
    transform: translateX(16px);
}

/* パネル非表示制御（カスタマイズ用） */
.panel-hidden {
    display: none !important;
}

/* ---------- ランキング風テーブル（買い目候補） ---------- */
.ranking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface);
}
.ranking-col {
    border-left: 1px solid var(--color-border);
}
.ranking-col:first-child {
    border-left: none;
}
.ranking-row {
    display: grid;
    grid-template-columns: 28px 1fr 64px 52px;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.ranking-row:last-child {
    border-bottom: none;
}
.ranking-row.checked {
    background: #f0f9ff;
}
.ranking-row .rank-no {
    font-weight: 700;
    color: var(--color-text-sub);
    font-size: 12px;
}
.ranking-combo-badges {
    display: flex;
    gap: 4px;
    align-items: center;
}
.ranking-prob {
    font-weight: 700;
    color: var(--color-accent);
    text-align: right;
    font-size: 13px;
}
.ranking-ev {
    color: var(--color-text-sub);
    text-align: right;
    font-size: 11px;
}
.ranking-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 14px 0 4px;
}
.ranking-pager button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text);
}
.ranking-pager button.active {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}
.ranking-pager button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ---------- 図解2カラム(進入予想/ターン予想) ---------- */
.diagrams-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ==========================================================================
   第1ターンマーク：背景アイコン配置用ラッパー
   ========================================================================== */
.turn-diagram-wrap {
    position: relative;
}
.turnmark-bg {
    position: absolute;
    top: 50%;
    left: 35%;
    transform: translate(-50%, -50%);
    width: 30px; /* 元の表示サイズ(約600px相当)の0.05倍 */
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
}
/* .turn-diagram はJSが丸バッジを描画する層。ターンマークの上に重なるよう z-index を明示 */
.turn-diagram-wrap .turn-diagram {
    position: relative;
    z-index: 1;
    background: transparent; /* 背景はターンマーク側に任せるため透明化 */
}

/* ==========================================================================
   ターンマーク アイコン本体
   ========================================================================== */
.turnmark-container {
    width: 35px;
    height: auto;
    display: inline-block;

    --color-main: #d34a36;
    --color-base: #ffffff;
    --color-line: #1a1a1a;
    --line-width: 4.5px;
}
.turnmark-icon {
    width: 100%;
    height: 100%;
    display: block;
}
.tm-base {
    fill: var(--color-base);
}
.tm-red {
    fill: var(--color-main);
}
.tm-line {
    fill: none;
    stroke: var(--color-line);
    stroke-width: var(--line-width);
    stroke-linecap: round;
}
.tm-outline {
    fill: none;
    stroke: var(--color-line);
    stroke-width: var(--line-width);
    stroke-linejoin: round;
}

/* ターン予想図（円弧・非ドラッグ・自動計算） */
.turn-diagram {
    position: relative;
    min-height: 420px;
    background: linear-gradient(180deg, #f7fafd 0%, #ffffff 100%);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    overflow: hidden;
}
.turn-diagram svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.turn-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: left 0.35s ease, top 0.35s ease;
}
/* 旧仕様(丸バッジ)。現在は使用していないが、他箇所での再利用に備えて残置 */
.turn-marker .tm-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

/* ターンマーク上のボートアイコン(進入予想フォーメーションと共通デザイン) */
.turn-marker .tm-boat {
    width: 62px; /* 34px × 1.5倍 */
    /* 上下反転してから、右向きの船体を左斜め上(45度)向きに回転 */
    transform: scaleY(-1) rotate(152deg);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
    position: relative;
    right: 35px;
    bottom: 23px;
    z-index: 1;
}
.turn-marker .tm-badge-label {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    font-weight: 700;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    order: -1; /* ボートより上に表示する */
    margin-bottom: -2px;
    position: relative;
    z-index: 2; /* ボートより確実に手前に表示する */
}
.turn-marker .tm-prob {
    font-size: 10px;
    color: var(--color-text-sub);
    background: #fff;
    padding: 1px 5px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

/* ---------- レスポンシブ（コンソール） ---------- */
@media (max-width: 900px) {
    .console-shell {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .console-sidebar {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .console-sidebar .widget-card {
        min-width: 240px;
        flex-shrink: 0;
    }
    .diagrams-row {
        grid-template-columns: 1fr;
    }
    .ranking-grid {
        grid-template-columns: 1fr;
    }
    .ranking-col {
        border-left: none;
        border-top: 1px solid var(--color-border);
    }
    .ranking-col:first-child {
        border-top: none;
    }
    .console-header .venue-title-lg {
        font-size: 17px;
    }
    .race-tab {
        min-width: 36px;
        height: 32px;
        font-size: 12px;
    }
}