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

body {
  background: #f4f4f0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family:
    "Space Grotesk",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  padding: 20px;
}

.screen {
  width: 390px;
  height: 844px;
  background: #fdfdf8;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 80px rgba(26, 77, 46, 0.15);
  padding: 20px;
}

.page-menu {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid #cad2c5;
}

.page-menu::-webkit-scrollbar {
  height: 0;
}

.menu-item {
  font-size: 16px;
  font-weight: 500;
  color: #52796f;
  cursor: pointer;
  white-space: nowrap;
  padding-bottom: 10px;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.menu-item.active {
  color: #2d9c6f;
  border-bottom-color: #2d9c6f;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.level-text {
  font-size: 24px;
  font-weight: 500;
  color: #1a1a1a;
}

.points-display {
  font-size: 32px;
  font-weight: 600;
  color: #2d9c6f;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 25px;
}

.stat-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(26, 77, 46, 0.08);
}

.stat-card.featured {
  background: #2d9c6f;
  color: #ffffff;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.stat-card.featured .stat-value {
  color: #ffffff;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: #52796f;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card.featured .stat-label {
  color: rgba(255, 255, 255, 0.85);
}

.event-banner {
  background: linear-gradient(135deg, #2b7a9f, #1a5f7a);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 25px;
  box-shadow: 0 4px 16px rgba(43, 122, 159, 0.25);
}

.event-icon {
  font-size: 32px;
}

.event-info {
  flex: 1;
}

.event-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.event-time {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.rank-section {
  margin-top: auto;
  text-align: center;
  padding: 20px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(26, 77, 46, 0.08);
}

.rank-label {
  font-size: 13px;
  font-weight: 500;
  color: #52796f;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.rank-icon {
  font-size: 80px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(232, 155, 60, 0.3));
}

.rank-icon img {
  width: 167px;
  height: 167px;
  object-fit: contain;
}

.rank-percentage {
  font-size: 24px;
  font-weight: 600;
  color: #2d9c6f;
}

.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

.map-container {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(26, 77, 46, 0.08);
}

.map-header {
  font-size: 20px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 20px;
}

#map {
  width: 100%;
  height: 350px;
  border-radius: 12px;
  margin-bottom: 20px;
  z-index: 1;
}

/* Full-page overlay modal */
.location-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.location-overlay.active {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.overlay-content {
  background: #ffffff;
  border-radius: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.overlay-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.overlay-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.popup-header {
  background: linear-gradient(135deg, #2d9c6f, #1a4d2e);
  padding: 60px 24px 24px;
  border-radius: 24px 24px 0 0;
}

.popup-title {
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.3;
}

.popup-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 8px;
}

.popup-body {
  padding: 24px;
  background: #ffffff;
  border-radius: 0 0 24px 24px;
}

.popup-detail {
  font-size: 15px;
  color: #1a1a1a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.popup-detail-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.popup-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 20px 0;
}

.popup-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #52796f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.popup-volunteer-info {
  background: #f0f9f4;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border-left: 4px solid #2d9c6f;
}

.popup-volunteer-text {
  font-size: 14px;
  color: #1a4d2e;
  line-height: 1.6;
  margin-bottom: 0;
}

.opportunities-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.popup-info-note {
  background: #fff3cd;
  color: #856404;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  margin: 8px 0 16px 0;
  border-left: 3px solid #ffc107;
}

.opportunity-card {
  background: #f0f9f4;
  padding: 16px;
  border-radius: 12px;
  border-left: 4px solid #2d9c6f;
  text-decoration: none;
  transition: all 0.3s ease;
  display: block;
}

.opportunity-card:hover {
  background: #e8f5e9;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(45, 156, 111, 0.2);
}

.opportunity-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a4d2e;
  margin-bottom: 6px;
  line-height: 1.3;
}

.opportunity-description {
  font-size: 13px;
  color: #52796f;
  margin-bottom: 6px;
  line-height: 1.4;
}

.opportunity-location {
  font-size: 12px;
  color: #52796f;
}

.popup-type {
  display: inline-block;
  background: #e8f5e9;
  color: #1a4d2e;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.popup-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #2d9c6f;
  color: #ffffff;
  text-decoration: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(45, 156, 111, 0.3);
}

.popup-link:hover {
  background: #1a4d2e;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(45, 156, 111, 0.4);
}

.popup-link.secondary {
  background: #ffffff;
  color: #2d9c6f;
  border: 2px solid #2d9c6f;
  box-shadow: none;
}

.popup-link.secondary:hover {
  background: #f0f9f4;
  transform: translateY(-2px);
}

.custom-marker {
  background: transparent !important;
  border: none !important;
}

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

.location-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.location-item {
  background: #fdfdf8;
  border: 2px solid #cad2c5;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.location-item:hover {
  border-color: #2d9c6f;
  transform: translateX(4px);
}

.location-icon {
  font-size: 24px;
}

.location-info {
  flex: 1;
}

.location-name {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.location-distance {
  font-size: 12px;
  color: #52796f;
}

.loading-spinner {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: #52796f;
}

.spinner {
  border: 3px solid #cad2c5;
  border-top: 3px solid #2d9c6f;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  background: #fef2f2;
  border: 2px solid #fca5a5;
  color: #991b1b;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  text-align: center;
}

.location-type {
  display: inline-block;
  background: rgba(45, 156, 111, 0.1);
  color: #2d9c6f;
  font-size: 10px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.refresh-btn {
  background: #2d9c6f;
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  width: 100%;
  transition: background 0.3s ease;
}

.refresh-btn:hover {
  background: #1a4d2e;
}

.location-details {
  font-size: 11px;
  color: #52796f;
  margin-top: 4px;
}

/* Redeem Page Styles */
.redeem-header {
  background: linear-gradient(135deg, #2d9c6f, #1a4d2e);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(45, 156, 111, 0.25);
}

.redeem-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.available-points {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.points-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.points-value {
  font-size: 32px;
  font-weight: 600;
  color: #ffffff;
}

/* Level-Up Bonus Card */
.levelup-card {
  background: linear-gradient(135deg, #e89b3c, #d97706);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(232, 155, 60, 0.3);
}

.levelup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.levelup-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.levelup-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.levelup-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.levelup-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.levelup-level {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.levelup-reward {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
}

.levelup-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.levelup-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.levelup-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.levelup-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

/* Rewards Section */
.rewards-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
}

.reward-card {
  background: #ffffff;
  border: 2px solid #cad2c5;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
}

.reward-card:hover {
  border-color: #2d9c6f;
  box-shadow: 0 4px 12px rgba(45, 156, 111, 0.15);
}

.reward-icon {
  font-size: 40px;
  flex-shrink: 0;
}

.reward-info {
  flex: 1;
}

.reward-name {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.reward-value {
  font-size: 13px;
  color: #52796f;
  font-weight: 500;
}

.reward-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.reward-cost {
  font-size: 14px;
  font-weight: 600;
  color: #2d9c6f;
}

.redeem-btn {
  background: #2d9c6f;
  color: #ffffff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.redeem-btn:hover {
  background: #1a4d2e;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(45, 156, 111, 0.3);
}

.redeem-btn.disabled {
  background: #cad2c5;
  color: #84a98c;
  cursor: not-allowed;
  pointer-events: none;
}

.redeem-btn.disabled:hover {
  transform: none;
  box-shadow: none;
}
