/* バナー広告の高さ（ここを変えるだけで全HUDが追従） */
:root {
  --ad-height: 50px;
}

/* リセットと基本設定 */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

/* 地図コンテナ（画面全体） */
#map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

/* 操作ボタン群（右上） */
.ui-controls {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ui-controls button {
  background: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  min-height: 44px;
}

.ui-controls button:hover {
  background: #f0f4ff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.ui-controls button:active {
  background: #e0e8ff;
}

.ui-controls button:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.ui-controls button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 東京ドームオーバーレイ（画面中央固定） */
#dome-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  border-radius: 50%;
  background: rgba(229, 62, 62, 0.12);
  border: 2px dashed rgba(229, 62, 62, 0.55);
  pointer-events: none;
  /* サイズはJSで設定 */
}

/* バナー広告枠（下部固定） */
#ad-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--ad-height);
  z-index: 1000;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #aaa;
}

#privacy-link {
  position: absolute;
  right: 8px;
  bottom: 4px;
  font-size: 10px;
  color: #aaa;
  text-decoration: none;
  white-space: nowrap;
}

#privacy-link:hover {
  text-decoration: underline;
}

/* 下部コントロール（スライダー＋個数表示） */
#dome-controls {
  position: fixed;
  bottom: calc(var(--ad-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 16px;
  padding: 14px 24px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  text-align: center;
  min-width: 280px;
  max-width: calc(100vw - 32px);
}

/* 個数表示とシェアボタンを横並び */
#dome-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#dome-label {
  font-size: 16px;
  color: #333;
  line-height: 1;
  flex: 1;
}

/* シェアボタン */
#btn-share {
  background: #e53e3e;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity 0.2s;
}

#btn-share:hover {
  opacity: 0.8;
}

#dome-count-display {
  font-size: 28px;
  font-weight: bold;
  color: #e53e3e;
}

#dome-slider {
  width: 100%;
  height: 6px;
  accent-color: #e53e3e;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(to right, #e53e3e var(--slider-pct, 0.5%), #ddd var(--slider-pct, 0.5%));
  border-radius: 3px;
  outline: none;
}

#dome-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e53e3e;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

#dome-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e53e3e;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

#dome-slider:focus-visible {
  outline: 3px solid #e53e3e;
  outline-offset: 3px;
  border-radius: 3px;
}

/* コピー成功フィードバック */
.feedback {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  background: #333;
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s;
  white-space: nowrap;
}

.feedback.hidden {
  opacity: 0;
  pointer-events: none;
}

/* 東京ドームマーカー（赤色に着色） */
.tokyo-dome-marker {
  filter: hue-rotate(140deg) saturate(1.5);
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
  .ui-controls {
    top: 8px;
    right: 8px;
  }

  .ui-controls button {
    padding: 8px 12px;
    font-size: 13px;
  }

  #dome-controls {
    bottom: calc(var(--ad-height) + 8px);
    padding: 12px 16px 10px;
    min-width: 0;
    width: calc(100vw - 32px);
  }

  #dome-count-display {
    font-size: 24px;
  }

  #dome-label {
    font-size: 14px;
  }

  #btn-share {
    font-size: 12px;
    padding: 5px 10px;
  }
}
