@charset "UTF-8";

/* ---------------------
レイヤー切り替え
---------------------*/
.layer-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--bg-color);
  padding: 15px;
  border-radius: 18px;
  box-shadow: 0 2px 10px var(--shadow-color);
  width: auto;
  max-width: 90%;
  box-sizing: border-box;
  overflow-y: auto;
  max-height: 90vh;
}

.layer-popup-content {
  position: relative;
}

.layer-popup-content .close-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-color);
  width: 40px;
  height: 40px;
}

.layer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.layer-item {
  width: 100%;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease;
  padding: 2px;
  border: none;
  background-color: transparent;
}

.layer-preview {
  width: 60px;
  height: 60px;
  /* containで全体を縮小して表示 */
  background-size: contain;
  background-repeat: no-repeat;
  background-color: var(--card-bg);
  border-radius: 8px;
  transition: transform 0.3s ease, border-color 0.3s ease;
  border: 2px solid transparent;
  margin: 0 auto;
  box-shadow: none;
}

.layer-item.selected .layer-preview {
  border-color: var(--primary-color);
  box-shadow: inset 0 0 0 2px var(--primary-color);
}

.layer-name {
  font-size: 14px;
  display: block;
  height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
  color: var(--text-color);
}

/* モバイル・タブレット用スタイル */
@media (max-width: 768px),
(hover: none) and (pointer: coarse) {
  .layer-popup {
    position: fixed;
    top: auto;
    bottom: 50px;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 18px 18px 0 0;
    padding: 20px 15px;
    animation: slideUp 0.3s ease-out;
  }

  @keyframes slideUp {
    from {
      transform: translateY(100%);
      opacity: 0;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .layer-popup-content {
    position: relative;
    padding-bottom: 20px;
  }

  .layer-grid {
    grid-template-columns: repeat(2, auto);
    gap: 100px;
    justify-content: center;
  }

  .layer-preview {
    width: 45px;
    height: 45px;
  }

  .layer-name {
    margin-top: 2px;
  }

  .layer-popup-content .close-btn {
    top: 5px;
    right: 5px;
    font-size: 18px;
  }

  /* ---------------------
モバイル非表示
---------------------*/

  /* 境界線マップ、通り名マップ、ひらがなマップ、地形図3Dを非表示 */
  .layer-item[data-style="boundary"],
  .layer-item[data-style="street"],
  .layer-item[data-style="kana"],
  .layer-item[data-style="terrain3d"] {
    display: none;
  }

}