body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
}

/* 中央配置 */
.app-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* カードUI */
.card {
  background: white;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 350px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* タイトル */
h1 {
  margin-bottom: 5px;
}

.subtitle {
  margin-top: 0;
  font-size: 14px;
  color: #666;
}

.welcome-message {
  margin: 22px 0 18px;
  font-size: 16px;
  color: #111;
  white-space: nowrap;
}

/* 入力 */
.input-box {
  margin-top: 20px;
  width: 100%;
  height: 45px;
  font-size: 18px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid #ccc;
}

/* テキストボタン */
.text-btn {
  margin-top: 20px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* メインボタン */
.main-btn {
  display: block;
  width: 100%;
  margin: 15px 0;
  padding: 15px;
  font-size: 16px;
  color: white;
  background: linear-gradient(135deg, #6ea0c9, #4d7fa8);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s;
}

.main-btn:active {
  transform: scale(0.97);
}

.menu-divider {
  width: 100%;
  height: 1px;
  background: #dcdcdc;
  margin: 10px 0;
}

/* ヘッダー */
.header {
  width: 100%;
  padding: 15px;
  background: #5b8db8;
  color: white;
  text-align: center;
  font-size: 18px;
}

/* コート表示領域のフルスクリーン背景とサイズ指定 */
.court-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 50px); /* ← ヘッダ高さに合わせる */
  background: url('../img/court.jpg') no-repeat center center;
  background-size: contain;
}

.heatmap-layer {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  background: transparent;
  overflow: hidden;
}

.position-heatmap-point {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}

/* スマホ対応 */
@media (max-width: 480px) {
  .card {
    padding: 20px;
  }

  .welcome-message {
    font-size: 16px;
  }
}

/* コート上に表示するショットマーカーの基本スタイル */
.marker {
  position: absolute;
  padding: 0 10px;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  font-size: 12px;
  line-height: 1.2;
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  text-align: center;
  box-sizing: border-box;
  overflow: visible;
  white-space: nowrap;
}

.marker.summary {
  background: rgba(255, 156, 7, 0.95);
}

.marker.shot-1p {
  background: rgba(255, 156, 7, 0.95);
}

.marker.shot-2p {
  background: rgba(43, 124, 184, 0.95);
}

.marker.shot-3p {
  background: rgba(40, 170, 70, 0.95);
}

/* 画面共通のヘッダー表示バー */
.header-bar {
  position: relative;
  width: 100%;
  height: 50px;
  background: #5b8db8;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}

.header-title {
  pointer-events: none;
}

.header-nickname {
  position: absolute;
  left: 8px;
  top: 4px;
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
}

.header-action-menu {
  position: absolute;
  top: 4px;
  right: 4px;
  height: 36px;
  min-width: 96px;
  padding: 0 8px;
  font-size: 18px;
  font-weight: normal;
  text-align: center;
  text-align-last: center;
  border: 1px solid #8fb0cb;
  border-radius: 8px;
  background: #eef5fb;
  color: #000;
}

.header-action-menu option {
  text-align: center;
}

/* モーダル背景と中央配置を定義する共通スタイル */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(560px, calc(100% - 32px));
  background: #efefef;
  border: 1px solid #cfcfcf;
  padding: 16px 18px;
  box-sizing: border-box;
}

.modal-title {
  text-align: center;
  font-size: 24px;
  margin-bottom: 6px;
}

.modal-divider {
  border: none;
  border-top: 1px solid #8f8f8f;
  margin: 10px 0 14px;
}

.modal-section-title {
  font-size: 26px;
  margin-bottom: 10px;
  white-space: nowrap;
}

.modal-row {
  display: flex;
  align-items: center;
}

.modal-row-buttons {
  justify-content: space-between;
  padding: 0 14px;
}

.modal-row-inputs {
  justify-content: space-between;
  gap: 8px;
}

.modal-row-cancel {
  justify-content: flex-end;
  padding-right: 14px;
}

.modal-content button {
  min-width: 160px;
  height: 52px;
  font-size: 22px;
  border: 1px solid #b7b7b7;
  border-radius: 10px;
  background: linear-gradient(to bottom, #d6d6d6, #bfbfbf);
  cursor: pointer;
}

/* modal-btn-pm に特化したスタイル（詳細度を上げる） */
.modal-content button.modal-btn-pm {
  min-width: 44px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  box-sizing: border-box;
  font-size: 24px;
  border: 1px solid #8db4d0;
  border-radius: 8px;
  background: #6ea0c9;
  color: white;
  font-weight: bold;
  padding: 0;
}

.modal-content button.modal-btn-pm:active {
  transform: scale(0.95);
}

#btnOk,
#btnCancel,
#btnDelete {
  min-width: 110px;
  height: 44px;
}

#btnOk:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.modal-number-input {
  width: 120px;
  height: 44px;
  border: 1px solid #222;
  background: #fff;
  text-align: center;
  font-size: 24px;
}

.modal-slash {
  font-size: 30px;
  line-height: 1;
}

.modal-input-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 14px;
}

.modal-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-input-label {
  width: 150px;
  font-size: 18px;
  text-align: left;
  white-space: nowrap;
}



.modal-row-buttons-bottom {
  justify-content: center;
  gap: 12px;
  padding: 0;
}

.modal-row-buttons-bottom button {
  min-width: 140px;
  height: 48px;
  font-size: 18px;
}

/* 保存・分析条件モーダルの枠線と余白を定義 */
.save-modal-content {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  background: #f3f3f3;
  border: 1px solid #cfcfcf;
  padding: 24px 28px 22px;
  box-sizing: border-box;
  overflow-y: auto;
}

.save-modal-title {
  text-align: center;
  font-size: 24px;
  margin-bottom: 22px;
}

.save-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.save-modal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.save-modal-label {
  width: 120px;
  font-size: 18px;
  text-align: left;
}

.save-modal-section-label {
  width: 120px;
  font-size: 18px;
  text-align: left;
  text-decoration: underline;
}

.save-modal-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.save-modal-input {
  flex: 1;
  height: 44px;
  border: 1px solid #222;
  background: #fff;
  padding: 0 10px;
  font-size: 16px;
}

.save-modal-note {
  width: 100%;
  text-align: left;
  font-size: 16px;
  line-height: 1.6;
}

.save-modal-date {
  cursor: pointer;
  flex: 0 0 110px;
  width: 110px;
}

.save-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 24px;
}

.save-modal-actions button {
  min-width: 120px;
  height: 40px;
  font-size: 18px;
  border: 1px solid #b7b7b7;
  border-radius: 10px;
  background: linear-gradient(to bottom, #d6d6d6, #bfbfbf);
  cursor: pointer;
}

#saveOkBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .modal-title {
    font-size: 20px;
  }

  .modal-section-title {
    font-size: 19px;
  }

  .modal-content button {
    min-width: 120px;
    height: 46px;
    font-size: 20px;
  }

  #btnOk,
  #btnCancel {
    min-width: 90px;
    height: 40px;
    font-size: 20px;
  }

  .modal-number-input {
    width: 88px;
    height: 38px;
    font-size: 20px;
  }

  .modal-slash {
    font-size: 22px;
  }

  .save-modal-content {
    padding: 20px;
  }

  .save-modal-title {
    font-size: 18px;
  }

  .save-modal-label {
    width: 98px;
    font-size: 16px;
  }

  .save-modal-input {
    height: 34px;
    font-size: 15px;
  }

  .save-modal-actions button {
    min-width: 100px;
    height: 38px;
    font-size: 16px;
  }
}

/* ==========================
   ファイル選択モーダル
   ========================== */
/* ファイル選択用モーダルダイアログの基本レイアウト */
.open-modal-content {
  width: min(480px, calc(100% - 32px));
  background: #f3f3f3;
  border: 1px solid #cfcfcf;
  padding: 24px 28px 22px;
  box-sizing: border-box;
}

.open-modal-title {
  text-align: center;
  font-size: 20px;
  margin-bottom: 0;
}

.open-modal-section-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
}

.open-file-list {
  width: 100%;
  height: 160px;
  font-size: 15px;
  border: 1px solid #aaa;
  background: #fff;
  overflow-y: scroll;
  cursor: pointer;
  box-sizing: border-box;
}

.open-file-list option {
  padding: 6px 8px;
  cursor: pointer;
}

.open-file-list option:checked {
  background: #4d7fa8;
  color: #fff;
}

.open-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 20px;
}

.open-modal-actions button {
  min-width: 120px;
  height: 40px;
  font-size: 18px;
  border: 1px solid #b7b7b7;
  border-radius: 10px;
  background: linear-gradient(to bottom, #d6d6d6, #bfbfbf);
  cursor: pointer;
}

#openOkBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .open-modal-content {
    padding: 20px;
  }

  .open-modal-title {
    font-size: 18px;
  }

  .open-modal-actions button {
    min-width: 100px;
    height: 38px;
    font-size: 16px;
  }
}