:root {
  --primary-color: #2c3e50;
  --accent-color: #3498db;
  --bg-color: #f4f7f6;
  --card-bg: #ffffff;
  --text-color: #333;
  --border-radius: 8px;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 20px;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

h1,
h2 {
  color: var(--primary-color);
  text-align: center;
}

h2 {
  margin-top: 40px;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 10px;
  display: inline-block;
}

/* Section Wrapper */
section {
  background: var(--card-bg);
  padding: 25px;
  margin-bottom: 25px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Leaderboard Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

tr:hover {
  background-color: #f1f1f1;
  transition: 0.2s;
}

.rank-header {
  width: 10%;
  text-align: center;
}

.name-header {
  width: 40%;
}

.badges-header {
  width: 50%;
  text-align: center;
}

.rank-cell {
  font-weight: bold;
  text-align: center;
  color: var(--accent-color);
}

/* Badge Legend */
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  border-left: 4px solid var(--accent-color);
}

.legend-emoji {
  font-size: 1.5rem;
  margin-right: 15px;
  width: 30px;
  text-align: center;
}

/* Staff List */
.staff-list {
  list-style: none;
  padding: 0;
}

.staff-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}

.staff-item:last-child {
  border-bottom: none;
}

.staff-info {
  flex: 1;
  min-width: 200px;
}

.staff-role {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

.staff-contact a {
  text-decoration: none;
  color: var(--accent-color);
  font-weight: 600;
  margin-left: 10px;
}

.staff-contact a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 600px) {
  .staff-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .staff-contact {
    margin-top: 10px;
    margin-left: 0;
  }
  .staff-contact a {
    display: inline-block;
    margin-left: 0;
    margin-right: 10px;
  }
}
/* Generic Contact Tags */
.contact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.contact-tag {
  background-color: var(--tag-bg, #eef2f5);
  color: var(--tag-text, #555);
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.85rem;
  border: 1px solid #dde2e6;
  white-space: nowrap;
}

.contact-tag strong {
  color: var(--primary-color, #2c3e50);
  font-weight: 600;
  margin-right: 4px;
}

/* Staff Item Layout Adjustments */
.staff-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* Changed to flex-start for multi-line tags */
  padding: 15px;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}

.staff-info {
  flex: 1;
  min-width: 200px;
  margin-right: 20px;
}

.staff-role {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  margin-bottom: 4px;
}
