/* =========================
   全体背景（行間の黒）
========================= */
body {
  margin: 0;
  background: #000;
  font-family: "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
}

/* =========================
   上部ヘッダー（ドラフト体感ツール）
========================= */
.site-header {
  background: #000;
  padding: 14px 18px 10px;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.site-title {
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 1px;
}

.site-header-line {
  margin-top: 10px;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
}

/* =========================
   説明文エリア
========================= */
.instruction-area {
  padding: 14px 18px 6px;
  background: #000;
}

.instruction-text {
  margin: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1.6;
}

.instruction-note {
  margin: 6px 0 0;
  font-size: 16px;
  color: #fff;
}

.required-mark {
  color: #ff3333;
  font-weight: 900;
}

/* =========================
   入力フォームテーブル
========================= */
.form-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 22px;
  padding: 18px 0;
  table-layout: fixed;
}

.form-table tr {
  background: linear-gradient(90deg, #1c8b3d, #2aa64f);
}

.form-table th,
.form-table td {
  border: none;
  padding: 18px;
  vertical-align: middle;
}

.form-table th {
  width: 240px;
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  text-align: left;
  white-space: nowrap;
}

.form-table td[colspan] {
  width: auto;
}

/* =========================
   入力欄
========================= */
.form-control {
  width: 100%;
  height: 54px;
  padding: 10px 14px;
  font-size: 20px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  background: #fff;
  box-sizing: border-box;
  border-radius: 2px;
}

/* =========================
   球団選択（PC：12個横並び）
========================= */
.team-select-12 {
  display: grid;
  grid-template-columns: repeat(12, max-content);
  gap: 12px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.team-option {
  position: relative;
  padding: 6px;
  border: 6px solid transparent;
  background: #fff;
  cursor: pointer;
  border-radius: 2px;
  user-select: none;
  box-sizing: border-box;
}

.team-option img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
}

/* ★重要：ラジオは透明にするが、クリックは生かす */
.team-option input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.team-option.selected {
  border-color: orange;
}

/* =========================
   ポジション選択
========================= */
.position-select {
  display: flex;
  gap: 18px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.position-option {
  position: relative;
  flex: 1;
  height: 72px;
  background: #fff;
  border: 6px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 2px;
  user-select: none;
  box-sizing: border-box;
}

.position-option input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.position-text {
  font-size: 26px;
  font-weight: 900;
  pointer-events: none;
}

.position-option.selected {
  border-color: orange;
}

/* =========================
   ポジション読み上げ
========================= */
.audio-select {
  display: flex;
  gap: 18px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.audio-option {
  position: relative;
  flex: 1;
  height: 72px;
  background: #fff;
  border: 6px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 2px;
  user-select: none;
  box-sizing: border-box;
}

.audio-option input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.audio-text {
  font-size: 26px;
  font-weight: 900;
  pointer-events: none;
}

.audio-option.selected {
  border-color: orange;
}

/* =========================
   登録 / リセットボタン
   ★iPhoneの青文字/標準装飾を無効化して中央寄せ
========================= */
.button-container {
  display: flex;
  gap: 22px;
  padding: 14px 18px 22px;
  background: #000;
}

.btn-primary,
.btn-secondary {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;

  color: #000;              /* ←青文字対策 */
  font-family: inherit;

  border-radius: 0;         /* iOSの丸みを消す */
  padding: 0;
  line-height: 1;

  display: flex;            /* 文字を確実に中央へ */
  align-items: center;
  justify-content: center;

  background: #e9e9e9;
  font-weight: 800;
  border: none;
  cursor: pointer;
}

.btn-primary {
  flex: 1;
  height: 88px;
  font-size: 34px;
}

.btn-secondary {
  width: 320px;
  height: 88px;
  font-size: 28px;
}

.btn-primary:active,
.btn-secondary:active {
  filter: brightness(0.95);
}

/* =========================
   Canvas / Overlay（iOS Safariの100vh問題対策版）
========================= */
html, body {
  height: 100%;
}

/* iOSでスクロールやズレが出にくいように */
body {
  overflow-x: hidden;
}

#fullScreenCanvas,
#overlayImage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  /* まずは通常ブラウザ向け */
  width: 100%;
  height: 100%;

  /* iOS Safariの動的ツールバー対策（優先して効く） */
  height: 100dvh;   /* iOS16+ */
  height: 100svh;   /* 一部環境の保険 */
  width: 100vw;

  display: none;
  z-index: 1000;
  background: #fff;

  /* iOSでの描画ズレ/はみ出しを抑える */
  overflow: hidden;
}

#overlayImage {
  z-index: 1001;

  /* 画像を必ず「枠内に収める」 */
  object-fit: contain;
  object-position: center;

  /* imgはinlineだと余計な隙間やズレが出ることがあるのでblock化 */
  display: none;          /* JSでblockにするならOK（下のJS修正も推奨） */
  width: 100%;
  height: 100%;

  /* ノッチ/ホームバー領域の安全対策（必要なら） */
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  box-sizing: border-box;

  transition: opacity 1s ease-out;
}


/* =========================
   オリジナル動画
========================= */
.original-movie-area {
  padding: 14px 18px 40px;
  background: #000;
}

.original-movie-title {
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 12px;
}

.original-movie-embed {
  max-width: 980px;
  aspect-ratio: 16 / 9;
  background: #111;
  width: 100%;
}

.original-movie-embed iframe {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================
   関連サイト
========================= */
.related-sites {
  margin-top: 12px;
}

.related-sites-title {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  margin: 10px 0 6px;
}

.related-sites-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.related-sites-list a {
  color: #2f57ff;
  text-decoration: underline;
  font-size: 16px;
}

/* =========================
   アンケート
========================= */
.survey-area {
  margin-top: 14px;
}

.survey-title {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  margin: 10px 0 6px;
}

.survey-area iframe {
  max-width: 100%;
  border: 0;
}

/* =========================
   変更履歴
========================= */
.change-log-area {
  margin-top: 14px;
}

.change-log-title {
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  margin: 10px 0 6px;
}

.change-log-list {
  padding-left: 20px;
  color: #fff;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

.change-log-list li {
  margin: 2px 0;
}

/* =========================
   最終更新日（フッター）
========================= */
.last-updated-area {
  padding: 10px 18px 16px;
  background: #000;
  color: #bbb;
  font-size: 14px;
  border-top: 1px solid #444;
}

/* =========================================================
   iPad / タブレット用（769px〜1100px）
   ★球団ロゴを 6×2 にして横はみ出しを防ぐ
========================================================= */
@media (min-width: 769px) and (max-width: 1100px) {
  .team-select-12 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .team-option {
    width: 100%;
    padding: 6px;
    border-width: 5px;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  .team-option img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
  }
}

/* =========================================================
   スマホ用レイアウト最適化（768px以下）
   ★球団ロゴ：6×2（折り返し） ※iPhoneで崩れにくい（flex-wrap）
   ★登録/リセット：スマホでも横並び
========================================================= */
@media (max-width: 768px) {
  /* 余白調整 */
  .site-header { padding: 12px 12px 8px; }
  .instruction-area { padding: 12px 12px 6px; }
  .button-container { padding: 12px 12px 18px; }
  .original-movie-area { padding: 12px 12px 28px; }
  .last-updated-area { padding: 10px 12px 14px; }

  .site-title {
    font-size: 24px;
    letter-spacing: 0.5px;
  }

  .instruction-text { font-size: 15px; }
  .instruction-note { font-size: 14px; }

  /* ===== テーブルを縦積みに ===== */
  .form-table {
    padding: 12px 0;
    border-spacing: 0 14px;
  }

  .form-table tr {
    display: block;
    padding: 8px 12px; /* ★上下を詰めて帯を細く */
  }

  .form-table th,
  .form-table td {
    display: block;
    width: 100%;
    padding: 0;
  }

  .form-table th {
    font-size: 16px;
    margin-bottom: 8px;
    white-space: normal;
  }

  .form-table td + td {
    margin-top: 10px;
  }

  .form-control {
    height: 46px;
    font-size: 16px;
  }

  /* ===== 球団：6×2（折り返し） flex-wrap ===== */
  .team-select-12 {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .team-option {
    flex: 0 0 calc((100% - 50px) / 6); /* gap10px×5=50px */
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 4px;
    border-width: 4px;
    border-style: solid;
    border-color: transparent;

    background: #fff;
    border-radius: 2px;
  }

  .team-option img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
  }

  /* ===== ポジション：2列 ===== */
  .position-select {
    flex-wrap: wrap;
    gap: 12px;
  }

  .position-option {
    flex: 0 0 calc(50% - 6px);
    height: 60px;
    border-width: 5px;
  }

  .position-text {
    font-size: 20px;
  }

  /* ===== 読み上げ：2ボタンなので横並び維持 ===== */
  .audio-option {
    height: 60px;
    border-width: 5px;
  }

  .audio-text { font-size: 20px; }

  /* ===== 登録/リセット：スマホでも横並び ===== */
  .button-container {
    flex-direction: row;   /* ★横並びにする */
    gap: 12px;
  }

  .btn-primary,
  .btn-secondary {
    flex: 1;              /* ★同じ幅にする */
    width: auto;
    height: 72px;
    font-size: 26px;
  }

  /* ===== 動画：100% ===== */
  .original-movie-embed {
    max-width: 100%;
  }

  /* ===== Googleフォーム：幅100% ===== */
  .survey-area iframe {
    width: 100% !important;
    height: 820px;
  }

  /* 文字サイズ調整 */
  .original-movie-title { font-size: 18px; }
  .related-sites-title,
  .survey-title,
  .change-log-title { font-size: 16px; }
  .related-sites-list a,
  .change-log-list { font-size: 14px; }
}

/* =========================================================
   さらに小さいスマホ（480px以下）
========================================================= */
@media (max-width: 480px) {
  .site-title { font-size: 20px; }

  /* 6列維持のまま、ロゴだけ少し小さく */
  .team-option img { width: 40px; height: 40px; }

  /* 誤タップ防止：ポジションは1列 */
  .position-option {
    flex: 0 0 100%;
  }

  .survey-area iframe {
    height: 880px;
  }
}