/* =========================================================================
   Golf Map Web ビューア  スタイル
   ========================================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", Meiryo, sans-serif;
  background: #f4f5f7;
  color: #1a1a1a;
}

#app {
  height: 100%;
}

/* 画面切替：active なものだけ表示 */
.screen {
  display: none;
  height: 100%;
  flex-direction: column;
}
.screen.active {
  display: flex;
}

/* ---- 共通ヘッダ ---- */
.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #2e7d32;
  color: #fff;
  flex: 0 0 auto;
}
.app-header h1 {
  font-size: 18px;
  margin: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-header .sub {
  font-size: 13px;
  opacity: 0.9;
}
.header-btn {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ---- ログイン画面 ---- */
#screen-login {
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  padding: 40px 32px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  max-width: 360px;
  width: calc(100% - 32px);
}
.login-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #2e7d32;
}
.login-card p {
  margin: 0 0 24px;
  color: #555;
  font-size: 14px;
}
.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
  color: #3c4043;
  font-weight: 500;
}
.google-btn:hover {
  background: #f7f8f8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.google-g {
  width: 18px;
  height: 18px;
}
.error {
  color: #c62828;
  font-size: 13px;
  margin-top: 16px;
  min-height: 18px;
}

/* ---- ラウンド一覧 ---- */
#rounds-list {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.round-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.05s ease, box-shadow 0.1s ease;
}
.round-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.round-item:active {
  transform: scale(0.995);
}
.round-title {
  font-size: 16px;
  font-weight: 600;
}
.round-meta {
  font-size: 13px;
  color: #777;
  margin-top: 4px;
}
.status {
  padding: 16px;
  color: #777;
  font-size: 14px;
}

/* ---- 地図画面 ---- */
#screen-map .map-wrap {
  position: relative;
  flex: 1 1 auto;
}
#map {
  position: absolute;
  inset: 0;
}
#map-status {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 5;
}
#map-status:empty {
  display: none;
}

/* ホール切替バー */
.hole-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  flex: 0 0 auto;
}
.hole-btn {
  flex: 0 0 auto;
  min-width: 40px;
  padding: 8px 12px;
  border: 1px solid #2e7d32;
  background: #fff;
  color: #2e7d32;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}
.hole-btn.active {
  background: #2e7d32;
  color: #fff;
}

/* 距離ラベル（半透明白背景・赤文字）：Android の distanceLabelIcon 相当 */
.distance-label {
  position: absolute;
  background: rgba(255, 255, 255, 0.5);
  color: rgba(200, 0, 0, 0.85);
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  transform: translateZ(0);
}
