* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #1a1a1a; background: #f8fafc; line-height: 1.6; }

/* Header & Layout */
.site-header { background: #1b2a43; color: #fff; padding: 1.6rem 1rem; }
.site-brand { display: flex; align-items: center; gap: 1rem; max-width: 1100px; margin: 0 auto; }
.site-logo { width: 54px; height: 54px; border-radius: 10px; object-fit: contain; }
.site-brand h1 { margin: 0; font-size: 1.8rem; }
.site-brand p { margin: 0.15rem 0 0; color: #cbd5e1; }
.content { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }

/* Grid Improvements */
.apps-grid { 
  display: grid; 
  gap: 1.5rem; /* Increased gap for breathing room */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* auto-fill is usually better than auto-fit for small lists */
}

/* Card Improvements */
.app-card { 
  background: #fff; 
  border: 1px solid #e2e8f0; 
  border-radius: 16px; /* Slightly rounder for a modern feel */
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1); 
  padding: 1.5rem; 
  display: flex; 
  flex-direction: column; 
  text-align: center; /* Center-aligning content solves the misalignment */
  transition: transform 0.2s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
}

/* App Header & Identity */
.app-header { 
  display: flex; 
  flex-direction: column; /* Stack icon and text */
  align-items: center; 
  gap: 1rem; 
  margin-bottom: 1rem;
}

.app-card img { 
  width: 80px; /* Slightly larger icons look better in stacked layouts */
  height: 80px; 
  border-radius: 18px; 
  object-fit: cover; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.app-title { margin: 0; font-size: 1.25rem; font-weight: 800; color: #0f172a; }
.app-description { 
  margin: 0; 
  color: #475569; 
  font-size: 0.95rem; 
  flex-grow: 1; /* This pushes the links to the bottom of the card regardless of text length */
}

/* Links & Buttons */
.app-links { 
  display: flex; 
  flex-direction: column; /* Stack the main button and legal links */
  gap: 1rem; 
  margin-top: 1.5rem; 
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

/* Primary Button (Google Play) - Fixed */
.app-links a:first-child { 
  background: #1d4ed8; 
  color: #fff; 
  padding: 0.8rem 1.2rem; 
  border-radius: 8px; 
  display: block; 
  text-decoration: none; /* This removes the "ugly" underscore */
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-links a:first-child:hover { 
  background: #1e40af; 
  text-decoration: none; /* Ensures underscore doesn't reappear on hover */
}

/* Secondary Links (Privacy Policy, Terms & Deletion) */
.app-links a:not(:first-child) {
  background: transparent;
  color: #64748b;
  font-size: 0.75rem;
  padding: 0.3rem 0; /* Slightly more space for tapping on mobile */
  font-weight: 400;
  display: block; /* Stacks links vertically for a cleaner, centered look */
  text-decoration: none;
}

.app-links a:not(:first-child):hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Footer */
.site-footer { text-align: center; color: #64748b; font-size: 0.9rem; padding: 2rem 0; border-top: 1px solid #e2e8f0; background: #fff; }

@media (max-width: 680px) { 
  .site-brand { flex-direction: column; text-align: center; } 
}