/* ==========================================
   ZHGUNLANDIA — MemeRepublic style
   ========================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Space Mono', 'Courier New', monospace;
  background: #fff;
  color: #111;
}

a { text-decoration: none; color: inherit; }

/* ========== RAINBOW ========== */
.rainbow {
  background: linear-gradient(90deg,
    #6ee86e 0%, #4dd9c0 18%, #4db8ff 34%,
    #a855f7 50%, #f472b6 66%, #fb923c 82%, #facc15 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== PORTRAIT OVERLAY ========== */
.portrait-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #808080;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 16vh;
  overflow: hidden;
}
.portrait-overlay.visible { display: flex; }

/* Island image — full width, shorter along Y */
.overlay-island {
  width: 100%;
  height: 36vh;
  object-fit: cover;
  object-position: center center;
  display: block;
  filter: brightness(0.62);
}

.rotate-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: -100px;
  position: relative;
  z-index: 1;
}

.rotate-svg {
  width: 150px;
  height: 172px;
}

/* Phone rotates portrait → landscape → portrait */
.phone-anim {
  transform-box: fill-box;
  transform-origin: center center;
  animation: phoneFlip 2.6s ease-in-out infinite;
}

@keyframes phoneFlip {
  0%   { transform: rotate(0deg); }
  18%  { transform: rotate(0deg); }
  52%  { transform: rotate(-90deg); }
  72%  { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

.rotate-text {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #fff;
  text-transform: uppercase;
}

/* ========== NAVBAR ========== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10000;
  height: 60px;
  background: #fff;
  border-bottom: 1.5px solid #e5e5e5;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 8px;
}

.navbar__logo {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar__right {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.nav-buy {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  background: #111;
  color: #fff;
  border-radius: 50px;
  padding: 9px 18px;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.nav-buy:hover { opacity: 0.75; }

/* ========== HAMBURGER ========== */
.nav-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #111;
  border-radius: 2px;
}

.navbar.portrait-mode {
  background: transparent;
  border-bottom-color: transparent;
}
.navbar.portrait-mode .nav-buy {
  display: none;
}
.navbar.portrait-mode .nav-hamburger span {
  background: #fff;
}
.navbar.portrait-mode .navbar__logo {
  display: none;
}

/* ========== NAV MENU ========== */
.nav-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10003;
  background: #fff;
  flex-direction: column;
  padding: 0 24px 40px;
}
.nav-menu.open { display: flex; }

.nav-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  border-bottom: 1.5px solid #e5e5e5;
  flex-shrink: 0;
}
.nav-menu__logo {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}
.nav-menu__close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #111;
  padding: 4px 8px;
}
.nav-menu__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 8px;
}
.nav-menu__link {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: #111;
  text-decoration: none;
  text-transform: uppercase;
  padding: 22px 0;
  border-bottom: 1px solid #f0f0f0;
  display: block;
}
.nav-menu__link:hover { color: #a855f7; }
.nav-menu__join {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #fff;
  border-radius: 50px;
  padding: 16px 24px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  margin-top: 24px;
}
.nav-menu__join:hover { opacity: 0.75; }

/* ========== SITE WRAP ========== */
.site-wrap {
  padding-top: 60px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== MAP SECTION ========== */
.map-section {
  width: 100%;
  flex-shrink: 0;
}

.map-wrap {
  position: relative;
  width: 100%;
  line-height: 0;
}

.map-img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

/* ========== HOTSPOTS ========== */
.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  z-index: 10;
}
.hotspot::before { content: '+'; }
.hotspot:hover {
  transform: translate(-50%, -50%) scale(1.25);
  background: rgba(0, 0, 0, 0.72);
}
.hotspot.active::before { content: '–'; }
.hotspot.active { background: rgba(0, 0, 0, 0.8); }

/* ========== MOBILE LANDSCAPE: map fills full screen ========== */
@media (orientation: landscape) and (max-height: 600px) {
  .site-wrap {
    height: 100vh;
    overflow: hidden;
    padding-top: 48px;
  }
  .navbar {
    height: 48px;
  }
  .map-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
  }
  .map-wrap {
    width: 100%;
    height: 100%;
  }
  .map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
  }
  .hotspot {
    width: 20px;
    height: 20px;
    font-size: 0.85rem;
  }
}

/* ========== OVERLAY ========== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.28);
  z-index: 10001;
  cursor: pointer;
}
.overlay.show { display: block; }

/* ========== PANELS ========== */
.panel {
  position: fixed;
  top: 0; right: 0;
  width: 100vw;
  height: 100dvh;
  background: #fff;
  z-index: 10002;
  overflow-y: auto;
  padding: 52px 36px 60px;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.panel.open { transform: translateX(0); }

.panel__close {
  position: absolute;
  top: 18px; right: 18px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}
.panel__close:hover { opacity: 0.7; }

.panel__title {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  line-height: 1.15;
  padding-right: 48px;
  margin-top: 6px;
}

.panel p {
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 0.76rem;
  line-height: 1.85;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: -6px;
}

.panel__group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  background: #111;
  color: #fff;
  border-radius: 50px;
  padding: 12px 20px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
  cursor: pointer;
}
.pill-btn:hover { opacity: 0.72; transform: translateY(-1px); }

.panel::-webkit-scrollbar { width: 3px; }
.panel::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

/* ========== LEADERBOARD ========== */
.lb-formula {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-top: -6px;
}

.lb-loading {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #aaa;
  text-transform: uppercase;
  padding: 16px 0;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid #f0f0f0;
  border-radius: 12px;
  background: #fafafa;
}

.lb-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e5e5e5;
}

.lb-rank {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  min-width: 28px;
  color: #111;
}
.lb-rank.gold   { color: #f59e0b; }
.lb-rank.silver { color: #9ca3af; }
.lb-rank.bronze { color: #b45309; }

.lb-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.lb-name {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-meta {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: #777;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.lb-meta b { color: #111; font-weight: 700; }

.lb-updated {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: #bbb;
  text-transform: uppercase;
  text-align: center;
  padding-top: 4px;
}
.lb-updated:empty { display: none; }

.lb-item { cursor: pointer; transition: background 0.15s; }
.lb-item:hover { background: #f2f2f2; }

/* ========== TOKEN DETAIL SHEET ========== */
.lb-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10004;
  cursor: pointer;
}
.lb-sheet-backdrop.show { display: block; }

.lb-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10005;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
}
.lb-sheet.open { transform: translateY(0); }

.lb-sheet__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-sheet__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 44px;
}

.lb-sheet__logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #e5e5e5;
  flex-shrink: 0;
}

.lb-sheet__name {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-sheet__rank {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 0.85rem;
  border: 2px solid #111;
  border-radius: 50px;
  padding: 5px 12px;
  flex-shrink: 0;
}

.lb-sheet__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 16px;
}

.lb-sheet__tile {
  background: #fafafa;
  border: 1.5px solid #f0f0f0;
  border-radius: 14px;
  padding: 13px 14px;
}

.lb-sheet__label {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #888;
  text-transform: uppercase;
}

.lb-sheet__value {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  margin-top: 4px;
}

.lb-sheet__tile--score {
  background: #111;
  border-color: #111;
}
.lb-sheet__tile--score .lb-sheet__label { color: rgba(255, 255, 255, 0.6); }
.lb-sheet__tile--score .lb-sheet__value {
  background: linear-gradient(90deg, #6ee86e, #4db8ff, #a855f7, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lb-sheet__addr-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #111;
  border-radius: 50px;
  padding: 11px 16px;
}

.lb-sheet__addr {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-sheet__copy {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #111;
  padding: 0 2px;
  flex-shrink: 0;
  line-height: 1;
}

@media (orientation: landscape) and (max-height: 600px) {
  .lb-sheet {
    left: 50%;
    right: auto;
    width: min(560px, 96vw);
    transform: translate(-50%, 105%);
  }
  .lb-sheet.open { transform: translate(-50%, 0); }
}

.lb-bar-wrap {
  height: 4px;
  background: #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}

.lb-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #6ee86e, #4db8ff, #a855f7);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.lb-score {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  min-width: 40px;
  text-align: right;
  color: #111;
}

/* ========== DESKTOP ========== */
@media (min-width: 1025px) {
  .site-wrap { min-height: calc(100vh - 60px); }
}
