body {
  margin: 0;
  font-family: sans-serif;
  padding-top: 100px;
  /* ヘッダー高さ分 */

}


header.scrolled {
  background: rgba(76, 175, 239, 0.8);
  /* 半透明 */
}

.header-left {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.logo {
  position: absolute;
  top: auto;
  left: 1%;
  width: 60px;
  padding: 5px;
  top: 10px;
}






.maintext {
  font-size: xx-large;
  font-weight: bolder;
  text-align: center;
  margin-top: 20px;
}

#subtext {
  text-align: center;
}

#contents {
  text-align: center;
}

.index-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  /* PC: 横12枚 */
  gap: 10px;
  justify-items: center;
}

/* 画像サイズ調整 */
.index-container img {
  width: 100%;
  /* グリッドに合わせて可変 */
  height: auto;
  max-width: 300px;
  /* 最大幅制限 */
}

/* スマホ表示時（幅768px以下） */
@media (max-width: 768px) {
  .index-container {
    grid-template-columns: repeat(5, 1fr);
    /* スマホ: 横6枚 */
  }
}

.googlemap {

  right: 3%;
  size: 60%;
  color: white;
}

#footer {
  background-color: rgb(44, 44, 65);
  color: white;
  font-family: HG正楷書体-PRO;
}

#nishikosai {
  font-family: "Zen Antique", serif;
  font-size: 2.5em;
  font-family: "Zen Antique", serif;
  font-weight: 900;
  font-style: normal;
  margin: 0;
  top: -10px;
  text-align: center;
  height: 70px;

}


footer {
  background-color: rgb(44, 44, 65);
  /* 背景を濃紺 */
  color: white;
  /* 文字を白に */
  padding: 20px;
  text-align: center;
  border-top: 2px solid white;
  /* 上の境界線を白 */
  margin-top: 0;
  /* 余計な隙間をなくす */
}



#botton-sentence {
  bottom: 0.1%;
  text-align: center;
}

.map {
  text-align: center;
  color: white;

}

.link {
  color: white;
  text-align: center;
}

.about-us {
  text-align: center;
}

.h2oo {
  display: block;
  font-size: 1.5em;
  margin-block-start: 0.83em;
  margin-block-end: 0.83em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  font-weight: bold;
  unicode-bidi: isolate;

}


header {
  position: fixed;
  /* スクロールしても固定 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: #4cafef;
  /* 初期は不透明 */
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background 0.3s ease;
  /* 背景色をなめらかに変化 */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-weight: normal;
}



section {
  width: 96%;
  margin: auto;
  margin-bottom: 40px;
}

.t-wrapper {
  display: flex;
  justify-content: center;
  padding: 40px 0;
  overflow-x: auto;
}

.t-container {
  display: flex;
  align-items: stretch;
  gap: 40px;
  /* 列間の距離 */
}

.t-column {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  /* これにより垂直方向の中央揃えが成立 */
}

.t-match-box,
.t-final-box {
  display: flex;
  flex-direction: column;
  gap: 40px;
  /* チーム間の垂直距離 */
  position: relative;
}

.t-item {
  width: 160px;
  height: 36px;
  background: #fff;
  border: 1px solid #999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  font-size: 13px;
  position: relative;
  box-sizing: border-box;
}

/* 勝者の強調 */
.win-team {
  border-color: #4cafef;
  background: #f0f8ff;
  font-weight: bold;
}

.t-score {
  font-weight: bold;
  color: #4cafef;
}

/* ----------------------------
   リーグ表（対戦マトリクス）
----------------------------- */

.league-table-container {
  margin: 10px auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
  overflow-x: auto;
  padding: 10px 15px 15px 15px;
}

.league-table-container h3 {
  margin-bottom: 10px;
}

.match-matrix {
  border-collapse: collapse;
  margin: 0 auto 0 auto;
  width: calc(40% + 200px);
  max-width: 100%;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .league-table-container h3 {
    margin-bottom: -35px;
  }

  .match-matrix {
    width: 600px;
  }
}

/* 統計列（勝ち点など）の幅を固定  */
.match-matrix .stat.pts {
  width: 14%;
  font-weight: 700;
}

.match-matrix .stat.wins {
  width: 10%;
}

.match-matrix .stat.draws {
  width: 10%;
}

.match-matrix .stat.gd {
  width: 10%;
}

.match-matrix th,
.match-matrix td {
  border: 1px solid #ccc;
  padding: 8px 0px;
  text-align: center;
  font-size: 14px;
}

.match-matrix thead th {
  background: #e6e6e6;
  font-weight: 700;
}

.match-cell.diagonal {
  background: #f4f4f4;
}

.stat {
  background: #fffdf5;
}

/* result.css に追加 */
#league-tables {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
}

/* --- トーナメント検索エリアのコンテナ --- */
.tournament-controls {
  background-color: #fff;
  /* 背景色：白 */
  padding: 20px;
  margin: 20px auto;
  /* 上下20px、左右中央寄せ */
  max-width: 800px;
  /* 横幅が広がりすぎないように制限 */
  border-radius: 10px;
  /* 角を丸く */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* 軽い影をつける */

  /* フレックスボックスで中身を整列 */
  display: flex;
  flex-wrap: wrap;
  /* 折り返しを許可 */
  justify-content: center;
  /* 中央揃え */
  align-items: center;
  gap: 15px;
  /* 各パーツの隙間 */
}

/* --- 見出し (h2oo) --- */
.tournament-controls .h2oo {
  width: 100%;
  /* 横幅いっぱいに広げて改行させる */
  text-align: center;
  margin: 0 0 10px 0;
  /* 下に少し余白 */
  font-size: 1.5rem;
  color: #333;
  border-bottom: 2px solid #4cafef;
  /* 下線（テーマカラー） */
  padding-bottom: 5px;
  display: inline-block;
  /* 下線の長さを文字に合わせるならinline-blockにしてtext-align制御も可ですが、今回は幅いっぱいでシンプルに */
}

/* --- プルダウン (select) --- */
.tournament-controls select {
  padding: 10px 15px;
  font-size: 16px;
  /* スマホで勝手にズームしないサイズ */
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f9f9f9;
  cursor: pointer;
  outline: none;
  min-width: 120px;
  /* 最低限の幅 */
}

.tournament-controls select:focus {
  border-color: #4cafef;
  /* 選択時に青枠にする */
  background-color: #fff;
}

/* --- 表示ボタン --- */
#tournamentSearchBtn {
  padding: 10px 30px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  background-color: #4cafef;
  /* テーマカラーの青 */
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  /* ホバー時の色変化を滑らかに */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#tournamentSearchBtn:hover {
  background-color: #3595d6;
  /* ホバー時に少し濃く */
  transform: translateY(-1px);
  /* 少し浮き上がる演出 */
}

#tournamentSearchBtn:active {
  transform: translateY(1px);
  /* 押したときに沈む演出 */
}

/* =========================================
   スマホ用レスポンシブ設定 (画面幅768px以下)
   ========================================= */
@media (max-width: 768px) {
  .tournament-controls {
    flex-direction: column;
    /* 縦並びにする */
    width: 90%;
    /* 横幅を少し狭める */
    gap: 15px;
  }

  /* プルダウンとボタンを横幅いっぱいにする */
  .tournament-controls select,
  #tournamentSearchBtn {
    width: 100%;
    max-width: 100%;
    text-align: center;
    /* 文字を中央に */
  }

  .tournament-controls .h2oo {
    font-size: 1.2rem;
    /* 見出しを少し小さく */
  }
}

/* ============================================
   トーナメント表スタイル（改善版）
   ============================================ */

.t-wrapper {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
  overflow-x: auto;
}

.t-container {
  display: flex;
  gap: 50px;
  min-height: 500px;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.t-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
}

.t-match-box,
.t-final-box {
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: relative;
}

.t-item {
  width: 200px;
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  border: 2px solid #3498db;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: #2c3e50;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
}

.t-item:hover {
  border-color: #2980b9;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
  transform: translateX(2px);
}

.t-item.win-team {
  background: linear-gradient(135deg, #e8f4f8 0%, #fff0f0 100%);
  border-color: #27ae60;
}

.t-score {
  font-weight: bold;
  color: #e74c3c;
  margin-left: 8px;
  font-size: 16px;
}

/* 線の描画 */
.t-item::after {
  content: "";
  position: absolute;
  right: -25px;
  top: 50%;
  width: 25px;
  height: 2px;
  background: #bdc3c7;
  transform: translateY(-50%);
}

.t-item.top::after {
  height: calc(50% + 17px);
  border-right: 2px solid #bdc3c7;
  top: 50%;
  width: 25px;
}

.t-item.bottom::after {
  height: calc(50% + 17px);
  border-right: 2px solid #bdc3c7;
  bottom: 50%;
  top: auto;
  width: 25px;
}

.t-final-box .t-item::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 50%;
  width: 25px;
  height: 2px;
  background: #bdc3c7;
  transform: translateY(-50%);
}

.t-winner-display {
  width: 200px;
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, #fff9e6 0%, #fff5e6 100%);
  border: 3px solid #f39c12;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  color: #d68910;
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.2);
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .t-container {
    gap: 30px;
    padding: 20px;
  }

  .t-item {
    width: 160px;
    font-size: 12px;
    padding: 10px 12px;
  }

  .t-item::after,
  .t-final-box .t-item::before {
    right: -15px;
    left: -15px;
    width: 15px;
  }
}

@media (max-width: 768px) {
  .t-wrapper {
    padding: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .t-container {
    gap: 20px;
    min-height: auto;
    padding: 15px;
  }

  .t-column {
    gap: 20px;
  }

  .t-match-box,
  .t-final-box {
    gap: 20px;
  }

  .t-item {
    width: 140px;
    font-size: 11px;
    padding: 8px 10px;
  }

  .t-item::after,
  .t-final-box .t-item::before {
    right: -12px;
    left: -12px;
    width: 12px;
  }

  .t-winner-display {
    width: 140px;
    font-size: 13px;
    padding: 12px;
  }
}

/* ===============================
   決勝戦テーブルスタイル
   =============================== */
.final-league-container,
.final-tournament-container {
  margin: 30px auto;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.final-league-container h3,
.final-tournament-container h3 {
  text-align: center;
  color: #2c3e50;
  font-size: 1.3em;
  margin-bottom: 20px;
  border-bottom: 2px solid #4cafef;
  padding-bottom: 10px;
}

.tournament-viewer iframe {
  width: 100vw;
  height: 50vh;
}