:root {
  --bg: #0b0f14;
  --panel: #121823;
  --text: #e8eefc;
  --muted: #aab6d3;
  --accent: #7aa7ff;
  --danger: #ff6b6b;
  --ok: #4ade80;
  --border: rgba(255, 255, 255, 0.08);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent);
}

h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.wrap {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
}

#map {
  height: 68vh;
}

/* -----------------------------
   Radar overlay
----------------------------- */
#radarOverlay {
  position: absolute;
  inset: 0;
  z-index: 9999;
  pointer-events: none; /* canvas is display-only; close btn will override */
}
#radarOverlay.hidden {
  display: none;
}

#radarCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

#radarClose {
  position: absolute;
  top: 12px;
  right: 12px;
  pointer-events: auto;
}

/* Make map container position context for overlay */
.mapWrap {
  position: relative;
}

.panel {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.kitPanel {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 10px;
  margin-top: 8px;
}

.kitPanel__header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.kitGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.kitSlot {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 8px 10px;
}

.kitSlot__icon {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
}

.kitSlot__content {
  min-width: 0;
}

.kitSlot__label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.kitSlot__item {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.kitSlot__bonus {
  margin-top: 2px;
}

@media (min-width: 720px) {
  .kitGrid {
    grid-template-columns: 1fr 1fr;
  }
}

.lootChips{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}

.chip{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
}

.btn--small{
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
}

.pill {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn--right {
  margin-left: auto;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
}

.status .ok {
  color: var(--ok);
}
.status .bad {
  color: var(--danger);
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.egg-icon {
  background: transparent !important;
  border: none !important;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* --- Popup scaling --- */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}

.leaflet-popup-content {
  margin: 10px 12px;
  width: 210px;
  min-width: 170px;
  max-width: 230px;
  font-size: var(--popupBodySize, 13px);
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: break-word;
}

.leaflet-popup-content b {
  display: block;
  margin-bottom: 4px;
  font-size: var(--popupTitleSize, 15px);
  line-height: 1.2;
}

.claim-btn {
  appearance: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: var(--popupPadY, 8px) var(--popupPadX, 10px);
  border-radius: var(--popupBtnRadius, 10px);
  font-size: var(--popupBodySize, 13px);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.claim-btn:active {
  transform: translateY(1px);
}

/* extracted from inline styles in the original HTML */
.filterPill {
  display: flex;
  gap: 6px;
  align-items: center;
}

.filterSelect {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 6px;
}

/* Radar button: visually distinct from pills */
.btn--radar{
  font-weight: 800;
  letter-spacing: .02em;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  transform: translateY(-1px);
}

/* Make disabled/cooldown obvious */
.btn--radar:disabled,
.btn--radar.isCooldown{
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(40%);
  transform: none;
  box-shadow: none;
}

/* Glow effect for claim ring (Leaflet SVG path) */
.leaflet-pane.leaflet-rings-pane path.claim-ring {
  filter:
    drop-shadow(0 0 2px rgba(96,165,250,0.70))
    drop-shadow(0 0 10px rgba(96,165,250,0.40))
    drop-shadow(0 0 18px rgba(96,165,250,0.22));
}

/* -----------------------------
   App modal
----------------------------- */
.appModal {
  position: fixed;
  inset: 0;
  z-index: 11000; /* above radarOverlay */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.appModal.hidden {
  display: none;
}

.appModal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
}

.appModal__dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(80vh, 680px);
  overflow: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 16px;
}

.appModal__header {
  margin-bottom: 10px;
}

.appModal__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.appModal__body {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
}

.appModal__inputWrap {
  margin-top: 14px;
}

.appModal__inputWrap.hidden {
  display: none;
}

.appModal__input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}

.appModal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn--danger {
  border-color: rgba(255, 107, 107, 0.35);
}

.btn--primary {
  border-color: rgba(122,167,255,.35);
  box-shadow: 0 8px 24px rgba(122,167,255,.12);
}

.loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.loadingOverlay.hidden {
  display: none;
}

.loadingCard {
  width: min(360px, 92vw);
  background: rgba(20, 24, 32, 0.96);
  color: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.loadingText {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.loadingBar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
}

.loadingBar__indeterminate {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.9), rgba(255,255,255,0.15));
  animation: loadingIndeterminate 1.1s infinite ease-in-out;
}

@keyframes loadingIndeterminate {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

/* Optional: make disabled buttons visibly busy */
button.is-busy,
.btn.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

/* =========================
   Egg Hunter Kit - visual refresh
   ========================= */

.kitPanel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02)),
    var(--panel);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.kitPanel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kitGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.kitSlot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 168px;
  padding: 12px 10px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01)),
    rgba(255,255,255,0.015);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.kitSlot:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 167, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(122,167,255,0.08), rgba(255,255,255,0.02)),
    rgba(255,255,255,0.02);
}

.kitSlot__iconWrap {
  width: clamp(52px, 7vw, 72px);
  height: clamp(52px, 7vw, 72px);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.kitSlot__iconImg {
  display: block;
  width: 72%;
  height: 72%;
  object-fit: contain;
  image-rendering: auto;
}

.kitSlot__label {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.kitSlot__item {
  min-height: 2.6em;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kitSlot__bonus {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.25;
  color: var(--accent);
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(122,167,255,0.10);
  border: 1px solid rgba(122,167,255,0.16);
  max-width: 100%;
}

/* Empty slot treatment */
.kitSlot .kitSlot__item:not(:empty),
.kitSlot .kitSlot__bonus:not(:empty) {
  word-break: break-word;
}

.kitSlot:has(.kitSlot__item:not(:empty)) {
  position: relative;
}

.kitSlot .kitSlot__item {
  color: var(--text);
}

.kitSlot .kitSlot__item:is(:where(:not(:empty))) {
  opacity: 1;
}

/* When app.js renders the dash / no equipment text, keep it visually muted */
.kitSlot__item {
  color: var(--text);
}

.kitSlot__item:where(:not(:empty)) {
  opacity: 1;
}

.kitSlot__item {
  overflow-wrap: anywhere;
}

.kitSlot__bonus {
  overflow-wrap: anywhere;
}

/* Responsive collapse */
@media (max-width: 980px) {
  .kitGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kitGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kitSlot {
    min-height: 156px;
    padding: 10px 8px;
  }

  .kitSlot__label {
    font-size: 11px;
  }

  .kitSlot__item {
    font-size: 13px;
  }

  .kitSlot__bonus {
    font-size: 11px;
  }
}

/* =========================
   Egg Hunter Kit refresh
   ========================= */

.kitPanel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
    var(--panel);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.kitPanel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kitGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.kitSlot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 170px;
  padding: 12px 10px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    rgba(255,255,255,0.015);
}

.kitSlot__iconWrap {
  width: clamp(52px, 7vw, 72px);
  height: clamp(52px, 7vw, 72px);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.kitSlot__iconImg {
  display: block;
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.kitSlot__label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.kitSlot__item {
  min-height: 2.6em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.kitSlot__bonus {
  margin-top: auto;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  line-height: 1.3;
  color: var(--accent);
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .kitGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kitGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kitSlot {
    min-height: 156px;
    padding: 10px 8px;
  }

  .kitSlot__label {
    font-size: 10px;
  }

  .kitSlot__item {
    font-size: 13px;
  }

  .kitSlot__bonus {
    font-size: 11px;
  }
}