body {
  margin: 0;
  font-family: "Inter", sans-serif;
  overflow: hidden;
  background: #050505;
  color: white;
  padding: 0;
  display: block;
}

footer {
  display: none;
}

#map-container {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  cursor: crosshair;
  position: fixed;
  inset: 0;          /* top:0 right:0 bottom:0 left:0 */
  z-index: 0;

  opacity: 0%;
  transition: opacity 0.45s ease;

  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
}

/* Wrapper that moves & scales together */
#map-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.sidebar,
#bottomMenu,
#popup {
  position: fixed;
  z-index: 1000;
}

#map {
  display: block;
  user-select: none;
  pointer-events: none;
  /* allows clicking markers on top */
  image-rendering: pixelated;
  /* Preserves pixel quality */
  image-rendering: crisp-edges;
  /* Fallback for older browsers */
  z-index: -1000;
  -webkit-user-drag: none;
  -webkit-user-select: none;
}

.kanto-points, .johto-points, .unova-points, .sevii-points {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.unova-points {
  transform: translateX(322px) translateY(0px);
}

.point {
  position: absolute;
  background: transparent;
  cursor: pointer;
  transition: background 0.75s ease;
  pointer-events: auto; 
}

.point:hover {
  background: #ffffff36;
}

.point-highlight {
  background: #f94fffaf;
}

#hover-label {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);

  background: rgba(0,0,0,0.78);
  color: white;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 13px;
  pointer-events: none;

  backdrop-filter: blur(3px);

  opacity: 0;
  transition: opacity 0.2s ease, bottom 0.45s ease;

  z-index: 2000;
}

#popup {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%) translateX(15px);
  background: rgba(0, 0, 0, 0.85);
  padding: 27px 20px;
  border-radius: 12px;
  max-width: 430px;
  min-width: 430px;
  display: none;
  backdrop-filter: blur(3px);

  font-size: 14px;

  max-height: 75vh;     /* ← limit height to screen */
  overflow-y: auto;     /* ← enable scrolling */

  opacity: 0%;
  transition: opacity 0.45s ease, transform 0.45s ease, height 0.45s ease;

  scrollbar-width: thin;
  scrollbar-color: #6b6969 transparent;

  z-index: 7;
}

#popup h3 {
  margin-top: 0;
  font-size: 18px;
}

#popup ul {
  padding-left: 0px;
  margin: 0;
  list-style: none;
}

.pokemon-table thead {
    text-align: left;
    color: white;
}

.pokemon-table {
    margin-top:8px;
    color:#8b8b8b
}

.pokemon-table a {
    text-decoration: none;
    color: #8b8b8b;
    transition: color 0.45s ease;
}

.pokemon-table a:hover {
    color: white;
}

.pokemon-table td,
.pokemon-table th {
  padding: 0px 4px; /* ↑ second value controls horizontal spacing */
}

#closeButtonLocation {
  width: 16px;
  height: 16px;
  cursor: pointer;
  float: right;
  margin-top: 0px;
}

.closeLocation {
  width: 16px;
  height: 16px;
  opacity: 0.3;
  transition: opacity 0.45s ease;
}
.closeLocation:hover {
  opacity: 1;
}
.closeLocation:before, .closeLocation:after {
  margin-left: 7px;
  margin-top: -3px;
  position: absolute;
  content: ' ';
  height: 17px;
  width: 2px;
  background-color: white;
}
.closeLocation:before {
  transform: rotate(45deg);
}
.closeLocation:after {
  transform: rotate(-45deg);
}

#zoom-ui {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Base ---------- */
#zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 4px;
  border-radius: 999px;
  outline: none;
}

/* ---------- WebKit track ---------- */
#zoom-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border-radius: 999px;
}

/* ---------- WebKit thumb ---------- */
#zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;

  width: 14px;
  height: 14px;
  border-radius: 50%;

  background: #896cf0;      /* ← main color */

  cursor: pointer;
  margin-top: -5px;         /* centers thumb on track */

  transition: transform 0.1s ease, background 0.15s ease;
}

#zoom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #896cf0;
}

/* ---------- Firefox track ---------- */
#zoom-slider::-moz-range-track {
  height: 4px;
  background: transparent;
  border-radius: 999px;
  border-color: transparent;
}

/* ---------- Firefox thumb ---------- */
#zoom-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border-color: transparent;

  background: #896cf0;

  cursor: pointer;

  transition: transform 0.1s ease, background 0.15s ease;
}

#zoom-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  background: #896cf0;
}


#zoom-label {
  font-size: 11px;
  opacity: 0.8;
  min-width: 40px;
  text-align: right;
}


#zoom-slider {
  background: linear-gradient(
    to right,
    #896cf0 0%,
    #896cf0 var(--zoom-percent, 50%),
    rgba(255,255,255,0.15) var(--zoom-percent, 50%),
    rgba(255,255,255,0.15) 100%
  );
}

#region-ui {
  position: fixed;
  top: 20px;
  right: 10px;
  z-index: 2000;

  background: rgba(0,0,0,0.85);
  padding: 5px;
  border-radius: 10px;
  backdrop-filter: blur(3px);

  opacity: 0%;
  transition: opacity 0.45s ease, transform 0.45s ease;
  transform: translateY(-10px);
}

#region-select {
  background: transparent;
  border: none;
  color: white;
  font-size: 11px;
  outline: none;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  text-align: center;
}

#region-select option {
    background: #0e0e0e;
    font-family: "Inter", sans-serif;
    font-weight: 600;
}

#zoom-debug {
  position: fixed;
  bottom: 50px;
  left: 8px;
  z-index: 2000;

  background: rgba(0, 0, 0, 0.85);
  padding: 8px 10px;
  border-radius: 10px;

  display: none; /*flex if visible*/
  align-items: center;
  gap: 8px;

  backdrop-filter: blur(3px);

  font-size: 13px;
}

#map-search-wrapper {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 5;
  width: 900px;
  max-width: calc(100vw - 32px);
  opacity: 100%;
  transition: opacity 0.45s ease, transform 0.45s ease;
  transform: translateX(-50%) translateY(0px);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
}

#mapSearchBar,
#mapSearchResults {
  box-sizing: border-box;
  width: 100%;
}

/* ===== SEARCH BAR SHELL ===== */
#search-bar-shell {
  display: flex;
  align-items: center;

  padding: 5px;

  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(3px);

  opacity: 0%;
  transition: opacity 0.45s ease;

  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.02);

  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
}

/* REAL INPUT = only left chunk */
#mapSearchBar {
  background: transparent;
  border: none;
  outline: none;
  color: white;

  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 11px;

  width: 70%;          /* ← controls how much is “real” input */
  min-width: 180px;
}

/* RIGHT SIDE CONTROLS */
#search-bar-controls {
  margin-left: auto;

  display: flex;
  align-items: center;
  gap: 10px;
}

/* region dropdown inside bar */
#region-select {
  background: transparent;
  border: none;
  color: white;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;   /* ← removes Safari default styling */
  appearance: none;
}

/* zoom slider compact */
#zoom-slider {
  width: 90px;
}

/* zoom label */
#zoom-label {
  font-size: 11px;
  opacity: 0.8;
  min-width: 36px;
  text-align: right;
}

#mapSearchResults {
  margin-top: 3px;
  background: rgba(0,0,0,0.85);
  border-radius: 12px;
  max-height: 0px;
  overflow-y: auto;
  scrollbar-color: #6b6969 transparent;
  backdrop-filter: blur(3px);
  transition: max-height 0.45s ease;
}

.poi-icon {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ===== MAP SEARCH RESULTS → MATCH GLOBAL SEARCH ===== */

#mapSearchResults .map-result {
  display: flex;
  align-items: center;
  margin-bottom: 3px;
  cursor: pointer;
  font-size: 14px;
  height: 42px;
}

/* fixed square for ALL icons */
#mapSearchResults .map-icon {
  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-right: 10px;
}

/* actual image keeps real size */
#mapSearchResults .map-icon img {
  max-width: 36px;
  max-height: 36px;

  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* behaves like .result-item a */
#mapSearchResults .map-name {
  flex: 1;
  white-space: nowrap;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* right-side type text */
#mapSearchResults .map-type {
  font-size: 14px;
  color: #6b6969;
}

.map-results-inner {
  background: transparent;
  padding: 20px;
}

#remainingTimeHeader, #gameTimeHeader {
  color: white;

  text-shadow:
    -1px  0   0 #000,
     1px  0   0 #000,
     0   -1px 0 #000,
     0    1px 0 #000,
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

.mobile-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between; /* ⭐ pushes time to far right */
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.time-wrapper.header {
  float: none;        /* ❌ disable float */
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.45s ease;
}

#mapsLogo {
  display: block;
  height: 22.5px;
  opacity: 1;
  transition: opacity 0.45s ease;
  margin-bottom: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  margin-top: -4px;
  filter:
    drop-shadow(-1px 0 0 #000)
  drop-shadow( 1px 0 0 #000)
  drop-shadow( 0 -1px 0 #000)
  drop-shadow( 0  1px 0 #000);
}


/* ===== ANNOUNCEMENT POPUP ===== */
#announcement {
  position: fixed;
  top: 135px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);

  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(3px);

  border-radius: 15px;

  padding: 14px 18px;
  width: auto;
  max-width: calc(100vw - 96px);

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.35s ease, transform 0.35s ease;

  z-index: 3000;
}

/* visible state */
#announcement.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.announcement-inner {
  position: relative;
}

/* text auto-sizes naturally */
#announcement-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

#alpha-alert-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
  max-width: calc(100vw - 60px);
  cursor: pointer;
}

.alpha-alert {
  color: white;
  padding: 12px 18px;
  border-radius: 15px;
  font-size: 13px;

  z-index: 2;

  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(3px);

  opacity: 0;
  transform: translateY(10px);
  transition: all 0.35s ease;

  pointer-events: auto;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.alpha-alert p {
  margin: 0;
  padding: 0;
}

.alpha-alert.show {
  opacity: 1;
  transform: translateY(0);
}

#alphaIcon {
  width: 24px;
  height: 24px;
  margin-right: 3px;
}

.alpha-map-icon {
    position: absolute;
    width: 18px;
    height: 18px;
    pointer-events: none;
    z-index: 5;
    image-rendering: pixelated;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.alpha-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alpha-top p {
    margin: 0;
}

.alpha-timer {
    color: #6b6969;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1025px) {
  #announcement {
    width: 100%;
    top: 145px;
  }

  #hover-label {
    bottom: 90px;
  }

  #alpha-alert-container {
    bottom: 90px;
    width: 100%;
  }

  #popup {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;                     /* ⭐ anchor to bottom */

    top: auto;

    max-width: 100%;
    min-width: 250px;

    border-radius: 16px 16px 0 0;  /* ⭐ rounded top like native sheet */

    transform: translateY(100%);   /* ⭐ hidden BELOW screen */
    opacity: 0;

    max-height: 80vh;
    max-height: 80svh;
    max-height: 80dvh;
    overflow-y: auto;

    padding: 24px 18px calc(85px + env(safe-area-inset-bottom));
    /* ⭐ safe-area support for iOS */

    transition:
      transform 0.35s cubic-bezier(.22,.8,.34,1),
      opacity 0.25s ease;

    z-index: 7;                 /* above bottom UI */
  }
  
  #zoom-ui {
    display: none;
  }

  #region-ui {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    display: none;
  }

  #map-search-wrapper {
    width: auto;
    top: 30px;
    transform: none;
    padding: 0 30px;
    left: 0;
    right: 0;
    z-index: 1;
  }

  .mobile-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between; /* ⭐ pushes time to far right */
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .time-wrapper.header {
    float: none;        /* ❌ disable float */
    display: flex;
    align-items: center;
    opacity: 1;
  }

  #mapsLogo {
    display: block;
    width: 200px;
    opacity: 1;
    transition: opacity 0.45s ease;
    margin-bottom: 0;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    margin-top: -4px;
  }
}