/* ==========================================
   1. 変数定義と基本設定
   ========================================== */
:root {
    --main-blue: #1a237e;
    --accent: #ff9800;
    --light-bg: #f5f7fa;
    --white: #ffffff;
    --text-dark: #333;
    --status-ok: #2e7d32;
    --status-ng: #c62828;
    --table-header: #f8f9fa;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    margin: 0;
    line-height: 1.6;
    background-color: var(--light-bg);
    color: var(--text-dark);
}

/* --- ページ内リンクのジャンプ位置調整 --- */
html {
    /* リンクをクリックした時に滑らかに動かしたい場合（任意） */
    scroll-behavior: smooth;
}

section {
    /* ヘッダーの高さ分（約80px）だけ、停止位置を上にずらす */
    scroll-margin-top: 40px;
}

/* 2. レイアウト（PC中央寄せ・スマホ最適化） */
.container {
    padding: 3rem 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.bg-white { background-color: var(--white); }

header {
    background-color: var(--main-blue);
    color: var(--white);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.2rem;
    padding: 0;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
}

/* ヒーローエリア */
.hero {
    background: linear-gradient(rgba(26, 35, 126, 0.85), rgba(26, 35, 126, 0.85));
    color: var(--white);
    text-align: center;
    padding: 5rem 1rem;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--white);
    padding: 1rem 2.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
}

/* ==========================================
   3. Game Center (PCで2列、スマホで1列)
   ========================================== */
.schedule-tabs {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-top: 1rem;
}

.game-details {
    border-bottom: 1px solid #eee;
}

.game-details summary {
    padding: 1.2rem;
    font-weight: bold;
    background: var(--table-header);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-details summary::after {
    content: "▼";
    font-size: 0.8rem;
    color: var(--main-blue);
}

.game-details[open] summary::after {
    content: "▲";
}

.game-list {
    background: #f0f2f5; 
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 1px; 
}

.game-card {
    padding: 1.5rem;
    background: #fff; 
    display: flex;
    flex-direction: column;
}

.game-meta {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 1rem;
    font-weight: bold;
    border-bottom: 1px dashed #eee;
    padding-bottom: 0.5rem;
}

.team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.team-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-dark);
    flex: 1;
    padding-right: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-score {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--text-dark);
    text-align: right;
    min-width: 60px;
    line-height: 1;
}

.match-vs {
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: #ddd;
    margin: 8px 0;
}

.staff-info {
    margin-top: auto; 
    padding-top: 1rem;
    font-size: 0.75rem;
    color: #777;
    display: flex;
    flex-direction: column; 
    gap: 4px;
}

/* ==========================================
   4. 会場案内・松脂ステータス
   ========================================== */
.venue-grid {
    display: grid;
    /* ★修正：デフォルトは1列 */
    grid-template-columns: 1fr;
    gap: 2rem;
}

.venue-card {
    border: 1px solid #eee;
    padding: 1.5rem;
    border-radius: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* ★修正：施設名の自動改行制御 */
.venue-card h3 {
    margin-top: 0;
    font-size: 1.25rem;
    line-height: 1.4;
    word-break: keep-all; 
    overflow-wrap: break-word;
}

.map-container {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

/* 地図自体をレスポンシブに */
.map-container iframe {
    width: 100%;
    display: block;
}

.status {
    display: block;
    font-weight: bold;
    font-size: 0.85rem;
    margin: 0.5rem 0;
    padding: 0.6rem 1rem;
    border-radius: 6px;
}

.status.ok { color: var(--status-ok); background: #e8f5e9; border: 1px solid #c8e6c9; }
.status.ng { color: var(--status-ng); background: #ffebee; border: 1px solid #ffcdd2; }

/* ==========================================
   5. 参加申込・規程
   ========================================== */
.rules-box {
    background-color: #fffde7;
    border: 1px solid #fff59d;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-action {
    display: block;
    background: var(--main-blue);
    color: #fff;
    text-decoration: none;
    padding: 0.8rem;
    border-radius: 5px;
    margin-top: 1rem;
    font-weight: bold;
}

/* ==========================================
   6. フッター
   ========================================== */
footer {
    background: #333;
    color: #ccc;
    text-align: center;
    padding: 4rem 1rem;
}

.tradition-gif {
    max-width: 250px;
    height: auto;
    border: 2px solid #555;
    padding: 5px;
    background: #fff;
}

.site-history {
    color: #ffffff !important;
    font-size: 1rem !important;
    margin-top: 10px;
    opacity: 1;
    font-weight: normal;
}

/* ==========================================
   7. レスポンシブ (PC・スマホへの適応)
   ========================================== */

/* PC・タブレット向けの調整 (幅768px以上) */
@media (min-width: 768px) {
    .venue-grid {
        /* ★2列固定にします */
        grid-template-columns: 1fr 1fr;
        /* もし3つ目が左に寄るのが気になる場合は、ここを調整できますが、
           基本は1fr 1frで「左・右」「左・（空き）」になります */
    }
    
    /* ★【削除】3つ目を全幅にする設定を消します */
    /* .venue-card:nth-child(3) { grid-column: 1 / 3; } */
}

/* スマホ向け（既存のまま） */
@media (max-width: 850px) {
    .nav-links { display: none; }
    .game-list { grid-template-columns: 1fr; }
}

/* --- 過去の記録セクション用スタイル --- */
.old-site-entry {
    margin: 20px 0;
}
.old-site-card {
    display: block;
    text-decoration: none;
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.old-site-card:hover {
    background: #f0f4f8;
    border-color: #0056b3;
    transform: translateX(5px);
}
.old-site-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.old-site-tag {
    background: #888;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}
.old-site-text {
    flex-grow: 1;
}
.old-site-text h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    color: #333;
    text-align: left; /* 左寄せに固定 */
}
.old-site-text p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
    text-align: left;
}
.old-site-arrow {
    font-size: 1.2rem;
    color: #0056b3;
    font-weight: bold;
}
@media (max-width: 480px) {
    .old-site-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .old-site-arrow {
        align-self: flex-end;
    }
}

@media (max-width: 768px) {
    section {
        scroll-margin-top: 30px; 
    }

    .navbar {
        display: flex;
        justify-content: space-between; /* ロゴとボタンを左右に */
        align-items: center;
        height: auto; /* ヘッダーの高さを自動調節 */
        padding: 10px 20px;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap; /* 折り返しを許可 */
        justify-content: center;
        gap: 8px 15px; /* 上下左右の余白 */
        padding: 5px 0;
    }

    .nav-links li {
        margin: 0;
        font-size: 0.9rem; /* 文字を少し小さくして収める */
    }
}


/* PCでは「メニュー」ボタンを隠す */
.menu-btn {
    display: none;
}

/* --- スマホ用の設定（画面幅768px以下） --- */
@media (max-width: 768px) {

    /* 「メニュー」ボタンを表示 */
    .menu-btn {
        display: block;
        background: #fff;
        color: #003366; /* リーグのテーマカラー */
        padding: 5px 12px;
        border-radius: 4px;
        font-size: 0.9rem;
        font-weight: bold;
        cursor: pointer;
        border: 1px solid #003366;
    }

    /* メニューリストを最初は隠し、縦並びにする */
    .nav-links {
        display: none; 
        position: absolute;
        top: 60px; /* ヘッダーの高さに合わせて調整 */
        left: 0;
        width: 100%;
        background: #003366; /* 展開時の背景色 */
        flex-direction: column;
        padding: 10px 0;
        z-index: 1000;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links li a {
        display: block;
        padding: 15px;
        color: white;
    }

    /* 【魔法の1行】チェックが入ったら、隣にある .nav-links を表示する */
    #menu-with-click:checked ~ .nav-links {
        display: flex;
    }
}

/* --- スマホ表示の微調整（ロゴを左、メニューを右へ） --- */
@media (max-width: 768px) {
    .navbar {
        display: flex !important; /* 他の命令に負けないように念のため */
        justify-content: space-between !important;
        padding-left: 5px !important;  /* 左側の余白を小さく */
        padding-right: 5px !important; /* 右側の余白を小さく */
        width: 100%;
        box-sizing: border-box;
    }

    .logo {
        margin-left: 0;
        font-size: 1rem; /* 文字が長くて折り返される場合は少し小さく調整 */
    }

    .menu-btn {
        margin-right: 0;
    }
}

/* --- フッターのメールアドレス専用スタイル --- */
.footer-mail {
    color: #ff9800 !important; /* 鮮やかな橙色 */
    font-size: 1.1rem;         /* 周りの文字より少し大きく */
    font-weight: bold;        /* 太字で強調 */
    text-decoration: none;    /* 下線を消す（お好みで） */
    border-bottom: 1px dashed #ff9800; /* 下に点線を入れるとおしゃれです */
    transition: opacity 0.3s;
}

.footer-mail:hover {
    opacity: 0.8; /* ホバー時に少し透明にして反応を出す */
    text-decoration: underline;
}

/* スマホで改行されないように調整 */
@media (max-width: 480px) {
    .footer-mail {
        font-size: 1rem; /* スマホでは画面からはみ出さない程度に */
        word-break: break-all; /* 長いアドレスが枠を突き抜けるのを防ぐ */
    }
}

/* ステータス行のレイアウト */
.status-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.status-label {
    font-size: 0.8rem;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    color: #666;
    min-width: 50px;
    text-align: center;
}

/* 駐車場の種類別色分け */
.parking-info {
    font-weight: bold;
    font-size: 0.9rem;
    padding: 4px 10px 4px 0px !important;
    border-radius: 6px;
}

.type-green { color: #2e7d32; background: #e8f5e9; } /* 公園内あり（安心） */
.type-red { color: #c62828; background: #ffebee; } /* 周辺のみ（注意） */
.type-yellow { color: #ef6c00; background: #fff3e0; } /* ケースバイケース（混雑注意） */

.parking-note {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* 電話番号全体のラップ */
.tel-wrapper {
    margin: 10px 0;
    font-size: 1rem;
    color: #333; /* 周りの文字色 */
}

/* タップできる電話番号部分のスタイル */
.tel-link {
    color: #003366 !important; /* リーグカラーのネイビー */
    text-decoration: none;      /* 下線を消す */
    font-weight: bold;          /* 太字で強調 */
    font-size: 1.2rem;          /* 少し大きくして押しやすく */
    padding: 5px 10px;          /* タップ反応範囲を広げる */
    border-bottom: 2px solid #003366; /* 下線を入れて「押せる感」を出す */
    transition: background-color 0.3s;
    display: inline-block;      /* 余白をしっかり持たせる */
}

/* スマホでタップした瞬間の反応（親切設計） */
.tel-link:active {
    background-color: rgba(0, 51, 102, 0.1);
    border-radius: 4px;
}

/* PC（電話できない端末）では下線を消して普通の文字っぽく見せる場合 */
@media (min-width: 769px) {
    .tel-link {
        pointer-events: none; /* PCではクリック無効化（お好みで） */
        border-bottom: none;
        color: #333 !important;
    }
}

/* 会場連絡先ブロック全体の調整 */
.venue-contact-box {
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9; /* 軽く背景色をつけると「情報の塊」に見えます */
    border-radius: 5px;
}

/* 施設名、住所、電話番号の各行の余白を削る */
.venue-contact-box p {
    margin: 2px 0 !important; /* 上下の隙間を2pxまで詰めました */
    line-height: 1.3 !important; /* 行の間隔を狭く設定 */
    font-size: 0.95rem;
    color: #444;
}

/* 施設名（h3）も少し詰める */
.venue-name {
    margin-bottom: 5px !important;
    font-size: 1.1rem;
    color: #003366;
}

/* 電話番号リンクの装飾（先ほどの設定を活かしつつ） */
.venue-tel a {
    color: #003366;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid #ccc; /* 控えめな下線 */
}

.venue-parking {
    margin: 2px 0 !important;
    line-height: 1.3 !important;
    font-size: 0.85rem;
    color: #d32f2f; /* 混雑注意なので、少し目立つ色にするのもアリです */
    font-weight: bold;
}

/* 駐車場の緑色ラベル部分 */
.parking-status-wrapper { /* クラス名はご自身のコードに合わせてください */
    margin-top: 15px !important;  /* ここで「電車情報」との間に空間を作ります */
    margin-bottom: 5px !important; /* 下の「265台分〜」との距離を微調整 */
    display: inline-block;        /* ラベルの幅をコンテンツに合わせる */
}

/* 駐車場ラベルが入っている行 */
.status-row {
    margin-top: 20px !important;    /* ★ここで電車情報との間に「空き」を作ります */
    margin-bottom: 8px !important;  /* 下の注意書き（parking-note）との距離 */
    display: flex;
    align-items: center;
}

/* ついでに駐車場ラベル自体の見た目も整える場合 */
.parking-info.type-yellow {
    background-color: #fff3e0; /* 薄いオレンジ背景 */
    color: #e65100;           /* 濃いオレンジ文字 */
    padding: 4px 10px 4px 0px !important;
    border-radius: 6px;
    font-weight: bold;
    border: 1px solid #ffcc80;
}

/* アイコンの幅を固定して、文字の開始位置を揃える */
.icon-fixed {
    display: inline-block;
    width: 28px;        /* アイコンの横幅を固定（お好みで調整してください） */
    text-align: left;   /* アイコンを左寄せに */
    vertical-align: middle; /* 文字との高さ合わせ */
}

/* 駐車場ラベルの中の文字配置を整える */
.parking-info {
    display: inline-flex;
    align-items: center;
}

/* 以前お伝えした「電車と駐車場の間の空間」もここで維持 */
.status-row {
    margin-top: 15px !important; 
    margin-bottom: 5px !important;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.org-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.org-card h3 {
    margin: 10px 0;
    color: #004a99;
    font-size: 1.2em;
}

.org-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #eee;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}

.org-links {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.org-links li {
    margin-bottom: 8px;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 5px;
}

.org-links a {
    text-decoration: none;
    color: #333;
}

.org-links a:hover {
    color: #004a99;
}

/* 関連団体セクションの調整 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.org-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.org-card h3 {
    margin: 0 0 15px 0;
    color: #004a99;
    font-size: 1.15em;
    padding-left: 12px;
    border-left: 5px solid #004a99; /* バッジの代わりのアクセントライン */
    line-height: 1.4;
}

.org-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.org-links li {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dotted #eee;
    font-size: 0.95em;
    line-height: 1.6;
}

.org-links li:last-child {
    border-bottom: none;
}

.org-links a {
    text-decoration: none;
    color: #004a99;
    font-weight: bold;
}

.org-links a:hover {
    text-decoration: underline;
}

.org-desc {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    display: block;
}

/* 過去の記録ボタン用スタイル */
    .btn-archive {
        display: inline-block;
        background: #f8f9fa;
        color: #004a99;
        border: 2px solid #004a99;
        padding: 18px 40px;
        font-size: 1.2rem;
        font-weight: bold;
        text-decoration: none;
        border-radius: 50px; /* 丸みのあるモダンなボタン */
        transition: all 0.3s ease;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .btn-archive:hover {
        background: #004a99;
        color: #fff;
        transform: translateY(-3px); /* 浮き上がる効果 */
        box-shadow: 0 6px 12px rgba(0, 74, 153, 0.3);
    }

    .btn-archive .icon {
        margin-right: 8px;
    }

    /* モバイル対応：画面幅が狭いときは幅いっぱいに */
    @media (max-width: 600px) {
        .btn-archive {
            display: block;
            font-size: 1.1rem;
            padding: 15px 20px;
        }
    }

    /* ヘッダーのレイアウト調整 */
    .navbar {
        display: flex;
        justify-content: space-between; /* ロゴとボタンを両端に */
        align-items: center;
        padding: 10px 20px;
    }

    /* ヘッダー内ボタンのスタイル */
    .btn-home-header {
        background-color: #fff;
        color: #004a99;
        border: 1px solid #004a99;
        padding: 5px 15px;
        text-decoration: none;
        border-radius: 4px;
        font-size: 0.9rem;
        font-weight: bold;
        transition: 0.3s;
    }

    .btn-home-header:hover {
        background-color: #004a99;
        color: #fff;
    }

    /* モバイルでロゴが長い場合の考慮 */
    @media (max-width: 480px) {
        .logo { font-size: 0.9rem; }
        .btn-home-header { padding: 4px 8px; font-size: 0.8rem; }
    }

/* --- ヘッダー・ナビゲーションの強制上書き --- */
header .navbar {
    display: flex !important; /* スマホでも非表示にさせない */
    flex-direction: row !important; /* 縦並びを阻止 */
    justify-content: space-between;
    align-items: center;
}

/* スマホ時、nav-links（メニュー）は隠れても、header-actions（ボタン）は出す */
@media (max-width: 768px) {
    .header-actions {
        display: block !important;
        margin-left: auto; /* ロゴの右側に寄せる */
    }
}

/* ロゴのリンク装飾をリセット */
.logo a {
    color: inherit;
    text-decoration: none;
}

/* パソコン（画面が広いとき）は途中の改行を非表示にする */
@media (min-width: 768px) {
  .pc-inline {
    display: none;
  }
}