/* =========================
   基本リセット
========================= */
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

/* =========================
   背景・基本
========================= */
body{
  font-family:"Segoe UI","Noto Sans JP",sans-serif;
  background: radial-gradient(circle at top, #163b80 0%, #091b3d 40%, #050c1f 100%);
  color:white;
  min-height:100vh;
  overflow-x:hidden;
  line-height:1.75;
}

body::before{
  content:"";
  position:fixed;
  width:500px;
  height:500px;
  background: radial-gradient(circle, rgba(77,163,255,0.25), transparent 70%);
  top:-120px;
  right:-120px;
  filter:blur(40px);
  z-index:-1;
}

/* =========================
   カレンダー
========================= */

.calendar-days{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  text-align:center;
  margin:20px 0 10px;
}

.calendar-days div{
  padding:8px;
  background:rgba(255,255,255,0.08);
  border-radius:10px;
  font-size:13px;
}

.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:10px;
}

.day-cell{
  background:rgba(255,255,255,0.05);
  backdrop-filter:blur(12px);
  min-height:120px;
  padding:8px;
  border-radius:14px;
  transition:0.25s;
  position:relative;
}

.day-cell:hover{
  transform:translateY(-3px);
  background:rgba(255,255,255,0.08);
}

.day-cell.empty{
  background:transparent;
}

.day-cell.highlight{
  border:2px solid #ffd60a;
  box-shadow:0 0 12px rgba(255,214,10,0.4);
}

/* =========================
   カレンダー内ミニカード
========================= */

.mini-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  margin-top:6px;
  padding:6px;
  background:rgba(36,59,85,0.9);
  border-radius:10px;
  text-decoration:none;
  color:white;
  font-size:11px;
  transition:0.25s;
}

.mini-card:hover{
  background:#2f4a75;
}

.mini-card img{
  width:28px;
  height:28px;
  margin-bottom:4px;
}

.mini-op{
  font-weight:bold;
  font-size:12px;
}

.mini-time{
  font-size:10px;
  opacity:0.8;
}

.mini-result{
  color:#ffd60a;
  font-weight:bold;
  font-size:10px;
}

/* =========================
   フィルターUI
========================= */

.search-bar{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-bottom:24px;
}

.opponent-box{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  font-size:13px;
}

.opponent-box label{
  background:rgba(255,255,255,0.08);
  padding:6px 10px;
  border-radius:8px;
  cursor:pointer;
  transition:0.2s;
}

.opponent-box label:hover{
  background:rgba(255,255,255,0.15);
}

/* =========================
   検索結果一覧
========================= */

.search-results{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:450px;
  overflow-y:auto;
  margin-top:10px;
}

.result-row{
  display:grid;
  grid-template-columns:50px 100px 80px 140px 1fr 80px;
  align-items:center;
  gap:12px;
  background:rgba(255,255,255,0.06);
  backdrop-filter:blur(12px);
  padding:10px 14px;
  border-radius:14px;
  text-decoration:none;
  color:white;
  transition:0.25s;
}

.result-row:hover{
  background:rgba(255,255,255,0.12);
  transform:translateY(-2px);
}

.row-logo{
  width:36px;
  height:36px;
}

.result-row span{
  font-size:13px;
}

/* =========================
   スクロールバー調整
========================= */

.search-results::-webkit-scrollbar{
  width:6px;
}

.search-results::-webkit-scrollbar-thumb{
  background:#4da3ff;
  border-radius:4px;
}


/* =========================
   ヘッダー
========================= */

header{
  position:sticky;
  top:0;
  backdrop-filter:blur(14px);
  background:rgba(10,25,60,0.55);
  border-bottom:1px solid rgba(255,255,255,0.08);
  z-index:1000;
}

nav{
  max-width:1100px;
  margin:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 20px;
}

.logo{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:bold;
  font-size:18px;
  letter-spacing:1px;
  text-decoration:none;
}

.logo span{
  background:linear-gradient(90deg,#4da3ff,#9ad0ff);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

.logo img{
  width:26px;
  height:26px;
  object-fit:contain;
  border-radius:6px;
  filter:drop-shadow(0 0 6px rgba(77,163,255,0.6));
  transition:0.3s;
}

.logo:hover img{
  transform:scale(1.08);
}

.logo:hover span{
  text-shadow:0 0 12px rgba(77,163,255,0.7);
}

/* メニュー */

.menu{
  display:flex;
  gap:26px;
}

.menu a{
  color:rgba(255,255,255,0.7);
  text-decoration:none;
  font-size:13px;
  position:relative;
  transition:0.25s;
}

.menu a::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-6px;
  width:0;
  height:2px;
  background:linear-gradient(90deg,#4da3ff,#7ecbff);
  transition:0.25s;
}

.menu a:hover{
  color:white;
  text-shadow:0 0 10px rgba(77,163,255,0.6);
}

.menu a:hover::after{
  width:100%;
}

/* =========================
   メインレイアウト
========================= */

main{
  max-width:1100px;
  margin:50px auto;
  padding:0 20px;
}

.glass-card{
  background:rgba(255,255,255,0.06);
  border-radius:22px;
  padding:32px;
  backdrop-filter:blur(16px);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.55),
    inset 0 0 0 1px rgba(255,255,255,0.1);
  transition:0.35s;
}

.glass-card:hover{
  transform:translateY(-4px);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.65),
    inset 0 0 0 1px rgba(255,255,255,0.16);
}

/* =========================
   フッター
========================= */

footer{
  margin-top:100px;
  background:rgba(0,0,0,0.35);
  backdrop-filter:blur(16px);
  border-top:1px solid rgba(255,255,255,0.08);
}

.footer-container{
  max-width:1100px;
  margin:auto;
  padding:50px 20px;
  display:grid;
  grid-template-columns:1.6fr 1fr 0.6fr;
  gap:50px;
}

.footer-logo{
  font-size:18px;
  font-weight:bold;
  margin-bottom:12px;
  background:linear-gradient(90deg,#4da3ff,#9ad0ff);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

.footer-text{
  font-size:12px;
  color:rgba(255,255,255,0.55);
  line-height:1.7;
}

.footer-title{
  font-size:12px;
  margin-bottom:14px;
  color:rgba(255,255,255,0.9);
}

footer a{
  text-decoration:none;
  font-size:12px;
  color:rgba(255,255,255,0.55);
  transition:0.25s;
}

footer a:hover{
  color:white;
  transform:translateX(4px);
  text-shadow:0 0 8px rgba(77,163,255,0.5);
}

.footer-bottom{
  text-align:center;
  padding:16px;
  font-size:11px;
  color:rgba(255,255,255,0.35);
  border-top:1px solid rgba(255,255,255,0.05);
}

/* =========================
   レスポンシブ
========================= */

@media(max-width:768px){
  .footer-container{
    grid-template-columns:1fr;
    gap:30px;
  }
}


/* =========================
   レスポンシブ（タブレット以下）
========================= */
@media (max-width: 1024px) {
  main {
    padding: 0 16px;
  }
  
  .glass-card {
    padding: 24px;
  }
  
  .search-results {
    max-height: 380px;
  }
}

/* =========================
   スマホ対応：カレンダーを縦1列に変更
========================= */
@media (max-width: 768px) {
  /* ヘッダーメニューをハンバーガーに切り替える準備（必要なら後で実装） */
  .menu {
    gap: 16px;
    font-size: 12px;
  }

  /* カレンダー曜日ヘッダー → 1列に */
  .calendar-days {
    grid-template-columns: 1fr;           /* 7列 → 1列 */
    margin: 16px 0 8px;
  }

  .calendar-days div {
    padding: 10px;
    font-size: 14px;                      /* 少し見やすく */
    background: rgba(255,255,255,0.06);
  }

  /* カレンダー本体 → 縦に並べる */
  .calendar-grid {
    grid-template-columns: 1fr;           /* 7列 → 1列 */
    gap: 12px;
  }

  .day-cell {
    min-height: 100px;                    /* 少しコンパクトに */
    padding: 12px 16px;
    display: flex;
    flex-direction: row;                  /* 左に日付、右に予定 */
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  /* 日付部分を強調 */
  .day-cell::before {
    content: attr(data-date);             /* HTML側で data-date="4/10" などの属性を付ける想定 */
    font-size: 18px;
    font-weight: bold;
    min-width: 50px;
    color: #9ad0ff;
  }

  /* ミニカードを横並び→縦並び対応しやすく */
  .day-cell .mini-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  /* 空セルは非表示or最小化 */
  .day-cell.empty {
    display: none;                        /* 完全に非表示でもOK */
    /* または min-height: 40px; background: transparent; */
  }

  /* 検索結果のグリッドもスマホ用に調整 */
  .result-row {
    grid-template-columns: 44px 1fr;      /* ロゴ + 残り全部 */
    grid-template-rows: auto auto;
    gap: 8px 12px;
    padding: 12px 14px;
  }

  .result-row > *:nth-child(2),
  .result-row > *:nth-child(3),
  .result-row > *:nth-child(4),
  .result-row > *:nth-child(5),
  .result-row > *:nth-child(6) {
    grid-column: 2 / 3;
  }

  .result-row span {
    font-size: 12px;
  }

  /* フィルターUIも縦にしやすく */
  .opponent-box {
    justify-content: center;
  }

  .search-results {
    max-height: 50vh;
  }
}

/* さらに小さい画面（例：横にするときも安心） */
@media (max-width: 480px) {
  .day-cell {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .mini-card img {
    width: 24px;
    height: 24px;
  }
  
  .mini-card {
    font-size: 10px;
  }
}



/* =========================
   game_detail 専用
========================= */

.game-detail table {
  border-collapse: collapse;
}

.game-detail td,
.game-detail th {
  border: 1px solid #ccc;
  padding: 4px;
  text-align: center;
}

.game-detail .lineups {
  display: flex;
  gap: 40px;
}

.game-detail #zone {
  display: grid;
  grid-template-columns: repeat(5, 50px);
  grid-template-rows: repeat(5, 50px);
  gap: 2px;
  margin-top: 10px;
}

.game-detail .zoneCell {
  border: 1px solid #333;
  font-size: 12px;
}

.game-detail .strike { background: yellow; }
.game-detail .ball { background: lightgreen; }
.game-detail .hit { background: deepskyblue; }
.game-detail .out { background: red; }

.game-detail #field {
  position: relative;
  width: 300px;
  height: 300px;
  border: 1px solid #000;
  margin-top: 10px;
}

.game-detail .base {
  position: absolute;
  width: 30px;
  height: 30px;
  background: gray;
}

.game-detail .runner {
  background: orange !important;
}

.countRow {
  margin-bottom: 6px;
  font-size: 14px;
}

.countLabel {
  margin-right: 8px;
  font-weight: bold;
}

.dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 4px;
  border: 1px solid #888;
}

.filled.ball   { background: green; }
.filled.strike { background: yellow; }
.filled.out    { background: red; }

.empty {
  background: transparent;
}

#zone{
  position:relative;
  width:380px;
  height:380px;
  margin:20px auto;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  grid-template-rows:repeat(5,1fr);
  border:3px solid white;
}

.zone-cell{
  border:1px solid rgba(255,255,255,0.2);
}

.strike-zone{
  background:rgba(77,163,255,0.12);
  border:1px solid rgba(77,163,255,0.5);
}

.pitchMarker{
  position:absolute;
  width:16px;
  height:16px;
  border-radius:50%;
  transform:translate(-50%,-50%);
  border:1px solid black;
}


/* ===== 守備フィールド表示 ===== */

#field {
  position: relative;
  height: 320px;
  background: radial-gradient(circle at center, #1c5d2e 0%, #0e3a1b 70%);
  border-radius: 50%;
  margin-top: 10px;
}

.fielder {
  position: absolute;
  background: white;
  color: black;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 12px;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}


.chart-box {
  width: 100%;
  max-width: 400px;   /* ← 好きなサイズ */
  height: 250px;      /* ← 高さ固定が超重要 */
  margin: 0 auto;
}

canvas {
  width: 100% !important;
  height: 100% !important;
}


/* =============================
   プロ仕様スコアボード
============================= */

.scoreboard-wrapper{
  overflow-x:auto;
  border-radius:14px;
}

.scoreboard-table{
  border-collapse:collapse;
  min-width:700px;
  width:100%;
  text-align:center;
  font-size:14px;
}

.scoreboard-table th,
.scoreboard-table td{
  padding:8px 10px;
  border:1px solid rgba(255,255,255,0.15);
}

.scoreboard-table thead{
  background:rgba(255,255,255,0.08);
}

.scoreboard-table tbody tr:first-child{
  background:rgba(255,255,255,0.05);
}

.scoreboard-team{
  text-align:left;
  padding-left:12px;
  font-weight:bold;
  white-space:nowrap;
}

.scoreboard-total{
  background:rgba(77,163,255,0.25);
  font-weight:bold;
}

.scoreboard-table th{
  font-weight:600;
  letter-spacing:0.5px;
}


/* =============================
   ワイドスコアボード
============================= */

#scoreboard{
  padding:0;
  background:none;
}

.scoreboard-wrapper{
  width:100%;
  overflow-x:auto;
}

.scoreboard-table{
  width:100%;
  min-width:100%;
  border-collapse:collapse;
  font-size:15px;
}

.scoreboard-table th,
.scoreboard-table td{
  border:1px solid rgba(255,255,255,0.15);
  padding:10px 12px;
}

.scoreboard-table thead{
  background:rgba(255,255,255,0.08);
}

.scoreboard-team{
  text-align:left;
  font-weight:600;
  padding-left:14px;
  width:160px;
}

.scoreboard-total{
  background:rgba(77,163,255,0.25);
  font-weight:bold;
}

.scoreboard-table tbody tr:hover{
  background:rgba(255,255,255,0.06);
}
