/**
 * Cupid AR - Main Styles
 * Valentine's Tech Booth - GDG On Campus CTU
 * Redesigned with Modern Valentine Theme
 */

/* ============================================
   CSS VARIABLES - Modern Valentine Pink
   ============================================ */
:root {
  /* Valentine Color Palette - Soft Pink */
  --color-primary: #FF6B9D;
  --color-primary-dark: #E91E63;
  --color-primary-light: #FFEBF1;
  --color-secondary: #FF85B3;
  --color-accent: #FF4081;
  
  /* Gradient Colors */
  --gradient-pink: linear-gradient(135deg, #FFB6C1 0%, #FFCDD2 50%, #FFC0CB 100%);
  --gradient-header: linear-gradient(180deg, #FFE4EC 0%, #FFFFFF 100%);
  --gradient-card: linear-gradient(135deg, #FFFFFF 0%, #FFF8FA 100%);
  
  /* Neutral Colors */
  --color-bg: #FFF8FA;
  --color-bg-card: #FFFFFF;
  --color-bg-light: #FFFBFC;
  --color-text: #2D2D2D;
  --color-text-light: #666666;
  --color-text-muted: #9E9E9E;
  --color-text-white: #FFFFFF;
  
  /* Status Colors */
  --color-success: #4CAF50;
  --color-warning: #FFC107;
  --color-error: #F44336;
  --color-info: #2196F3;
  
  /* Rarity Colors */
  --color-rarity-common: #9E9E9E;
  --color-rarity-rare: #2196F3;
  --color-rarity-epic: #9C27B0;
  --color-rarity-legendary: #FF9800;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  
  /* Border Radius - More rounded */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  /* Shadows - Softer pink tint */
  --shadow-sm: 0 2px 8px rgba(255, 107, 157, 0.08);
  --shadow-md: 0 4px 16px rgba(255, 107, 157, 0.12);
  --shadow-lg: 0 8px 32px rgba(255, 107, 157, 0.16);
  --shadow-xl: 0 12px 48px rgba(255, 107, 157, 0.2);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
  
  /* Font */
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-display);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
   /* padding: 0 var(--spacing-md); */
  padding: 32px;
}

.page {
  min-height: 100vh;
  padding: var(--spacing-lg) 0;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  flex-direction: column;
}

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* ============================================
   COMPONENTS: BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-primary-light);
}

.btn-google {
  background: white;
  color: var(--color-text);
  border: 1px solid #ddd;
  box-shadow: var(--shadow-sm);
}

.btn-google:hover:not(:disabled) {
  background: #f8f8f8;
  box-shadow: var(--shadow-md);
}

.btn-google img {
  width: 24px;
  height: 24px;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
}

.btn-lg {
  padding: var(--spacing-lg) var(--spacing-xl);
  font-size: 1.125rem;
}

/* ============================================
   COMPONENTS: CARDS
   ============================================ */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  margin-bottom: var(--spacing-md);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.card-body {
  color: var(--color-text-light);
}

/* ============================================
   COMPONENTS: NAVIGATION (Moved to bottom of file - Pill Style)
   ============================================ */

/* ============================================
   COMPONENTS: HEADER
   ============================================ */
.header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  padding: var(--spacing-lg);
  text-align: center;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: var(--spacing-lg);
}

.header-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.header-subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* ============================================
   COMPONENTS: USER CARD
   ============================================ */
.user-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--color-primary-light);
}

.user-info {
  flex: 1;
}

.user-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.user-stats {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ============================================
   COMPONENTS: STAT CARDS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.stats-label-contents {
  display: block;
}

.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   COMPONENTS: LEADERBOARD
   ============================================ */
.leaderboard-list {
  list-style: none;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  transition: transform var(--transition-fast);
}

.leaderboard-item:hover {
  transform: translateX(4px);
}

.leaderboard-item.top-1 { border-left: 4px solid gold; }
.leaderboard-item.top-2 { border-left: 4px solid silver; }
.leaderboard-item.top-3 { border-left: 4px solid #CD7F32; }

.leaderboard-rank {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.leaderboard-item.top-1 .leaderboard-rank,
.leaderboard-item.top-2 .leaderboard-rank,
.leaderboard-item.top-3 .leaderboard-rank {
  font-size: 1.25rem;
}

.leaderboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.leaderboard-info {
  flex: 1;
}

.leaderboard-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.leaderboard-items {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.leaderboard-score {
  font-weight: 700;
  color: var(--color-primary);
}

/* ============================================
   COMPONENTS: COLLECTIBLE GRID
   ============================================ */
.collectible-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

.collectible-item {
  aspect-ratio: 1;
  background: white;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm);
  transition: all var(--transition-fast);
  border: 2px solid transparent;
}

.collectible-item.collected {
  border-color: var(--color-success);
  background: #E8F5E9;
}

.collectible-item.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.collectible-icon {
  font-size: 2rem;
}

.collectible-name {
  font-size: 0.625rem;
  text-align: center;
  color: var(--color-text-muted);
}

/* ============================================
   COMPONENTS: BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 12px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
}

.badge-primary {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.badge-success {
  background: white;
  color: #2E7D32;
}

.badge-warning {
  background: #FFF8E1;
  color: #F57F17;
}

.badge-rarity-common { background: #E0E0E0; color: #424242; }
.badge-rarity-rare { background: #BBDEFB; color: #1565C0; }
.badge-rarity-epic { background: #E1BEE7; color: #7B1FA2; }
.badge-rarity-legendary { background: #FFE0B2; color: #E65100; }

/* ============================================
   COMPONENTS: MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 380px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
}

/* ============================================
   COMPONENTS: FORMS
   ============================================ */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--color-text);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--spacing-md);
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ============================================
   COMPONENTS: LOADING
   ============================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-primary-light);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   COMPONENTS: ALERTS
   ============================================ */
.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.alert-success {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
}

.alert-error {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #EF9A9A;
}

.alert-warning {
  background: #FFF8E1;
  color: #F57F17;
  border: 1px solid #FFE082;
}

.alert-info {
  background: #E3F2FD;
  color: #1565C0;
  border: 1px solid #90CAF9;
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden { display: none !important; }
.visible { display: block !important; }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--gradient-pink);
  z-index: 9999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-logo {
  width: 100px;
  height: 100px;
  animation: pulse-logo 2s ease-in-out infinite;
}

@keyframes pulse-logo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 107, 157, 0.3);
  border-top-color: #FF6B9D;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1rem;
  color: var(--color-primary-dark);
  font-weight: 500;
}

/* ============================================
   PAGE: LOGIN - Modern Valentine Design
   ============================================ */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  background: var(--gradient-pink);
  position: relative;
  overflow: hidden;
  z-index: 200; /* Above nav-bottom (100) */
}

/* Floating Hearts Animation */
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FF6B9D' opacity='0.15'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
  background-size: 20px 20px;
  background-repeat: repeat;
  opacity: 0.06;
  animation: float-hearts 20s linear infinite;
  pointer-events: none;
}

@keyframes float-hearts {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(5deg); }
}

.login-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  text-align: center;
  width: 100%;
  max-width: 360px;
}

.login-illustration {
  width: 180px;
  height: 180px;
  margin-bottom: var(--spacing-lg);
  animation: float 3s ease-in-out infinite;
}

.login-illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-logo {
  width: 100px;
  height: 100px;
  margin-bottom: var(--spacing-md);
  filter: drop-shadow(0 4px 12px rgba(255, 107, 157, 0.3));
}

.login-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: var(--spacing-xs);
  text-align: center;
  text-shadow: 0 2px 8px rgba(255, 107, 157, 0.2);
}

.login-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-2xl);
  text-align: center;
  font-weight: 500;
}

.login-prompt {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.login-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-xl);
}

/* Modern Google Button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  background: white;
  color: var(--color-text);
  border: none;
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  width: 100%;
}

.btn-google:hover:not(:disabled) {
  background: #f8f8f8;
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

.btn-google:active:not(:disabled) {
  transform: translateY(0);
}

.btn-google img,
.btn-google svg {
  width: 24px;
  height: 24px;
}

/* Login Footer */
.login-footer {
  margin-top: var(--spacing-2xl);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* Floating Hearts Decoration */
.floating-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.heart {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.4;
  animation: floatHeart 6s ease-in-out infinite;
}

.heart-1 { left: 10%; top: 15%; animation-delay: 0s; }
.heart-2 { right: 15%; top: 20%; animation-delay: 1s; font-size: 1.2rem; }
.heart-3 { left: 20%; bottom: 25%; animation-delay: 2s; font-size: 1rem; }
.heart-4 { right: 10%; bottom: 30%; animation-delay: 3s; }
.heart-5 { left: 50%; top: 10%; animation-delay: 4s; font-size: 1.8rem; }

@keyframes floatHeart {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(10deg); }
}

/* ============================================
   APP HEADER - Modern Dashboard Style
   ============================================ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  position: sticky;
  top: 0;
  z-index: 100;
  
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background-color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  background-color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  
}

.header-icon-btn {
  background: none;
  border: none;
  padding: var(--spacing-sm);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  padding: 16px;
  justify-content: center;
}

.header-icon-btn:hover {
  background: rgba(255, 107, 157, 0.1);
}

.header-avatar {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--color-primary-light);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.header-avatar:hover {
  transform: scale(1.05);
}

/* ============================================
   STATS GRID - Modern 4-Column
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.stat-card {
  /* display: flex;          Activates flexbox */
  flex-direction: row;    /* Aligns items horizontally (default) */
  align-items: center;    /* Vertically centers items inside the row */
  gap: var(--spacing-md); /* Adds space between the internal elements */
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg) var(--spacing-md);
  box-shadow: var(--shadow-sm);
}


.stat-icon {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon img {
  width: 46px;
  height: 46px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}

.section-link {
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--transition-fast);
}

.section-link:hover {
  opacity: 0.8;
}

/* ============================================
   LEADERBOARD - Modern Style
   ============================================ */
.leaderboard-list {
  list-style: none;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: white;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-sm);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.leaderboard-item:hover {
  transform: translateX(4px);
}

.leaderboard-rank {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  background: var(--color-text-muted);
  border-radius: var(--radius-full);
}

.leaderboard-rank-medal {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.leaderboard-rank-medal img {
  width: 32px;
  height: 32px;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
  background: linear-gradient(135deg, #FFD700, #FFA500);
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
  background: linear-gradient(135deg, #CD7F32, #8B4513);
}

.leaderboard-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid transparent;
}

.leaderboard-info {
  flex: 1;
}

.leaderboard-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
}

.leaderboard-stats {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.leaderboard-hearts {
  display: flex;
  align-items: center;
  gap: 4px;
}

.leaderboard-score {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.95rem;
}

/* ============================================
   PRIVATE LETTERS CARD
   ============================================ */
.letters-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-lg);
}

.letters-card-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.letters-icon {
  width: 48px;
  height: 48px;
}

.letters-icon-fallback {
  font-size: 2.5rem;
  line-height: 1;
}

.letters-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.letters-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.btn-letters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  background: var(--color-primary);
  color: white;
  border: none;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition-fast);
}

.btn-letters:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   BOTTOM NAVIGATION - Speech Bubble Style per Design
   ============================================ */
.nav-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 16px 16px 0 0;
  z-index: 100;
  padding: 20px var(--spacing-md) var(--spacing-md);
  padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom));
}

.nav-bottom-inner {
  display: flex;
  justify-content: space-evenly;
  align-items: flex-end;
  max-width: 400px;
  margin: 0 auto;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  background: transparent;
}

.nav-item.active {
  color: var(--color-primary);
}

.nav-item:hover:not(.active) {
  color: var(--color-primary);
}

.modal-card {
  max-width: 800px;
  border-radius: var(--radius-lg);
  background-color: white;
}


.nav-item-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: white;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  font-size: 32px;
}

.nav-item.active .nav-item-icon {
  background: var(--color-primary-light);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.25);
}

.nav-item-icon img {
  width: 32px;
  height: 32px;
}

/* Speech Bubble Label - Appears ABOVE the icon */
.nav-item-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 8px 16px;
  background: white;
  border-radius: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Speech bubble arrow/pointer */
.nav-item-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: white;
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   PAGE: MAP
   ============================================ */
.map-container {
  position: relative;
  background: #f0f0f0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--spacing-md);
}

.map-campus {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.map-marker {
  position: absolute;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -100%);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.map-marker:hover {
  transform: translate(-50%, -100%) scale(1.2);
}

.map-marker.collected {
  filter: grayscale(0);
}

.map-marker.locked {
  filter: grayscale(1);
  opacity: 0.5;
}

/* ============================================
   PAGE: AR SCANNER
   ============================================ */
.ar-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.ar-ui-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-md);
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
  pointer-events: auto;
}

.ar-ui-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-md);
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  pointer-events: auto;
}

.ar-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: var(--spacing-lg) var(--spacing-xl);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.ar-feedback.success { border: 3px solid var(--color-success); }
.ar-feedback.warning { border: 3px solid var(--color-warning); }
.ar-feedback.error { border: 3px solid var(--color-error); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 360px) {
  :root {
    font-size: 14px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 600px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .collectible-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-shake { animation: shake 0.5s ease-in-out; }
.animate-float { animation: float 3s ease-in-out infinite; }
