/* Border Hop — game-specific styles (screen shell reuses mapmaster.css) */

/* endpoints */
.bh-endpoints {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  max-width: 460px; margin: 8px auto 14px;
}
.bh-endpoint { flex: 1; text-align: center; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 12px 8px; }
.bh-endpoint-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 6px; }
.bh-endpoint-flag { display: flex; justify-content: center; margin-bottom: 6px; }
.bh-endpoint-flag .bh-flag-img { width: 56px; height: 37px; }
.bh-endpoint-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.bh-endpoint-arrow { font-size: 24px; color: var(--violet); flex: none; }

.bh-flag-img {
  width: 26px; height: 18px; object-fit: cover; border-radius: 3px;
  box-shadow: 0 0 0 1px var(--border-subtle); vertical-align: middle;
}

/* config checkbox */
.bh-check {
  display: flex; align-items: center; gap: 10px;
  margin: 16px auto 0; max-width: 320px;
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  cursor: pointer; font-size: 14px;
}
.bh-check input { width: 18px; height: 18px; accent-color: var(--violet); flex: none; }

/* autocomplete dropdown flag thumbnail — kept small (was oversized) */
.autocomplete-item { display: flex; align-items: center; gap: 8px; }
.autocomplete-thumb {
  width: 26px; height: 18px; flex: none;
  object-fit: cover; border-radius: 3px;
  box-shadow: 0 0 0 1px var(--border-subtle);
}

/* inline result (rendered under the map) */
.bh-inline-result { margin-top: 8px; text-align: center; }
.bh-inline-result.hidden { display: none; }
#bh-play-controls.hidden { display: none; }

/* subtle tier message — a small polished card with a colour-coded side accent
   (not a big plain banner) */
.bh-tier-msg {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; margin: 6px auto 16px; max-width: 460px;
  text-align: left; outline: none;
  font-size: 14px; color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lifted);
}
.bh-tier-msg.perfect { border-left-color: var(--mint); }
.bh-tier-msg.almost { border-left-color: #2AA0FF; }
.bh-tier-msg.average { border-left-color: #ffcd3c; }
.bh-tier-msg.miserable { border-left-color: var(--coral); }
.bh-tier-msg.gaveup { border-left-color: var(--coral-soft); }
.bh-star { color: var(--text-muted); font-size: 16px; flex: none; }
.bh-star.gold { color: #ffcd3c; }

/* map */
.bh-map {
  max-width: 560px; margin: 0 auto 14px;
  height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #0e1024;
  position: relative;
}
@media (max-width: 480px) { .bh-map { height: 240px; } }

/* route states painted onto the map's country paths */
.mm-country.bh-start path, .mm-country.bh-start .mm-dot {
  fill: #d6367f; stroke: #ff9ac6;
}
.mm-country.bh-target path, .mm-country.bh-target .mm-dot,
.mm-country.bh-route path, .mm-country.bh-route .mm-dot {
  fill: var(--mint); stroke: #b8ffe7;
}
.mm-country.bh-pending path, .mm-country.bh-pending .mm-dot {
  fill: #8b91bd; stroke: #c3c8ea;
}
/* out-of-scope countries when a continent is selected: shown for context only */
.mm-country.bh-inactive path, .mm-country.bh-inactive .mm-dot {
  opacity: 0.32;
}
/* opponent's route on the battle results map */
.mm-country.bh-opproute path, .mm-country.bh-opproute .mm-dot {
  fill: #ffb020; stroke: #ffd98a;
}

/* battle results map legend */
.bhb-map-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.bhb-map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bhb-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.bhb-sw-me { background: var(--mint); }
.bhb-sw-opp { background: #ffb020; }
.bhb-sw-start { background: #d6367f; }
.bhb-sw-target { background: var(--mint); box-shadow: 0 0 0 1px #b8ffe7; }
/* completion celebration pulse on the finished route */
.mm-country.bh-celebrate path, .mm-country.bh-celebrate .mm-dot {
  animation: bh-pulse 0.6s ease-in-out 0s 3;
}
@keyframes bh-pulse {
  0%, 100% { fill: var(--mint); filter: none; }
  50% { fill: #eafff6; filter: drop-shadow(0 0 6px var(--mint)); }
}
@media (prefers-reduced-motion: reduce) {
  .mm-country.bh-celebrate path, .mm-country.bh-celebrate .mm-dot { animation: none; }
}

.bh-avoid {
  max-width: 460px; margin: 0 auto 10px; padding: 8px 12px;
  border-radius: var(--radius-md); text-align: center; font-size: 13px;
  background: rgba(255, 107, 94, 0.10); border: 1px solid rgba(255, 107, 94, 0.4);
  color: var(--coral-soft);
}
.bh-avoid.hidden { display: none; }

.bhb-opp-done { color: var(--mint); font-weight: 700; }

.bh-best-count {
  padding: 3px 12px; border-radius: 999px; font-size: 12px;
  background: rgba(61, 220, 151, 0.14); color: var(--mint); font-weight: 600;
}
.bh-best-count strong { font-weight: 800; }

.bh-timer {
  padding: 3px 14px; border-radius: 999px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(139, 123, 255, 0.14); color: var(--text);
}
.bh-timer.urgent { background: rgba(255, 107, 94, 0.18); color: var(--coral-soft); animation: bh-timer-pulse 1s ease-in-out infinite; }
.bh-timer.hidden { display: none; }
@keyframes bh-timer-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.bh-diff-badge {
  width: max-content; margin: 0 auto 12px; padding: 3px 12px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(139, 123, 255, 0.14); color: var(--text);
}
.bh-diff-badge.easy { background: rgba(61, 220, 151, 0.14); color: var(--mint); }
.bh-diff-badge.medium { background: rgba(255, 205, 60, 0.16); color: #ffcd3c; }
.bh-diff-badge.hard { background: rgba(255, 107, 94, 0.16); color: var(--coral-soft); }

/* route chips */
.bh-route {
  max-width: 460px; margin: 0 auto 12px; min-height: 44px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px dashed var(--border-subtle);
}
.bh-route-static { border-style: solid; background: transparent; }
.bh-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
}
.bh-chip .bh-flag-img { width: 22px; height: 15px; }
.bh-chip-start { border-color: #d6367f; box-shadow: 0 0 0 1px #d6367f; }
.bh-chip-target { border-color: var(--mint); box-shadow: 0 0 0 1px var(--mint); }
.bh-chip-confirmed { border-color: var(--mint); }
.bh-chip-pending { border-color: #8b91bd; color: var(--text-muted); opacity: 0.9; }
.bh-chip-link { color: var(--text-muted); font-weight: 700; }
.bh-chip-gap { color: var(--border-strong); letter-spacing: 2px; }
.bh-pending-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 0 2px; align-self: center; }

.bh-input-row { max-width: 460px; margin: 0 auto; }

.bh-game-actions { max-width: 460px; margin: 12px auto 8px; display: flex; gap: 10px; }
.bh-giveup {
  display: block; margin: 0 auto; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px; text-decoration: underline; padding: 4px 8px;
}
.bh-giveup:hover { color: var(--coral-soft); }

/* daily preview */
.bh-daily-preview { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.bh-daily-flag .bh-flag-img, .bh-daily-flag img { width: 54px; height: 36px; object-fit: cover; border-radius: 5px; box-shadow: 0 0 0 1px var(--border-subtle); }
.bh-daily-arrow { color: var(--violet); font-size: 22px; font-weight: 700; }

/* result */
.bh-perfect-badge {
  display: inline-block; margin-bottom: 14px; padding: 5px 16px; border-radius: 999px;
  font-weight: 700; background: var(--mint); color: #063a24;
}
.bh-perfect-badge.hidden { display: none; }
.bh-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  max-width: 420px; margin: 0 auto 18px;
}
.bh-stat { background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 10px 12px; text-align: left; }
.bh-stat-key { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.bh-stat-val { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin-top: 2px; }
.bh-result-block { max-width: 460px; margin: 0 auto 14px; text-align: left; }
.bh-result-block.hidden { display: none; }

@media (max-width: 480px) {
  .bh-endpoint-flag .bh-flag-img { width: 46px; height: 30px; }
  .bh-endpoint-name { font-size: 13px; }
}
