:root {
  --icon-size: 32px;
  --popup-border-radius: 10px;
  --popup-background: white;
  --idou-color: #F5A516;
  --syokuji-color: #85C127;
  --kaimono-color: #02B9EC;
  --syumi-goraku-color: #2166f4;
  --sonota-color: #616864;
  --pulse-color: #3498db;
  --marker-color: #fcff00;
}

/* マップコンテナを全画面に設定 */
#mapcontainer {
  width: 100vw;
  height: 100vh;
  position: relative;
  background-color: #0ab7ff;
  /* テキスト選択を無効にする */
  -webkit-user-select: none; /* Safari, Chrome用 */
  -moz-user-select: none; /* Firefox用 */
  -ms-user-select: none; /* IE用 */
  user-select: none; /* 標準 */
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

#logo-container {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 500;
  width: auto;
}

.icon-container {
  width: 32px;
  height: 32px;
  z-index: 200;
}

.base-icon {
  width: 100%;
  height: 100%;
}

#compass-container {
  width: 72px;
  height: 72px;
  rotate: -45deg;
}

#compass {
  width: 100%;
  height: 100%;
}

#animation-buttons {
  /* position: absolute;
  left: 18px;
  bottom: 108px; */
}

#animation-buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 24px;
  line-height: 1;
  background-color: white;
  border: none;
  border-radius: 50%;
  padding: 0;
  box-sizing: border-box;
}

#animation-buttons button .material-symbols-outlined {
  display: inline-block;
  transform: translateY(2px);
}

/* Bottom-left container: groups compass, language and radio controls */
#bottom-left-container {
  position: absolute;
  left: 16px;
  bottom: 24px;
  gap: 8px;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  pointer-events: auto;
  flex-direction: row;
}

#language-container {
  width: 70px;
  height: 56px;
  position: absolute;
  left: 18px;
  bottom: 108px;
  z-index: 1100;
}

#language-button {
  width: 100%;
  height: 100%;
  cursor: pointer;
  display: block;
}

#comment-container {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 180px;
  height: 56px;
  z-index: 1100;
  /* moved to bottom-right as requested */
}

#comment {
  width: 100%;
  /* または必要なサイズ */
  height: 100%;
  cursor: pointer;
}

#logo {
  width: 100px;
  height: auto;
}

.language-selector {
  position: relative;
  cursor: pointer;
}

.language-dropdown {
  display: none;
  position: absolute;
  bottom: 40px;
  /* 言語ボタンの上に表示 */
  left: 0;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  min-width: 120px;
  z-index: 1001;
}

.language-dropdown.show {
  display: block;
}

.language-option {
  padding: 8px 12px;
  color: #333;
  transition: background-color 0.2s;
}

.language-option:hover {
  background-color: #f5f5f5;
}

.language-option.selected {
  background-color: #e0e0e0;
  font-weight: bold;
}

/* デフォルトのLeafletクラスに対してスタイルを上書き */
.leaflet-marker-icon.custom-div-icon {
  pointer-events: none !important;
  height: 0px !important;
}

.leaflet-marker-icon.custom-div-icon div {
  pointer-events: none !important;
  height: 0px !important;
}

.leaflet-marker-icon.custom-div-icon.leaflet-zoom-animated {
  pointer-events: none !important;
  height: 0px !important;
}

.leaflet-marker-icon.custom-div-icon.leaflet-interactive {
  pointer-events: none !important;
  height: 0px !important;
}

.custom-div-icon {
  background: transparent;
  border: none;
  white-space: nowrap;
  text-align: center;
  transform: translate(-50%, -50%);
  text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff,
    2px 2px 0 #fff;
  pointer-events: none;
  height: 0px;
}

/* Leaflet画像レイヤーの回転 */
.leaflet-image-layer {
  transform: rotate(-45deg);
}

body {
  margin: 0;
}

.leaflet-popup {
  margin-bottom: 5px;
}

/* Popupのメインの長方形の部分 */
.leaflet-popup-content-wrapper {
  /* border: 3px solid; */
  border-radius: 10px;
  position: relative;
  background-color: white;
  overflow: visible;
}

/* Popupのアイコン部分の背景 */
.leaflet-popup-content-wrapper::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  background-color: white;
  /* border: 3px solid; */
  border-radius: 50%;
  z-index: 2;
}

.leaflet-popup-content-wrapper.idou,
.leaflet-popup-tip.idou,
.leaflet-popup-content-wrapper.idou::before {
  border: 3px solid var(--idou-color);
}

.leaflet-popup-content-wrapper.syokuji,
.leaflet-popup-tip.syokuji,
.leaflet-popup-content-wrapper.syokuji::before {
  border: 3px solid var(--syokuji-color);
}

.leaflet-popup-content-wrapper.kaimono,
.leaflet-popup-tip.kaimono,
.leaflet-popup-content-wrapper.kaimono::before {
  border: 3px solid var(--kaimono-color);
}

.leaflet-popup-content-wrapper.syumi_goraku,
.leaflet-popup-tip.syumi_goraku,
.leaflet-popup-content-wrapper.syumi_goraku::before {
  border: 3px solid var(--syumi-goraku-color);
}

.leaflet-popup-content-wrapper.sonota,
.leaflet-popup-tip.sonota,
.leaflet-popup-content-wrapper.sonota::before {
  border: 3px solid var(--sonota-color);
}

.leaflet-popup-content-wrapper::after {
  content: "";
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 19px;
  background-color: white;
  border-radius: 50% / 0 0 100% 100%;
  z-index: 2;
}

.leaflet-popup-content {
  position: relative;
  font-size: 10px;
  word-wrap: break-word;
  word-break: break-all;
  margin: 10px;
  max-width: calc(100vw - 300px);
  width: 100px;
  border: 3px;
  z-index: 3;
}

.popup-text-main {
  position: relative;
  text-align: start;
}

.truncate-single-line {
  /* 1. 要素の幅を超える長いテキストを折り返さないようにする */
  white-space: nowrap;

  /* 2. 要素の境界からはみ出た部分を非表示にする */
  overflow: hidden;

  /* 3. 非表示にした部分の代わりに三点リーダーを表示する */
  text-overflow: ellipsis;
}

.popup-text-auto-trans {
  position: relative;
  display: flex;
  /* Flexboxを使用 */
  align-items: center;
  /* 垂直方向の中央揃え */
  justify-content: flex-end;
  /* 右寄せ */
}
.popup-text-auto-trans img {
  width: 20px;
  height: 20px;
  margin-left: 5px;
  /* テキストとの間隔 */
}

.emotion-emoji {
  font-size: 25px;
  /* 絵文字のサイズ調整 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

/* Popupのアイコン部分 */
.popup-circle {
  position: absolute;
  /* アイコンの中心位置調整 */
  top: -44px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  z-index: 3;
}

.custom-popup {
  text-align: center;
  padding: 0px;
}

.icon-gif {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-size: cover;
  background-repeat: no-repeat;
}

.leaflet-popup {
  min-width: 100px;
}

.leaflet-marker-icon.idou,
.leaflet-marker-icon.syokuji,
.leaflet-marker-icon.syumi_goraku,
.leaflet-marker-icon.kaimono,
.leaflet-marker-icon.sonota {
  z-index: 100;
}

/* Popupの下の三角部分 */
.leaflet-popup-tip {
  position: relative;
  /* border: 3px solid; */
  border-radius: 100%;
  width: 13px;
  height: 22px;
  transform: rotate(0deg);
  overflow: visible;
  z-index: 100;
  z-index: 4;
  top: -7px;
}

.leaflet-popup-content::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16.5px;
  height: 4.5px;
  background-color: white;
  z-index: 5;
}

.png-overlay {
  position: absolute;
  top: 7%;
  left: 12%;
  width: 75%;
  height: 75%;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
}

.button-container {
  display: flex;
  justify-content: stretch;
  /* 中身を右寄せ */
  align-items: center;
  gap: 20px;
  /* プルダウンとボタンの間隔 */
  width: 100%;
}

/* プルダウンのスタイル */
.comment-type-select {
  padding: 8px 12px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 6px;
  background-color: white;
  cursor: pointer;
  min-width: 100px;
  width: 100%;
  margin-bottom: 8px;
  /* コンテナの幅を100%に */
}

.comment-type-select:focus {
  outline: none;
  border-color: #007bff;
}

/* ----------------------------
   Custom radio design (revised)
   - White rounded container with two large options
   - Selected option: teal with white text
   - Unselected: light gray with darker text
   - Small circular indicator centered beneath each option
   - Works with the HTML structure:
     <div class="radio-label"><label class="radio-option"><input/><span class="radio-content">...</span><span class="radio-indicator"></span></label></div>
   ---------------------------- */

.radio-buttons {
  display: flex;
  gap: 4px;
  align-items: flex-start;
  background: #ffffff;
  padding: 4px 4px 16px;
  /* 下にインジケータ用の余白を確保 */
  border-radius: 4px;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 1200;
  /* 前面に表示 */
}

.radio-label {
  display: block;
}

/* 各ラジオのカード（幅を72pxに調整） */
.radio-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  /* 横幅を72pxに */
  height: 36px;
  /* 縦を36pxに */
  box-sizing: border-box;
  background: #e6e6e6;
  cursor: pointer;
  overflow: visible;
  /* 下部のインジケータを表示 */
  transition: transform 120ms ease, box-shadow 120ms ease;
}

/* ホバー/フォーカスで軽い浮き上がり */
.radio-option:hover,
.radio-option:focus-within {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

/* 中央のテキスト */
.radio-content {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 8px;
  line-height: 1.1;
  color: #6f6f6f;
  font-weight: 600;
  width: 100%;
  height: 100%;
  white-space: pre-line;
  box-sizing: border-box;
}

/* 非表示にする本来の input（順序: input + .radio-content + .radio-indicator） */
.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

/* 下部の小さな丸（インジケータ） */
.radio-indicator {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #d0d0d0;
  background: transparent;
  box-sizing: border-box;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* 選択時の見た目（input:checked の隣接セレクタを利用） */
.radio-option input[type="radio"]:checked + .radio-content {
  background: #36b3b0;
  /* ティール */
  color: #ffffff;
}

.radio-option input[type="radio"]:checked ~ .radio-indicator {
  background: #36b3b0;
  border-color: #36b3b0;
  box-shadow: 0 0 0 4px rgba(54, 179, 176, 0.08);
}

/* 非選択時のテキスト色 */
.radio-option .radio-content {
  background: transparent;
  color: #6f6f6f;
}

/* いいねボタンのスタイル */
.like-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 5px 6px;
  border-radius: 20px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(1);
  transform-origin: center;
}

.like-button.not-liked {
  background-color: #f0f0f0;
  color: #666;
}

.like-button.liked {
  background-color: #ffebee;
  color: #e91e63;
}

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

.like-button:not(:disabled):hover {
  transform: scale(1.05);
}

/* 押している状態 - 明確に定義 */
.like-button.pressing {
  transform: scale(0.85) !important;
  background-color: #e0e0e0 !important;
}

/* 離している状態 - 明確に定義 */
.like-button.releasing {
  transform: scale(1.1) !important;
  background-color: #f5f5f5 !important;
}

.like-button.animating {
  animation: likedPulse 0.6s ease-out !important;
}

@keyframes likedPulse {
  0% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.15);
  }

  50% {
    transform: scale(1.1);
  }

  75% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* タッチデバイス用のハイライト除去 */
.like-button {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

#error-message {
  display: none;
}

/* レスポンシブ調整 */
@media (max-width: 480px) {
  #language-container {
    width: 56px;
    height: 44px;
    position: absolute;
    left: 4px;
    bottom: 96px;
  }

  #bottom-left-container {
    left: 4px;
    bottom: 24px;
  }

  #compass-container {
    width: 56px;
    height: 56px;
    rotate: -45deg;
  }

  .radio-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    /* 横幅を72pxに */
    height: 28px;
    /* 縦を36pxに */
    box-sizing: border-box;
    background: #e6e6e6;
    cursor: pointer;
    overflow: visible;
    /* 下部のインジケータを表示 */
    transition: transform 120ms ease, box-shadow 120ms ease;
  }

  .radio-content {
    font-size: 6px;
  }

  #animation-buttons button {
    width: 44px;
    height: 44px;
  }

  #comment-container {
    right: 4px;
    bottom: 24px;
    width: 140px;
    height: 44px;
  }
}

/* End custom radio design */
