/* === Reset & Global === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Base Layout untuk Peta dan Background Neon === */
html, body {
  height: 100%;
}
.background {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #0d0d0d url('assets/neon-bg.png') center/cover no-repeat fixed;
  z-index: -1;
}

/* === Body Utama === */
body {
  font-family: 'Orbitron', sans-serif;
  color: #fff;
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* === Header & Countdown === */
.header {
  padding: 20px;
  text-align: center;
  color: #0ff;
  text-shadow: 0 0 5px #0ff;
}
.countdown {
  margin-top: 10px;
  font-size: 16px;
  color: #ff0;
}

/* === Leaderboard Section === */
.leaderboard-section {
  padding: 20px;
  text-align: center;
}
.leaderboard-section h2 {
  margin-bottom: 1.2rem;
  font-size: 24px;
}

.leaderboard {
  position: relative;
  background: rgba(20, 10, 0, 0.5);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  color: #fff;
  animation: pulseGlow 3s infinite;
  border: 2px solid rgba(255, 149, 0, 0.3);
  overflow: hidden;
}
.leaderboard table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.leaderboard th, .leaderboard td {
  padding: 12px;
  font-size: 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.leaderboard th {
  background-color: rgba(255, 149, 0, 0.2);
  border-top: none;
}
.leaderboard tbody tr {
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.3s ease;
}
.leaderboard tbody tr:hover {
  background: rgba(0, 0, 0, 0.45);
}

/* === Border Radius Fix for Corners === */
.leaderboard thead tr th:first-child {
  border-top-left-radius: 12px;
}
.leaderboard thead tr th:last-child {
  border-top-right-radius: 12px;
}
.leaderboard tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}
.leaderboard tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

/* === Rank 1 Styling === */
.rank-1 {
  color: #000;
  font-weight: bold;
  animation: glowRow 2s ease-in-out infinite alternate;
}
.rank-1 td {
  background-color: #ffdf70;
  color: #000;
  font-weight: bold;
  box-shadow: inset 0 0 6px rgba(255, 215, 0, 0.3);
  border-radius: 0;
}
@keyframes glowRow {
  from { box-shadow: 0 0 10px rgba(255,215,0,0.4); }
  to   { box-shadow: 0 0 25px rgba(255,215,0,1); }
}

/* === Marquee (Text Berjalan) === */
.marquee-wrapper {
  margin: 28px auto 24px;
  overflow: hidden;
  width: 95%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 16px;
  border: 1px solid rgba(0, 255, 255, 0.4);
  box-shadow: 0 0 10px rgba(0,255,255,0.3), inset 0 0 6px rgba(0,255,255,0.2);
  max-width: 900px;
}
.marquee-inner {
  display: inline-block;
  white-space: nowrap;
  animation: marqueeScroll linear infinite;
  animation-duration: calc(15s + 0.15s * var(--length));
  --length: 0;
  color: #00ffff;
  font-weight: 600;
  font-size: 14px;
  text-shadow: 0 0 4px #0ff;
}
@keyframes marqueeScroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* === Menu and Buttons === */
.menu-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding: 0 12px;
}
.menu-buttons .menu-btn,
.menu-buttons button,
.menu-buttons a {
  background: #0ff;
  color: #000;
  border: 2px solid #0ff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  text-decoration: none;
  flex: 1 1 200px;
  max-width: 220px;
  text-align: center;
}
.menu-buttons .menu-btn:hover,
.menu-buttons button:hover,
.menu-buttons a:hover {
  background: #00ffffcc;
}

/* === Modal Popup (Daftar Hadiah) === */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0; left: 0;
  width: 100%; height: 100%;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.85);
}
.modal.show {
  display: block;
}
@keyframes popIn {
  0%   { transform: scale(0.5) translateY(-200px); opacity: 0; }
  60%  { transform: scale(1.1) translateY(20px); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}
.modal-content {
  background: radial-gradient(circle at top left,
                rgba(30,30,30,0.95),
                rgba(10,10,10,0.95));
  margin: 80px auto;
  padding: 30px;
  width: 90%;
  max-width: 600px;
  border-radius: 16px;
  border: 2px solid #ffd700;
  box-shadow:
    0 0 20px rgba(255,215,0,0.6),
    inset 0 0 10px rgba(255,215,0,0.4);
  animation: popIn 0.6s ease-out forwards;
  position: relative;
}
.modal .close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 28px;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255,215,0,0.8);
  cursor: pointer;
}

/* === Grid & Item untuk Daftar Hadiah === */
.reward-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin-top: 30px;
}
.reward-item {
  background: linear-gradient(145deg,
                rgba(40,40,40,0.9),
                rgba(20,20,20,0.9));
  width: 130px;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    0 0 8px rgba(255,215,0,0.3);
  transform: none;
  transition: transform 0.3s, box-shadow 0.3s;
}
.reward-item:hover {
  transform: scale(1.05);
  box-shadow:
    0 8px 20px rgba(0,0,0,0.6),
    0 0 16px rgba(255,215,0,0.7);
}
.reward-item.reward-winner {
  width: 180px;
  padding: 20px;
  border: 2px solid gold;
  box-shadow:
    0 0 20px rgba(255,215,0,1),
    inset 0 0 12px rgba(255,215,0,0.6);
}
.modal-content .reward-item img {
  max-width: 80px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto 8px;
}
.reward-img,
.reward-img-combo {
  max-width: 80px !important;
  width: auto !important;
  height: auto !important;
}
@keyframes floatMedal {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}
.reward-img, .reward-img-combo {
  animation: floatMedal 3s ease-in-out infinite;
}

/* === Styling for Merchant Info === */
#last-merchant {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  border-radius: 0;
  padding: 24px;
  margin-top: 30px;
  position: relative;
  color: #000;
  text-shadow: none;
  font-weight: bold;
  border: 2px solid rgba(255,215,0,0.5);
  box-shadow: 0 0 18px rgba(255,215,0,0.6);
  backdrop-filter: blur(6px);
  animation: pulseGlow 3s infinite;
}
#last-merchant h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #000;
}
#merchant-info p {
  font-size: 15px;
  color: #111;
  margin: 3px 0;
}

/* === Card Styling === */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
}
.anggota-card {
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 15px;
  width: 220px;
  box-shadow: 0 0 10px rgba(0,255,255,0.2);
  backdrop-filter: blur(6px);
  text-align: left;
}
.anggota-card h4 {
  color: #00ffff;
  margin-bottom: 10px;
  font-size: 18px;
}
.card-body p {
  margin: 4px 0;
  font-size: 14px;
}
.card-foot {
  margin-top: 12px;
  font-size: 13px;
}

/* === Team Header Styling === */
.team-header {
  font-size: 1.6rem;
  margin: 60px 0 20px;
  text-align: left;
  padding-left: 24px;
  color: #00ffff;
  text-shadow: 0 0 6px #0ff, 0 0 10px #00f;
  animation: fadeInSlide 0.9s ease-in-out both;
  position: relative;
}
.team-header::before {
  content: '🏁';
  position: absolute;
  left: 0;
  transform: translateX(-130%);
  font-size: 1.4rem;
  animation: flagWave 2s infinite ease-in-out;
}
@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes flagWave {
  0%, 100% {
    transform: translateX(-130%) rotate(-10deg);
  }
  50% {
    transform: translateX(-130%) rotate(10deg);
  }
}

/* === Glow Animation for General Effects === */
@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 10px rgba(255,149,0,0.4),0 0 20px rgba(255,149,0,0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(255,149,0,0.6),0 0 40px rgba(255,149,0,0.3);
  }
  100% {
    box-shadow: 0 0 10px rgba(255,149,0,0.4),0 0 20px rgba(255,149,0,0.2);
  }
}

/* === Map Container === */
#map {
  width: 100%;
  height: 500px;
}
.legend-box {
  position: absolute;
  top: 100px;
  right: 20px;
  background: rgba(255,255,255,0.07);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 12px rgba(0,255,255,0.3);
  border: 1px solid rgba(0,255,255,0.4);
  z-index: 1000;
  transition: all 0.3s ease-in-out;
}
.legend-box:hover {
  box-shadow: 0 0 20px rgba(0,255,255,0.5);
  transform: scale(1.02);
}
.legend-box h4 {
  margin-bottom: 8px;
  color: #0ff;
  text-shadow: 0 0 4px #0ff;
}
.legend-box .team {
  margin: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.legend-box .circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid #ccc;
}

/* === Tombol Tambahan di Mapping (Ganti Tampilan, Lokasi Saya, Fullscreen) === */
.map-buttons-wrapper {
  text-align: center;
  margin: 20px auto 10px;
}

.map-buttons-wrapper button,
#toggle-style, #locate-btn {
  background: #0ff;
  color: #000;
  font-weight: bold;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin: 4px 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  box-shadow: 0 0 10px rgba(0,255,255,0.5);
  transition: background 0.3s ease;
}

.map-buttons-wrapper button:hover,
#toggle-style:hover, #locate-btn:hover {
  background: #00ffffcc;
}

/* === Style Khusus Tombol Lokasi Saya === */
#locate-btn {
  background: #ffd700 !important;
  box-shadow: 0 0 10px rgba(255,215,0,0.6);
}

/* === Responsive Design === */
@media (max-width: 600px) {
  #map {
    height: 350px;
  }

  .leaderboard th, .leaderboard td {
    font-size: 12px;
  }

  .anggota-card {
    width: 90%;
  }

  .menu-buttons {
    flex-direction: column;
    gap: 12px;
    padding: 0 12px;
  }

  .menu-buttons .menu-btn,
  .menu-buttons button,
  .menu-buttons a {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .modal-content {
    width: 90%;
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
  }

  .reward-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 8px;
  }

  .reward-item {
    flex: 0 0 auto;
    margin-right: 16px;
  }

  .reward-grid::-webkit-scrollbar {
    display: none;
  }

  .marquee-inner {
    font-size: 13px;
    animation-duration: 12s;
  }

  .team-header {
    text-align: center;
    padding-left: 0;
    font-size: 1.4rem;
    margin: 40px 0 10px;
  }

  .team-header::before {
    position: static;
    display: block;
    margin: 0 auto 8px;
    transform: none;
    animation: none;
  }
}
/* === Tambahan Responsive untuk Legend Mapping === */
@media (max-width: 600px) {
  .legend-box {
    top: auto;
    bottom: 16px;
    right: 16px;
    width: calc(100% - 32px);
    font-size: 13px;
  }
}
