1/* ========== Base Styles ========== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  background: #111;
  color: #fff;
}

#topbar {
  height: 40px;
  border-bottom: 2px solid #FFF;
  background: #222;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 2000; /* bump it up */
}

#main-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 40px);
}

#map-container {
  width: 100%;
  height: 70vh;
  background: #000;
}

#minimap {
  width: 100%;
  height: 100%;
}

#tile-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.5rem;
  background: #111;
}

.tile-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 6px;
  background: #222;
  border: 2px solid #333;
}

/* ========== Scroll Cue ========== */

#scroll-cue {
  text-align: center;
  background: #111;
  color: #888;
  font-size: 0.75rem;
  padding: 6px 0;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
}

#scroll-cue i {
  animation: bounce 1s infinite;
  display: inline-block;
  margin: 0 4px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(-1px); }
  50% { transform: translateY(1px); }
}

/* Hide scroll cue on desktop/tablet */
@media (min-width: 768px) {
  #scroll-cue {
    display: none;
  }
}

/* ========== Desktop & Tablet Layout ========== */

@media (min-width: 768px) {
  #main-container {
    flex-direction: row;
    height: calc(100vh - 56px);
  }

  #map-container {
    width: calc(100vw - 300px);
    height: auto;
    aspect-ratio: unset;
    flex-shrink: 0;
  }

  #tile-container {
    max-width: 300px;
    height: auto;
    grid-template-columns: 1fr; /* 1 column on larger screens */
    overflow-y: auto;
  }
}

/* ========== Mobile-Only Adjustments ========== */

@media (max-width: 767px) {
  #tile-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tile-wrapper {
  position: relative;
  width: 100%;
}

.tile-label {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(255, 255, 255, 0.8);
  color: #000;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0px 6px 3px 6px;
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
}

.leaflet-control-attribution {
  display:none !important;
}

.rotate-icon {
  transform-origin: center center;
  transition: transform 0.3s ease;
}

.smooth-pie {
  transition: d 0.3s ease;
}

.flag-icon {
  height: 12px;
  margin-right: 6px;
  vertical-align: middle;
}

.tile-wrapper { position: relative; display: inline-block; }
.loader {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  background: url('/static/img/loading.svg') no-repeat center/contain;
}
.tile-thumb { opacity: 0; transition: opacity 0.4s ease; }
.tile-thumb.loaded { opacity: 1; }
