/* 日本縦断トレイル（実績画面） */
.trail-map-card {
  --trail-primary: #38b48b;
  --trail-glow: rgba(56, 180, 139, 0.55);
  --trail-bg: #f4f6f8;
  --trail-panel: #fff;
  --trail-text: #333;
  --trail-muted: #666;
  --trail-input-bg: #f4f6f8;
  --trail-input-border: #e2e8f0;
  --trail-route-base: #94a3b8;
  --trail-icon-fill: #fff;
  margin-top: 4px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid #ebeff3;
}

.trail-map-card--japan {
  --trail-primary: #2eb086;
  --trail-glow: rgba(46, 176, 134, 0.45);
}

.trail-map-card--japan .trail-map-panel {
  background: linear-gradient(90deg, #159f90, #2eb086);
  color: #fff;
}

.trail-map-card--japan .trail-map-panel__title,
.trail-map-card--japan .trail-map-stats__label {
  color: rgba(255, 255, 255, 0.88);
}

.trail-map-card--japan .trail-map-stats__current {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.trail-map-card--japan .trail-map-stats__total {
  color: rgba(255, 255, 255, 0.82);
}

.trail-map-card--japan .trail-map-input {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.trail-map-card--japan .trail-map-input input {
  color: #fff;
}

.trail-map-card--japan .trail-map-input input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.trail-map-card--japan .trail-map-input__unit {
  color: rgba(255, 255, 255, 0.9);
}

.trail-map-card--japan .trail-map-panel__world-toggle {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.trail-map-card--world {
  --trail-primary: #6b8cff;
  --trail-glow: rgba(107, 140, 255, 0.5);
}

.trail-map-card--world .trail-map-panel {
  background: linear-gradient(90deg, #2a4a9a, #5b7cfa);
  color: #fff;
}

.trail-map-card--world .trail-map-panel__title,
.trail-map-card--world .trail-map-stats__label {
  color: rgba(255, 255, 255, 0.9);
}

.trail-map-card--world .trail-map-stats__current {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.trail-map-card--world .trail-map-stats__total,
.trail-map-card--world .trail-map-route {
  color: rgba(255, 255, 255, 0.88);
}

.trail-map-card--world .trail-map-input {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
}

.trail-map-card--world .trail-map-input input,
.trail-map-card--world .trail-map-input__unit {
  color: #fff;
}

.trail-map-card--world .trail-map-panel__world-toggle {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.trail-map-panel {
  position: relative;
  padding: 14px 16px 12px;
  background: var(--trail-panel);
  color: var(--trail-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.trail-map-panel__world-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 56px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--trail-input-border);
  background: var(--trail-input-bg);
  color: var(--trail-text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.trail-map-panel__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--trail-muted);
}

.trail-map-stats__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--trail-muted);
  letter-spacing: 0.06em;
}

.trail-map-route {
  margin: 4px 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-align: center;
}

.trail-map-stats {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.trail-map-stats__current {
  font-size: 2rem;
  font-weight: 800;
  color: var(--trail-primary);
  text-shadow: 0 0 12px var(--trail-glow);
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transform-origin: center center;
}

.trail-map-stats--animating .trail-map-stats__current {
  animation: trail-km-count-pulse 0.32s ease-in-out infinite;
}

.trail-map-card--japan .trail-map-stats--animating .trail-map-stats__current,
.trail-map-card--world .trail-map-stats--animating .trail-map-stats__current {
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
}

@keyframes trail-km-count-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}

.trail-map-stats__total {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--trail-muted);
}

.trail-map-input {
  display: flex;
  align-items: center;
  background: var(--trail-input-bg);
  border: 2px solid var(--trail-input-border);
  border-radius: 18px;
  padding: 4px 12px;
}

.trail-map-input:focus-within {
  border-color: var(--trail-primary);
}

.trail-map-input input {
  width: 88px;
  border: none;
  background: transparent;
  color: var(--trail-text);
  font-size: 1.05rem;
  font-weight: 800;
  text-align: right;
  outline: none;
  font-family: inherit;
}

.trail-map-input input::-webkit-outer-spin-button,
.trail-map-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.trail-map-input__unit {
  margin-left: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--trail-muted);
  white-space: nowrap;
}

.trail-map-input[hidden] {
  display: none !important;
}

.trail-map-panel,
.trail-collection {
  touch-action: pan-y;
}

.trail-map-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  background: var(--trail-bg);
  transition: height 0.38s cubic-bezier(0.34, 1.1, 0.64, 1);
  overscroll-behavior: contain;
  isolation: isolate;
}

.trail-map-wrap .leaflet-container {
  touch-action: none;
  font-family: inherit;
}

/* 右端ストリップ：見た目なし・縦スクロールのみ通す（地図ドラッグは無効） */
.trail-map-scroll-gutter {
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 100%;
  z-index: 420;
  touch-action: pan-y;
  pointer-events: auto;
  background: transparent;
}

.trail-map-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 450;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}

.trail-map-zoom__btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: #159f90;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.trail-map-zoom__btn:active {
  transform: scale(0.94);
  background: #e8f8f2;
}

.trail-map-card--world .trail-map-zoom__btn {
  background: rgba(42, 74, 154, 0.92);
  color: #c5d4ff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.trail-map-wrap--tier-1 {
  height: 440px;
}

.trail-map-wrap--tier-2 {
  height: min(68vh, 620px);
}

.trail-map-card--world .trail-map-wrap--tier-0 {
  height: 320px;
}

.trail-map-card--world .trail-map-wrap--tier-1 {
  height: 480px;
}

.trail-map-card--world .trail-map-wrap--tier-2 {
  height: min(72vh, 680px);
}

.trail-map-canvas {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.trail-walker {
  display: flex !important;
  justify-content: center;
  align-items: center;
  width: 40px !important;
  height: 40px !important;
}

.trail-walker__body {
  background: var(--trail-primary);
  border: 2px solid var(--trail-icon-fill);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 14px var(--trail-glow);
  z-index: 2;
}

.trail-walker__body svg {
  width: 18px;
  height: 18px;
  fill: var(--trail-icon-fill);
}

.trail-walker__pulse {
  position: absolute;
  width: 48px;
  height: 48px;
  background: var(--trail-glow);
  border-radius: 50%;
  animation: trail-walker-pulse 2s infinite ease-out;
  pointer-events: none;
}

@keyframes trail-walker-pulse {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

.trail-cp-label-host {
  background: transparent;
  border: none;
}

.trail-cp-label {
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 7.5em;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  pointer-events: auto;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.14);
}

.trail-cp-label__text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.trail-cp-label--pending {
  color: #64748b;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cbd5e1;
}

.trail-cp-label--reached {
  color: #fff;
  background: var(--trail-primary);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 12px var(--trail-glow);
}

.trail-map-card--world .trail-cp-label--pending {
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.72);
  border-color: #334155;
}

.trail-map-card--world .trail-cp-label--reached {
  border-color: #e2e8f0;
  box-shadow: 0 0 14px var(--trail-glow);
}

.trail-cp {
  display: flex !important;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-weight: 800;
}

.trail-cp--question {
  background: #64748b;
  color: #fff;
  border: 2px solid #fff;
  width: 20px !important;
  height: 20px !important;
  font-size: 11px;
  opacity: 0.75;
}

.trail-map-card--world .trail-cp--question {
  border-color: #0f172a;
  opacity: 0.55;
}

.trail-cp--flag {
  background: var(--trail-primary);
  color: #fff;
  border: 2px solid #fff;
  width: 26px !important;
  height: 26px !important;
  font-size: 13px;
  box-shadow: 0 0 14px var(--trail-glow);
}

.trail-map-card--world .trail-cp--flag {
  border-color: #e2e8f0;
  box-shadow: 0 0 18px var(--trail-glow);
}

.trail-collection {
  padding: 14px 14px 16px;
  background: var(--trail-panel);
  border-top: 1px solid var(--trail-input-border);
}

.trail-collection__title {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--trail-text);
}

.trail-collection__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.trail-collection-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.trail-collection-item__frame {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--trail-input-bg);
  border: 1px solid var(--trail-input-border);
  transition: transform 0.2s ease;
}

.trail-collection-item__more {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.trail-collection-item__more:active {
  transform: scale(0.94);
}

.trail-map-card--japan .trail-collection-item__more {
  background: rgba(255, 255, 255, 0.82);
  color: #334155;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.trail-collection-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.trail-collection-item--locked .trail-collection-item__img {
  object-fit: contain;
  padding: 18%;
  opacity: 0.85;
}

.trail-collection-item--locked .trail-collection-item__img--photo {
  object-fit: cover;
  padding: 0;
  filter: grayscale(0.35) brightness(0.72);
  opacity: 0.92;
}

.trail-collection-item__overlay--pending {
  background: rgba(15, 23, 42, 0.42);
  font-size: 0.62rem;
}

.trail-map-card--japan .trail-collection-item__overlay--pending {
  background: rgba(255, 255, 255, 0.55);
  color: #475569;
}

.trail-collection-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 6px;
  line-height: 1.35;
}

.trail-collection-item__overlay[hidden] {
  display: none !important;
}

.trail-collection-item--open .trail-collection-item__overlay--pending {
  display: none !important;
}

.trail-map-card--japan .trail-collection-item__overlay,
.trail-map-card--world .trail-collection-item__overlay {
  background: rgba(244, 246, 248, 0.88);
  color: #64748b;
}

.trail-collection-item__caption {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--trail-muted);
  text-align: center;
  line-height: 1.25;
}

.trail-collection-item--open {
  cursor: pointer;
}

.trail-collection-item--open .trail-collection-item__caption {
  color: var(--trail-primary);
}

.trail-collection-item--open:active .trail-collection-item__frame {
  transform: scale(0.96);
}

.trail-cp-float {
  background: transparent !important;
  border: none !important;
}

.trail-cp-float__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: trail-cp-float-rise 3.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  pointer-events: none;
}

.trail-cp-float__card img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 14px;
  border: 3px solid #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.trail-cp-float__placeholder {
  width: 112px;
  height: 112px;
  border-radius: 14px;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.trail-cp.trail-cp--flag {
  cursor: pointer;
}

.trail-cp-float__label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
}

@keyframes trail-cp-float-rise {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.55);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scale(1.06);
  }
  70% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-36px) scale(0.92);
  }
}

.trail-collection-item--planned {
  cursor: pointer;
}

.modal-sheet--trail-cp-detail {
  width: min(100%, 340px);
  max-width: 340px;
  padding: 16px 18px 18px;
  box-sizing: border-box;
}

.modal-sheet--trail-cp-detail h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
}

.trail-cp-detail__body {
  margin: 0 0 10px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
}

.trail-cp-detail__passed {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--trail-primary, var(--primary));
}

.modal-sheet--trail-cp-detail .btn-primary {
  width: 100%;
  margin-top: 0;
}

.trail-collection-item--planned .trail-collection-item__frame {
  border-style: dashed;
}
