/* ↓↓↓ style.css の中身を全て消して、このコードに置き換えてください ↓↓↓ */

/* --- グローバル設定 --- */
* {
    box-sizing: border-box;
}

/* ▼▼▼ 修正箇所：地図が動かないようにページ全体を固定 ▼▼▼ */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* ページ全体のスクロールを禁止 */
    overscroll-behavior-y: contain; /* 「引っ張って更新」を無効化 */
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
}

/* ▼▼▼ 修正箇所：地図を画面に完全に固定 ▼▼▼ */
#map {
    width: 100%;
    height: 100%;
    position: fixed; /* 'absolute'から'fixed'に変更 */
    top: 0;
    left: 0;
    z-index: 0;
}

/* --- PC用 操作パネル (デフォルト) --- */
.control-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#scrollable-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 30px);
}

#typhoonList {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.typhoon-list-item {
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
    font-weight: bold;
    font-size: 16px;
}

.typhoon-list-item:hover {
    background-color: #f0f0f0;
}

.typhoon-list-item.active {
    background-color: #007bff;
    color: white;
}

.view-mode-container {
    padding: 0;
    background-color: transparent;
    border: none;
}

.view-mode-toggle {
    display: flex;
    width: 100%;
    border-radius: 8px;
    background-color: #e4e9ed;
    overflow: hidden;
    border: 1px solid #c8d0d8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-mode-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background-color: transparent;
    color: #333;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.view-mode-btn.active {
    background-color: #007bff;
    color: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.typhoon-info-display-inner {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    overflow-y: auto;
}

/* --- 情報パネルの各パーツ --- */
.typhoon-name { font-size: 18px; font-weight: bold; background-color: #343a40; color: #FFF; padding: 10px 15px; }
.typhoon-subname { font-size: 14px; color: #6c757d; font-weight: bold; margin: -5px 0 10px 0; padding: 0 15px; }
.actual-time-heading { font-size: 16px; font-weight: bold; margin-bottom: 12px; padding: 0 15px; }
.actual-infographics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background-color: #dee2e6; border-top: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6; margin: 0 15px 15px 15px; }
.actual-info-item { background-color: #f8f9fa; padding: 10px; text-align: center; }
.actual-info-label { font-size: 11px; color: #6c757d; margin-bottom: 4px; font-weight: bold; }
.actual-info-value { display: flex; justify-content: center; align-items: baseline; gap: 0.25em; }
.actual-info-value .value { font-size: 20px; font-weight: 700; color: #212529; line-height: 1; }
.actual-info-value .unit { font-size: 12px; color: #495057; font-weight: bold; }
.actual-location{ 
/* --- ↓ここから追加 --- */
    display: flex;         /* 要素を横並びにする */
    align-items: center;   /* 上下中央に揃える */
    gap: 5px;              /* アイコンと文字の間に少し隙間を空ける（お好みで調整） */
    /* --- ↑ここまで追加 --- */
    font-size: 12px;
    font-weight: 700;
    color: #212529;
    padding: 0 15px;
    line-height: 1; 
}


.typhoon-info-display-inner strong { display: block; padding: 10px 15px 5px 15px; font-size: 16px; }
.forecast-item { border: 1px solid #e9ecef; margin: 0 15px 10px 15px; border-radius: 6px; overflow: hidden; }
.forecast-time-heading { margin: 0; padding: 8px 12px; border-bottom: 1px solid #e9ecef; font-size: 14px; font-weight: bold; background-color: #f8f9fa; }
.forecast-content { padding: 10px; }
.forecast-infographics { display: flex; gap: 2px; }
.forecast-location { font-size: 13px; font-weight: bold; color: #6c757d; margin-top: 8px; text-align: left; }

.info-box { padding: 8px; text-align: center; display: flex; flex-direction: column; justify-content: center; line-height: 1.3; border-radius: 4px; }
.info-label { font-size: 11px; font-weight: bold; }
.info-value { font-size: 16px; font-weight: bold; }
.wind-speed-box { background-color: #343a40; color: white; width: 50%; }
.pressure-box { background-color: #e9ecef; color: #212529; width: 100%; }
.course-box { background-color: #ffc107; color: #212529; width: 100%; margin-top: 2px; }

/* --- 地図上のアイコンとラベル --- */
.typhoon-label { background-color: rgba(255,255,255,0.85); border: 1px solid #555; border-radius: 4px; font-size: 14px; font-weight: bold; padding: 4px 8px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.leaflet-tooltip.time-label { background-color: #d9534f; border: none; color: #ffffff; font-weight: bold; padding: 3px 6px; border-radius: 4px; white-space: nowrap; opacity: 0.9; }
.leaflet-tooltip-bottom::before, .leaflet-tooltip-top::before, .leaflet-tooltip-left::before, .leaflet-tooltip-right::before { border: none !important; }
.forecast-x-icon { color: #000; font-weight: bold; text-align: center; line-height: 10px; font-size: 16px; }

/* --- PC表示ではモバイル用グリップを非表示 --- */
#panel-grip-mobile { display: none; }

@media (max-width: 768px) {
    .control-panel {
        position: fixed;
        z-index: 1000;
        width: 100%;
        left: 0;
        bottom: 0;
        top: auto;
        border-radius: 16px 16px 0 0;
        background-color: #f8f9fa;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
        gap: 0;
        
        /* ▼▼▼ ここからが修正・追加箇所です ▼▼▼ */
        height: 60vh; /* パネルの高さを画面の60%に固定 */
        max-height: 90vh;
        transition: transform 0.3s ease-out;
        display: flex;
        flex-direction: column;
        
        /* 初期状態（閉じた状態）では、高さ(60vh)から150pxを引いた分だけ下に隠す */
        transform: translateY(calc(60vh - 150px));
    }

    /* パネルが開いた状態のスタイル */
    .control-panel.open {
        transform: translateY(0); /* 完全に表示 */
    }
    /* ▲▲▲ 修正・追加ここまで ▲▲▲ */

    .panel-header {
        cursor: grab;
        text-align: center;
        flex-shrink: 0;
        padding: 17px 0;
        -webkit-tap-highlight-color: transparent;
    }

    #panel-grip-mobile {
        display: block;
        width: 180px;
        height: 5px;
        background-color: #ced4da;
        border-radius: 2.5px;
        margin: 5px auto;
    }

    #scrollable-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex-grow: 1;
        padding: 0 10px 10px 10px;
        gap: 15px;
    }

    #typhoonList, .typhoon-info-display-inner {
        width: 100%;
        max-height: none;
        overflow-y: visible;
        box-shadow: none;
        background-color: transparent;
        padding: 0;
    }

    .view-mode-container { padding: 0; order: 1; }
    #typhoonInfo { order: 2; }
}