/* Vista de detalle de país - estilo álbum de figuritas */
#country-detail-view {
  position: relative;
  border-radius: 14px;
  padding: 24px;
}

/* Sin fondo propio: se ve directamente la imagen de la selección detrás
   de los casilleros, sin ninguna caja opaca de por medio. */
#country-detail-view .section-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

#country-detail-view .view-header {
  margin-bottom: 1.2rem;
}

#country-detail-title,
#country-detail-subtitle {
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 0, 0, 0.6);
}

#back-to-pages-btn {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

#country-detail-title {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}

.country-detail-flag {
  width: 90px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.country-detail-count {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 14px;
  border-radius: 999px;
}

#country-detail-subtitle:empty {
  display: none;
  margin: 0;
}

#country-detail-subtitle {
  color: #0c1a0a;
  margin-bottom: 20px;
}

.country-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.slot-card.clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.slot-card.clickable:hover,
.slot-card.clickable:active {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
}

.slot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #b7ea9c;
  border-radius: 0;
  padding: 16px 10px;
  text-align: center;
  border: 3px solid transparent;
  min-height: 150px;
  position: relative;
  overflow: hidden;
}

.slot-card.filled {
  border-color: var(--rarity-color, #16a34a);
  background: #c9f0b3;
}

.slot-card.empty {
  opacity: 0.55;
}

.slot-card.has-photo {
  padding: 0;
  justify-content: flex-start;
  cursor: pointer;
  min-height: 0;
  /* Proporción de respaldo hasta que JS calcule la real de cada foto */
  aspect-ratio: 720 / 954;
}

.slot-photo {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.slot-card.landscape {
  aspect-ratio: 954 / 720;
}

.slot-card.has-photo .slot-info {
  width: 100%;
  padding: 10px 8px 12px;
}

.slot-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1c3115;
  color: #b7ea9c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.slot-avatar-empty {
  color: #1c3115;
}

.slot-name {
  color: #10230d;
  font-size: 13px;
  line-height: 1.2;
}

.slot-rarity {
  color: #10230d;
  font-size: 12px;
  font-weight: 700;
}

.slot-card.escudo-slot {
  border: 3px dashed rgba(245, 158, 11, 0.55);
}

.slot-card.escudo-slot.filled {
  border: 3px solid #f59e0b;
}

.slot-unique-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f59e0b;
  color: #1c1305;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/* Panel chico dentro de la vista de páginas del álbum */
.player-tile.locked {
  opacity: 0.5;
}

.player-tile.owned .player-avatar {
  background: var(--rarity-color, #16a34a);
}

.player-tile.has-photo {
  position: relative;
  padding: 0;
  overflow: hidden;
  justify-content: flex-start;
  min-height: 170px;
}

.player-photo {
  position: static;
  display: block;
  width: 100%;
  height: 130px;
  object-fit: contain;
  background: transparent;
}

.player-tile.has-photo.landscape {
  min-height: 110px;
}

.player-tile.landscape .player-photo {
  height: 110px;
  object-fit: contain;
  background: transparent;
}

.player-tile.has-photo .player-tile-info {
  width: 100%;
  padding: 8px 6px;
  text-align: center;
}

.player-tile.has-photo .player-name {
  color: #f5ffe9;
}

/* En celular, el cálculo automático de columnas (auto-fill/minmax)
   queda al límite justo y en anchos comunes de Android (~360-375px)
   termina colapsando a 1 sola columna — una fila larga para bajar y
   bajar. Acá lo forzamos a 2 columnas siempre, y recortamos el
   padding del contenedor para darles más lugar a las figuritas. */
@media (max-width: 640px) {
  #country-detail-view {
    padding: 16px;
  }

  .country-detail-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .slot-card {
    min-height: 130px;
    padding: 12px 8px;
  }

  .slot-name {
    font-size: 12px;
  }
}