/* ===============================
   WPSL - Server List Styles (layout aggiornato 50/50 + header allineato)
   =============================== */

.wpsl-server-list {
  display: flex;
  flex-direction: column;
  gap: 25px;
  color: #fff;
  font-family: "Segoe UI", Roboto, sans-serif;
}

/* ====== GRUPPO GIOCHI ====== */
.wpsl-game-group {
  background: #111 url('../images/dark-mosaic.png') repeat;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.wpsl-game-title {
  margin: 0 0 12px 0;
  font-size: 1.4em;
  color: #fff;
  background: url(/wp-content/themes/editorial/assets/images/dark-mosaic.png) repeat center center !important;
  background-size: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 10px;
  border-left: 2px solid #009393;
  line-height: 18px;
  margin-bottom: 20px;
  min-height: 23px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wpsl-game-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

/* ====== CARD ====== */
.wpsl-card {
  display: flex;
  flex-direction: column;
  background: #111 url('../images/dark-mosaic.png') repeat;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.wpsl-card.online { border-left: 3px solid #4cff4c; }
.wpsl-card.offline { border-left: 3px solid #f44; }

.wpsl-card-left {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ====== HEADER ====== */
.wpsl-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

/* Riga bandiera + hostname + status */
.wpsl-card-row.wpsl-hostname {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.wpsl-flag-svg {
  width: 22px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

.wpsl-hostname-text {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wpsl-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.wpsl-status-dot.online { background: #4cff4c; box-shadow: 0 0 6px #4cff4c; }
.wpsl-status-dot.offline { background: #f44; box-shadow: 0 0 6px #f44; }

.wpsl-ip {
  font-size: 13px;
  color: #aaa;
  font-family: "Consolas", "Courier New", monospace; /* effetto tecnico */
  background: rgba(255,255,255,0.05);
  padding: 3px 6px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 4px;
  letter-spacing: 0.3px;
  transition: background 0.2s ease, color 0.2s ease;
}

.wpsl-ip.online:hover {
  background: rgba(0,255,170,0.08);
  color: #00ffaa;
}

.wpsl-ip.offline:hover {
  background: rgba(244, 68, 68, 0.08); /* rosso chiaro */
  color: #f44;
}

/* INFO GIOCO */
.wpsl-card-info-vertical {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;              /* più piccolo */
  color: #999;                  /* grigio più tenue */
  margin-top: 8px;
  font-style: italic;           /* corsivo */
  opacity: 0.85;                /* effetto più morbido */
  letter-spacing: 0.2px;
line-height: 1.3;
}

/* ====== BLOCCO PLAYERS ====== */
.wpsl-card-players {
  margin-top: 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 8px 10px;
  overflow-y: auto;
  max-height: 220px;
}

.wpsl-players-header {
  font-size: 15px;
  font-weight: 400;
  color: #00ffaa;
  margin-bottom: 6px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 4px;
}

/* LISTA GIOCATORI */
.wpsl-player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85em;
  line-height: 1.3em;
}

.wpsl-player-item {
  display: flex;
  justify-content: space-between;
  padding: 1px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.wpsl-player-item:last-child { border-bottom: none; }

.wpsl-player-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.80em;
}
.wpsl-player-frags, .wpsl-player-ping, .wpsl-player-time {
  margin-left: 6px;
  white-space: nowrap;
  font-size: 0.7em;
  opacity: 0.8;
}

.wpsl-no-players {
  font-style: italic;
  opacity: 0.6;
  font-size: 0.8em;
  padding: 3px 5px;
  text-align: center;
}

/* ERRORI / LOADING */
.wpsl-error, .wpsl-loading {
  text-align: center;
  padding: 20px;
  background: url(/wp-content/themes/editorial/assets/images/dark-mosaic.png) repeat center center !important;
  border-radius: 10px;
  color: #f55;
  font-weight: bold;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .wpsl-card {
    flex-direction: column;
  }
  .wpsl-card-players {
    margin-top: 10px;
    max-height: none;
    width: 100%;
  }
}

/* ====== DESKTOP 50/50 ====== */
@media (min-width: 769px) {
  .wpsl-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
  }

  .wpsl-card-left {
    flex: 0 0 50%;
  }

  .wpsl-card-players {
    flex: 0 0 48%;
    margin-top: 0;
  }
}
