@font-face {
  font-family: "Mojinomori Map JP";
  src: url("/map/fonts/NotoSansCJKjp-Regular.otf") format("opentype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

.moji-claim-atlas {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1200;
  width: min(360px, calc(100vw - 28px));
  color: #1e4935;
  font-family: "Mojinomori Map JP", "GenJyuuGothicLP", "Zen Maru Gothic", "M PLUS Rounded 1c", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
}

.moji-claim-atlas * {
  box-sizing: border-box;
}

.moji-claim-atlas-panel {
  overflow: hidden;
  max-height: min(720px, calc(100vh - 28px));
  border: 1px solid rgba(76, 128, 95, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 250, 0.96), rgba(239, 250, 242, 0.94)),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 32px rgba(27, 76, 52, 0.24), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  backdrop-filter: blur(8px);
  pointer-events: auto;
  touch-action: pan-y;
}

.moji-claim-atlas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(78, 128, 92, 0.18);
  background: rgba(228, 247, 233, 0.68);
}

.moji-claim-atlas-title {
  min-width: 0;
}

.moji-claim-atlas-title strong {
  display: block;
  color: #2d6f4b;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.moji-claim-atlas-title span {
  display: block;
  color: #5f8a70;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.moji-claim-atlas-toggle,
.moji-claim-atlas-action,
.moji-claim-atlas-page-button,
.moji-claim-atlas-row {
  appearance: none;
  border: 0;
  font: inherit;
}

.moji-claim-atlas-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #2f6f4b;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(70, 122, 87, 0.2) inset;
  cursor: pointer;
}

.moji-claim-atlas-toggle:hover {
  background: #ffffff;
}

.moji-claim-atlas-body {
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto auto;
  max-height: calc(min(720px, 100vh - 28px) - 58px);
  touch-action: pan-y;
}

.moji-claim-atlas.is-collapsed .moji-claim-atlas-body {
  display: none;
}

.moji-claim-atlas.is-collapsed {
  width: 188px;
}

.moji-claim-atlas-controls {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(78, 128, 92, 0.14);
}

.moji-claim-atlas-search,
.moji-claim-atlas-sort {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(76, 128, 95, 0.32);
  border-radius: 8px;
  color: #1f5038;
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-weight: 800;
}

.moji-claim-atlas-search {
  padding: 0 10px;
}

.moji-claim-atlas-sort {
  padding: 0 8px;
}

.moji-claim-atlas-stats {
  padding: 0 12px 9px;
  color: #658a73;
  font-size: 12px;
  font-weight: 800;
}

.moji-claim-atlas-list {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 8px 8px;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.moji-claim-atlas-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  width: 100%;
  gap: 9px;
  min-height: 46px;
  margin: 0 0 6px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #22523a;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(80, 135, 96, 0.12) inset;
  text-align: left;
  cursor: pointer;
}

.moji-claim-atlas-row:hover {
  background: rgba(233, 250, 238, 0.86);
}

.moji-claim-atlas-row.is-selected {
  background: linear-gradient(90deg, rgba(182, 239, 194, 0.9), rgba(255, 255, 250, 0.88));
  box-shadow: 0 0 0 2px rgba(64, 160, 95, 0.44) inset;
}

.moji-claim-atlas-pagination {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  padding: 0 12px 8px;
}

.moji-claim-atlas-pagination[hidden] {
  display: none;
}

.moji-claim-atlas-page-button {
  min-height: 30px;
  border-radius: 8px;
  color: #276141;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 1px rgba(74, 124, 92, 0.22) inset;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.moji-claim-atlas-page-button:hover:not(:disabled) {
  background: #ffffff;
}

.moji-claim-atlas-page-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.moji-claim-atlas-page-status {
  color: #658a73;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.moji-claim-atlas-avatar,
.moji-claim-atlas-shield {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex: 0 0 auto;
  image-rendering: pixelated;
  box-shadow: 0 0 0 1px rgba(41, 89, 58, 0.22), 0 2px 6px rgba(25, 71, 47, 0.16);
}

.moji-claim-atlas-shield {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(180deg, #6e8fe7, #3157b8);
  font-size: 18px;
  font-weight: 900;
  image-rendering: auto;
}

.moji-claim-atlas-name {
  overflow: hidden;
  color: #1f4f37;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moji-claim-atlas-meta {
  margin-top: 2px;
  color: #6f937c;
  font-size: 11px;
  font-weight: 800;
}

.moji-claim-atlas-pill {
  padding: 4px 7px;
  border-radius: 999px;
  color: #2d704c;
  background: rgba(206, 242, 217, 0.9);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.moji-claim-atlas-details {
  border-top: 1px solid rgba(78, 128, 92, 0.18);
  background: rgba(246, 253, 247, 0.76);
  padding: 10px 12px 12px;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.moji-claim-atlas-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.moji-claim-atlas-detail-name {
  color: #1f5038;
  font-size: 14px;
  font-weight: 900;
}

.moji-claim-atlas-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.moji-claim-atlas-action {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  color: #276141;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 1px rgba(74, 124, 92, 0.22) inset;
  font-weight: 900;
  cursor: pointer;
}

.moji-claim-atlas-action:hover {
  background: #ffffff;
}

.moji-claim-atlas-claims {
  display: grid;
  gap: 6px;
  max-height: 126px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.moji-claim-atlas-claim {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: #385d46;
  font-size: 11px;
  font-weight: 800;
}

.moji-claim-atlas-empty {
  padding: 18px 10px;
  color: #6b9078;
  font-weight: 800;
  text-align: center;
}

.moji-claim-atlas-badge {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #f7fff8;
  border-radius: 999px;
  color: #ffffff;
  background: #2f8b5b;
  box-shadow: 0 2px 8px rgba(21, 68, 43, 0.34), 0 0 0 2px rgba(47, 139, 91, 0.24);
  font-family: "Mojinomori Map JP", "GenJyuuGothicLP", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.moji-claim-atlas-badge.is-admin {
  background: #365fc2;
  box-shadow: 0 2px 8px rgba(27, 55, 132, 0.34), 0 0 0 2px rgba(54, 95, 194, 0.24);
}

@media (max-width: 700px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  #app,
  #root,
  .leaflet-container {
    max-width: 100vw;
    overflow: hidden;
  }

  .moji-claim-atlas {
    top: auto;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
  }

  .moji-claim-atlas-panel {
    position: relative;
    max-height: min(60vh, 560px);
    border-radius: 8px;
  }

  .moji-claim-atlas-header {
    padding: 10px 12px;
  }

  .moji-claim-atlas-toggle {
    width: 44px;
    height: 44px;
    font-size: 18px;
    font-weight: 900;
  }

  .moji-claim-atlas-body {
    position: relative;
    grid-template-rows: auto minmax(136px, 1fr) auto;
    max-height: calc(min(60vh, 560px) - 65px);
  }

  .moji-claim-atlas.is-collapsed {
    right: 10px;
    left: auto;
    width: auto;
  }

  .moji-claim-atlas.is-collapsed .moji-claim-atlas-panel {
    border-radius: 999px;
  }

  .moji-claim-atlas.is-collapsed .moji-claim-atlas-header {
    min-height: 44px;
    gap: 8px;
    padding: 0 4px 0 14px;
    border-bottom: 0;
    background: rgba(238, 252, 242, 0.94);
  }

  .moji-claim-atlas.is-collapsed .moji-claim-atlas-title strong {
    font-size: 14px;
    line-height: 44px;
    white-space: nowrap;
  }

  .moji-claim-atlas.is-collapsed .moji-claim-atlas-title span {
    display: none;
  }

  .moji-claim-atlas.is-collapsed .moji-claim-atlas-toggle {
    width: 44px;
    height: 44px;
    border-radius: 999px;
  }

  .moji-claim-atlas-controls {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .moji-claim-atlas-search,
  .moji-claim-atlas-sort,
  .moji-claim-atlas-action,
  .moji-claim-atlas-page-button {
    min-height: 44px;
  }

  .moji-claim-atlas-search,
  .moji-claim-atlas-sort {
    height: 44px;
    font-size: 14px;
  }

  .moji-claim-atlas-list {
    padding: 0 8px 10px;
  }

  .moji-claim-atlas.has-selection .moji-claim-atlas-list {
    padding-bottom: 198px;
  }

  .moji-claim-atlas-pagination {
    grid-template-columns: 44px 1fr 44px;
    padding: 0 10px 10px;
  }

  .moji-claim-atlas.has-selection .moji-claim-atlas-pagination {
    display: none;
  }

  .moji-claim-atlas-row {
    grid-template-columns: 38px 1fr;
    min-height: 54px;
    padding: 8px;
  }

  .moji-claim-atlas-avatar,
  .moji-claim-atlas-shield {
    width: 38px;
    height: 38px;
  }

  .moji-claim-atlas-details {
    display: none;
  }

  .moji-claim-atlas.has-selection .moji-claim-atlas-details {
    position: absolute;
    right: 8px;
    bottom: 8px;
    left: 8px;
    display: block;
    max-height: min(190px, 36vh);
    overflow: auto;
    border: 1px solid rgba(78, 128, 92, 0.22);
    border-radius: 8px;
    box-shadow: 0 -8px 24px rgba(27, 76, 52, 0.18), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  }

  .moji-claim-atlas-detail-head {
    margin-bottom: 6px;
  }

  .moji-claim-atlas-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 6px 0;
  }

  .moji-claim-atlas-action {
    width: 100%;
    padding: 0 8px;
  }

  .moji-claim-atlas-claims {
    max-height: 72px;
  }

  .moji-claim-atlas-claim {
    grid-template-columns: auto 1fr;
    min-height: 34px;
  }

  .moji-claim-atlas-claim span:last-child {
    display: none;
  }
}
