/* ==========================================
   1. 共通設定（ベース）
   ========================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: #ffffff;
    color: #1a1a1a;
    font-family: sans-serif;
    flex-direction: column;
    min-height: 100vh;
}

.menu-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* メインエリアを囲むラッパーを追加 */
.wrapper {
    display: flex;
    position: relative;
    flex: 1;
}

/* ==========================================
   2. ヘッダー設定
   ========================================== */
.mobile-header {
    width: 100%;
    display: flex;
    background-color: #333;
    color: #ffffff;
    align-items: center;
    padding: 3px 20px;
    position: sticky;
    top: 0;
    z-index: 5000;
}
.mobile-header .logo {
    color: #ffffff !important;
    font-weight: bold;
    font-size: 18px;
}
.mobile-header .hamburger-btn {
    display: block;
    padding: 15px;
    cursor: pointer;
    color: #ffffff !important;
    font-size: 20px;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    display: block;
    padding: 8px 8px 8px 8px;
    cursor: pointer;
}

/* ==========================================
   3. サイドバー ＆ メイン設定
   ========================================== */
.side-pane {
    padding: 20px;
    color: #fff;
}

/* メニュータイトル（LEAGUES）の文字色 */
.side-pane .menu-title {
    color: #888888;
    font-size: 12px;
    letter-spacing: 1px;
    margin-top: 12px; 
    margin-bottom: 10px;
}

/* 閉じるボタン（×）の文字色 */
.side-pane .close-btn {
    display: block;
    padding: 10px;
    cursor: pointer;
    background: #333;
    color: #fff;
    text-align: right;
}

.main-content {
    flex: 1;
    padding: 30px;
    margin-left: 250px;
}

.menu-toggle-input:checked ~ .wrapper .side-pane {
    left: 0; /* 画面内へ移動 */
}

/* チェックボックス自体は隠す */
.menu-toggle-input {
    display: none;
}

/* サイドバーの基本設定 */
#sidebar-placeholder {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: #333;
    z-index: 2000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    overflow-y: auto;
}

#sidebar-placeholder.is-open {
    left: 0;
}

/* メニューを開くための唯一のルール */
#menu-toggle:checked ~ .wrapper #sidebar-placeholder {
    left: 0;
}

/* ==========================================
   4. スマホ環境用（768px以下）
   ========================================== */
@media (max-width: 768px) {
    #sidebar-placeholder {
        left: -250px; /* スマホの時は隠す */
    }
    
    .menu-toggle-input {
        display: none;
    }

    .wrapper { 
        flex-direction: column;
    }
    
    .side-pane { 
        position: fixed; 
        top: 0; 
        left: -240px;
        width: 240px; 
        height: 100vh;
        z-index: 1500; 
        transition: left 0.3s ease;
        background-color: #252525;
    }
    
    .side-pane .close-btn {
        color: #ffffff;
        font-size: 20px;
        text-align: right;
        cursor: pointer;
        display: block;
        padding: 5px 20px;
        margin-bottom: 0;
     }

    #menu-toggle:checked ~ #sidebar-placeholder {
        left: 0 !important;
    }

    #menu-toggle:checked ~ .side-pane {
        left: 0 !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .mobile-header {
        position: relative;
        z-index: 3000;
    }

    /* 初期状態：隠しておく */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 1400; /* サイドバー(2000)より下、他より上 */
        background: rgba(0, 0, 0, 0.3);
    }

    /* サイドバーが開いた時だけ表示 */
    #menu-toggle:checked ~ .sidebar-overlay {
        display: block;
    }
}

/* ==========================================
   ️ メイン
   ========================================== */

/* 一括の［スコアを見る］ボタン */
.v-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* ボタンのデザインを少しモダンにする */
.toggle-score-btn {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

/* ホバー（マウスを乗せたとき）の反応 */
.toggle-score-btn:hover {
    background-color: #555;
}

/* 個別の［スコアを見る］ボタン */
.single-score-btn {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 4px 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}
.single-score-btn:hover {
    background-color: #555;
}

/* スコアの数字自体の見た目 */
.score-display {
    font-weight: bold;
    color: #e63946; /* スコアを目立たせる赤（お好みで変えてください） */
    margin-left: 8px;
    transition: opacity 0.2s;
}

/* 1つの日付の中に複数のカードを縦並びにするための枠 */
.match-cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px; /* カードとカードの間の隙間 */
}

.match-list {
    margin-top: 20px;
    max-width: 600px; /* 画面に合わせた程よい横幅 */
}

/* 1つの試合行（日付とカードを横並びにする） */
.match-row {
    display: flex;
    border-bottom: 1px solid #333333; /* 罫線「────」の役割 */
    padding: 15px 0;
}

/* 左側：日付軸（幅を固定して、右側に縦線「│」を引く） */
.date-axis {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #444444; /* 罫線「│」の役割 */
    padding-right: 10px;
}
.date-axis .date {
    font-size: 14px;
    font-weight: bold;
}
.date-axis .day {
    font-size: 12px;
    color: #888888;
}
.date-axis .date-unfixed {
    font-size: 12px;
    color: #e67e22; /* 未定はちょっと目立たせるオレンジ */
}

/* 右側：対戦カードの箱 */
.match-card {
    flex: 1;
    padding-left: 20px;
    background: transparent;
    margin: 0;
/*    max-width: none; */
}
.card-header {
    margin-bottom: 8px;
}
.card-header .teams {
    font-size: 14px;
    font-weight: bold;
}
.card-body {
    padding-left: 20px;
    min-height: 30px;
    font-size: 13px;
    color: #aaaaaa;
    display: flex;
/*    gap: 15px; */
    align-items: center;
    flex-wrap: wrap;
}
.status-text.finished {
    color: #2ecc71; /* 試合終了は緑っぽく */
}
.card-footer {
    margin-top: 6px;
    font-size: 12px;
    color: #e67e22;
}

/* --- ツリーメニューのインフラ設定 --- */
.tree-menu {
    list-style: none;
}
.tree-menu > li {
    margin-bottom: 8px;
}

/* ツリー開閉用のチェックボックスは画面から隠す */
.tree-toggle {
    display: none;
}

/* リーグ名のラベル（クリックできるボタン） */
.tree-label {
    display: block;
    color: #cccccc;
    font-size: 14px;
    padding: 10px 12px 10px 40px;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 18px; /* 矢印のスペース */
    border-radius: 3px;
    transition: all 0.2s ease;
}

/* マウスオーバー */
.tree-label:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

/* リーグ名の左側にポインタを置く */
.tree-label::before {
    content: "▶";
    position: absolute;
    left: 4px;
    top: 48%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #666666;
    transition: transform 0.2s ease; /* 矢印が回るアニメーション */
    transform-origin: center;
}

/* 「▼」への回転（位置ズレを防ぐためトップ中央基準で回す） */
.tree-toggle:checked + .tree-label::before {
    top: 35%;
    font-size: 8px;
    transform: translateY(-50%) rotate(90deg);
    color: #ffffff;
}

/* ツリーの中身（デフォルトは高さを0にして完全に非表示にする） */
.tree-sub {
    list-style: none;
    padding-left: 0; /* 左線をなくして、ボックスを横いっぱいに広げる */
    margin-left: 5px;
    height: 0;
    overflow: hidden; /* はみ出た中身を隠す（＝消える） */
    opacity: 0;
    transition: all 0.2s ease;
}

.tree-sub li {
    margin: 4px 0;
}

.tree-sub a {
    display: block;
    color: #888888;
    font-size: 13px;
    text-decoration: none;
    padding: 8px 12px 8px 30px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.tree-sub a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

/* オプション用 */

.optionmenu {
    display: block;
    color: #cccccc;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    position: relative;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.optionmenu a {
    display: block;
    color: #cccccc;
    font-size: 14px;
    text-decoration: none;
    padding: 10px 12px 10px 18px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.optionmenu a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

/* ==========================================
   ️ 開閉のロジック（CSSによる条件分岐）
   ========================================== */

/* 1. スイッチがON（:checked）になったら、直後のラベルの矢印を「▼」に傾ける */
.tree-toggle:checked + .tree-label::before {
    transform: rotate(90deg);
    color: #ffffff;
}

/* 2. スイッチがONになったら、その下にあるチームリスト（.tree-sub）を表示する */
.tree-toggle:checked ~ .tree-sub {
    height: auto; /* 中身の分だけ高さを広げる */
    opacity: 1;
    margin-top: 5px;
    margin-bottom: 10px;
}

/* ==========================================
   ️ フッター
   ========================================== */

.app-footer {
    background-color: transparent;
    color: #888888;            
    padding: 30px 0 10px 0;
    margin-top: 60px; 
    border-top: 1px solid #e9ecef;
    font-size: 13px;
    line-height: 1.6;
}

.app-footer h3 {
    color: #666666;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 14px;
}

.app-footer p {
    margin: 4px 0;
}
