:root {
  --bg-color: #f4f4f9;
  --card-bg: #ffffff;
  --text-primary: #333;
  --text-secondary: #666;
  --accent-color: #2d74da; /* Azul estilo Clash Royale */
  --accent-hover: #1a5bb8;
  --border-radius: 12px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  color: var(--accent-color);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

header p {
  color: var(--text-secondary);
}

main {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.card h2 {
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--bg-color);
  padding-bottom: 10px;
  text-align: center;
}

#clan-description {
  text-align: center;
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-top: 10px;
}

.stat {
  text-align: center;
}

.stat span {
  display: block;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent-color);
}

.members {
  list-style: none;
}

.member {
  display: grid;
  grid-template-columns: 25px 1fr repeat(4, 35px) 50px 40px;
  gap: 5px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.member:hover {
  background-color: #f9f9f9;
}

.member-header {
  display: grid;
  grid-template-columns: 25px 1fr repeat(4, 35px) 50px 40px;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 2px solid #ddd;
  font-weight: bold;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

.member-header .name {
  text-align: left;
}

.member:last-child {
  border-bottom: none;
}

.member-rank {
  font-weight: bold;
  color: var(--text-secondary);
  text-align: center;
}

.member-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* Puntos suspensivos si el nombre es muy largo */
  text-align: left;
}

.member-day {
  font-size: 0.85rem;
  text-align: center;
  color: #555;
  font-variant-numeric: tabular-nums;
}

.member-fame {
  font-weight: bold;
  color: var(--accent-color);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.member-decks {
  font-weight: bold;
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.9rem;
}

.war-timer {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
  font-variant-numeric: tabular-nums; /* Evita que los números salten al cambiar */
}

.list-separator {
  text-align: center;
  padding: 10px;
  background-color: #eee;
  color: var(--text-secondary);
  font-weight: bold;
  margin: 15px 0 5px 0;
  border-radius: var(--border-radius);
}

/* Ajustes para móviles */
@media (max-width: 480px) {
  body {
    padding: 15px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .card {
    padding: 15px;
  }
  
  /* Permitir scroll horizontal en la tabla de guerra si no cabe */
  .war-card {
    overflow-x: auto;
  }
  .member, .member-header {
    min-width: 350px; /* Asegura que no se rompa el grid en pantallas muy pequeñas */
  }
}